]> xenbits.xensource.com Git - libvirt.git/commitdiff
storage: Set correct vol->type at VolCreate
authorJohn Ferlan <jferlan@redhat.com>
Mon, 29 Jun 2015 18:18:49 +0000 (14:18 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Tue, 30 Jun 2015 10:49:49 +0000 (06:49 -0400)
https://bugzilla.redhat.com/show_bug.cgi?id=1227664

If the requested format type for the new entry in the file system pool
is a 'dir', then be sure to set the vol->type correctly as would be done
when the pool is refreshed.

src/storage/storage_backend_fs.c

index b7516872916b1ef1eb62dafc032113aa37228c9e..0eebac3af30dd30bb36bc894ea5b3e05170e3f28 100644 (file)
@@ -1051,7 +1051,10 @@ virStorageBackendFileSystemVolCreate(virConnectPtr conn ATTRIBUTE_UNUSED,
                                      virStorageVolDefPtr vol)
 {
 
-    vol->type = VIR_STORAGE_VOL_FILE;
+    if (vol->target.format == VIR_STORAGE_FILE_DIR)
+        vol->type = VIR_STORAGE_VOL_DIR;
+    else
+        vol->type = VIR_STORAGE_VOL_FILE;
 
     VIR_FREE(vol->target.path);
     if (virAsprintf(&vol->target.path, "%s/%s",