diff options
Diffstat (limited to 'include/loopdev.h')
-rw-r--r-- | include/loopdev.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/loopdev.h b/include/loopdev.h index 0e3a7517a..bc68e526b 100644 --- a/include/loopdev.h +++ b/include/loopdev.h @@ -11,6 +11,14 @@ #define LO_CRYPT_DES 2 #define LO_CRYPT_CRYPTOAPI 18 +/* + * loop_info.lo_file_fmt_type + */ +#define LO_FILE_FMT_RAW 0 +#define LO_FILE_FMT_QCOW 1 +#define LO_FILE_FMT_VDI 2 +#define LO_FILE_FMT_VMDK 3 + #define LOOP_SET_FD 0x4C00 #define LOOP_CLR_FD 0x4C01 /* @@ -64,6 +72,7 @@ struct loop_info64 { uint8_t lo_crypt_name[LO_NAME_SIZE]; uint8_t lo_encrypt_key[LO_KEY_SIZE]; uint64_t lo_init[2]; + uint32_t lo_file_fmt_type; }; #define LOOPDEV_MAJOR 7 /* loop major number */ @@ -175,6 +184,7 @@ extern int loopcxt_ioctl_blocksize(struct loopdev_cxt *lc, uint64_t blocksize); int loopcxt_set_offset(struct loopdev_cxt *lc, uint64_t offset); int loopcxt_set_sizelimit(struct loopdev_cxt *lc, uint64_t sizelimit); int loopcxt_set_blocksize(struct loopdev_cxt *lc, uint64_t blocksize); +int loopcxt_set_file_fmt_type(struct loopdev_cxt *lc, uint32_t file_fmt_type); int loopcxt_set_flags(struct loopdev_cxt *lc, uint32_t flags); int loopcxt_set_backing_file(struct loopdev_cxt *lc, const char *filename); @@ -185,6 +195,8 @@ extern int loopcxt_get_offset(struct loopdev_cxt *lc, uint64_t *offset); extern int loopcxt_get_blocksize(struct loopdev_cxt *lc, uint64_t *blocksize); extern int loopcxt_get_sizelimit(struct loopdev_cxt *lc, uint64_t *size); extern int loopcxt_get_encrypt_type(struct loopdev_cxt *lc, uint32_t *type); +extern int loopcxt_get_file_fmt_type(struct loopdev_cxt *lc, uint32_t* file_fmt_type); +extern char *loopcxt_get_file_fmt_type_string(struct loopdev_cxt *lc); extern const char *loopcxt_get_crypt_name(struct loopdev_cxt *lc); extern int loopcxt_is_autoclear(struct loopdev_cxt *lc); extern int loopcxt_is_readonly(struct loopdev_cxt *lc); @@ -205,4 +217,6 @@ extern int loopcxt_is_used(struct loopdev_cxt *lc, uint64_t sizelimit, int flags); +extern int parse_file_fmt_type(const char *file_fmt_type_str, uint32_t *file_fmt_type); + #endif /* UTIL_LINUX_LOOPDEV_H */ |