]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
storage: Force setting of disk format type
authorJohn Ferlan <jferlan@redhat.com>
Mon, 8 Jun 2015 12:16:58 +0000 (08:16 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Tue, 23 Jun 2015 13:25:24 +0000 (09:25 -0400)
Commit id '832a9256' adjusted the code to recognize when the default
type of "unknown" was provided as the format type and to use "dos" if
found. Since the pool is built with "dos" and it could cause some
confusion when formatting the XML after building by seeing "unknown"
in the output, let's just adjust the pool's setting to "dos" so that
subsequent formats will see the value.

src/storage/storage_backend_disk.c

index a283a86bb4f06c37790d60004d343967b1e49c7e..ba70a5a4bec35093b357f36056d38a99c822d176 100644 (file)
@@ -472,8 +472,9 @@ virStorageBackendDiskBuildPool(virConnectPtr conn ATTRIBUTE_UNUSED,
         /* eg parted /dev/sda mklabel --script msdos */
         int format = pool->def->source.format;
         const char *fmt;
-        if (format == VIR_STORAGE_POOL_DISK_UNKNOWN ||
-            format == VIR_STORAGE_POOL_DISK_DOS)
+        if (format == VIR_STORAGE_POOL_DISK_UNKNOWN)
+            format = pool->def->source.format = VIR_STORAGE_POOL_DISK_DOS;
+        if (format == VIR_STORAGE_POOL_DISK_DOS)
             fmt = "msdos";
         else
             fmt = virStoragePoolFormatDiskTypeToString(format);