]> xenbits.xensource.com Git - libvirt.git/commitdiff
QED: Basic support for QED images
authorAdam Litke <agl@us.ibm.com>
Fri, 19 Nov 2010 16:18:16 +0000 (10:18 -0600)
committerEric Blake <eblake@redhat.com>
Fri, 19 Nov 2010 23:05:44 +0000 (16:05 -0700)
Add an entry in fileTypeInfo for QED image files.

Signed-off-by: Adam Litke <agl@us.ibm.com>
Cc: Stefan Hajnoczi <stefan.hajnoczi@uk.ibm.com>
Cc: Anthony Liguori <aliguori@linux.vnet.ibm.com>
src/util/storage_file.c
src/util/storage_file.h

index b17187695b03656cd316750d8ce2d4bf9d22f099..c011544b290b04a5466fd6592335b44cb7c4478c 100644 (file)
@@ -44,7 +44,7 @@ VIR_ENUM_IMPL(virStorageFileFormat,
               VIR_STORAGE_FILE_LAST,
               "raw", "dir", "bochs",
               "cloop", "cow", "dmg", "iso",
-              "qcow", "qcow2", "vmdk", "vpc")
+              "qcow", "qcow2", "qed", "vmdk", "vpc")
 
 enum lv_endian {
     LV_LITTLE_ENDIAN = 1, /* 1234 */
@@ -105,6 +105,8 @@ static int vmdk4GetBackingStore(char **, int *,
 #define QCOW2_HDR_EXTENSION_END 0
 #define QCOW2_HDR_EXTENSION_BACKING_FORMAT 0xE2792ACA
 
+#define QED_HDR_IMAGE_SIZE (4+4+4+4+8+8+8)
+
 /* VMDK needs at least this to find backing store,
  * other formats need less */
 #define STORAGE_MAX_HEAD (20*512)
@@ -152,6 +154,12 @@ static struct FileTypeInfo const fileTypeInfo[] = {
         LV_BIG_ENDIAN, 4, 2,
         QCOWX_HDR_IMAGE_SIZE, 8, 1, QCOW2_HDR_CRYPT, qcow2GetBackingStore,
     },
+    [VIR_STORAGE_FILE_QED] = {
+        /* http://wiki.qemu.org/Features/QED */
+        "QED\0", NULL,
+        LV_LITTLE_ENDIAN, -1, -1,
+        QED_HDR_IMAGE_SIZE, 8, 1, -1, NULL,
+    },
     [VIR_STORAGE_FILE_VMDK] = {
         "KDMV", NULL,
         LV_LITTLE_ENDIAN, 4, 1,
index 34ece6d8efe7cd65a2ca6cb7bbe9641f4d96e44f..37d52b44eda79022d4533663a74bd6557e1cbc84 100644 (file)
@@ -38,6 +38,7 @@ enum virStorageFileFormat {
     VIR_STORAGE_FILE_ISO,
     VIR_STORAGE_FILE_QCOW,
     VIR_STORAGE_FILE_QCOW2,
+    VIR_STORAGE_FILE_QED,
     VIR_STORAGE_FILE_VMDK,
     VIR_STORAGE_FILE_VPC,
     VIR_STORAGE_FILE_LAST,