]> xenbits.xensource.com Git - libvirt.git/commitdiff
vbox: fix stale comment about vdi storage type
authorEric Blake <eblake@redhat.com>
Wed, 14 May 2014 19:26:28 +0000 (13:26 -0600)
committerEric Blake <eblake@redhat.com>
Fri, 16 May 2014 06:22:18 +0000 (00:22 -0600)
The code had some todo's about adding 'vdi' to the list of
virStorageType, but we've already done that.

* src/vbox/vbox_tmpl.c (vboxStorageVolCreateXML)
(vboxStorageVolGetXMLDesc): Use enum value for vdi type.

Signed-off-by: Eric Blake <eblake@redhat.com>
src/vbox/vbox_tmpl.c

index a305fe2698d977d9e664a1cfa607cc31df0d2000..e124e6905f67b110613d7043c1dac50e1ea888e6 100644 (file)
@@ -8763,13 +8763,8 @@ static virStorageVolPtr vboxStorageVolCreateXML(virStoragePoolPtr pool,
         (def->type != VIR_STORAGE_VOL_FILE))
         goto cleanup;
 
-    /* TODO: for now only the vmdk, vpc and vdi type harddisk
-     * variants can be created, also since there is no vdi
-     * type in enum virStorageFileFormat {} the default
-     * will be to create vdi if nothing is specified in
-     * def->target.format
-     */
-
+    /* For now only the vmdk, vpc and vdi type harddisk
+     * variants can be created.  For historical reason, we default to vdi */
     if (def->target.format == VIR_STORAGE_FILE_VMDK) {
         VBOX_UTF8_TO_UTF16("VMDK", &hddFormatUtf16);
     } else if (def->target.format == VIR_STORAGE_FILE_VPC) {
@@ -9175,13 +9170,11 @@ static char *vboxStorageVolGetXMLDesc(virStorageVolPtr vol, unsigned int flags)
                         def.target.format = VIR_STORAGE_FILE_VMDK;
                     else if (STRCASEEQ("vhd", hddFormatUtf8))
                         def.target.format = VIR_STORAGE_FILE_VPC;
+                    else if (STRCASEEQ("vdi", hddFormatUtf8))
+                        def.target.format = VIR_STORAGE_FILE_VDI;
                     else
                         def.target.format = VIR_STORAGE_FILE_RAW;
 
-                    /* TODO: need to add vdi to enum virStorageFileFormat {}
-                     * and then add it here
-                     */
-
                     VBOX_UTF8_FREE(hddFormatUtf8);
                 }