]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
storage: Directory shouldn't be listed as type 'file'
authorPeter Krempa <pkrempa@redhat.com>
Thu, 11 Aug 2011 09:37:17 +0000 (11:37 +0200)
committerEric Blake <eblake@redhat.com>
Thu, 11 Aug 2011 19:34:26 +0000 (13:34 -0600)
Fix internals of libvirt for new storage volume type.
Libvirt reported an invalid type of the volume.

BZ #727088

include/libvirt/libvirt.h.in
src/storage/storage_backend_fs.c

index b1bda31169b2f9bc625dd0b5aaaccb2b7e4ef9c4..aa29fb66946b5bb892e3e1b7962dfda3ddd9dc76 100644 (file)
@@ -1705,6 +1705,7 @@ typedef virStorageVol *virStorageVolPtr;
 typedef enum {
   VIR_STORAGE_VOL_FILE = 0,     /* Regular file based volumes */
   VIR_STORAGE_VOL_BLOCK = 1,    /* Block based volumes */
+  VIR_STORAGE_VOL_DIR = 2,      /* Directory-passthrough based volume */
 } virStorageVolType;
 
 typedef enum {
index 058e00ce2ff9a0615b25c3f7e6976140c732d53b..ff5afaa78a9e15448835a53a3843e9b897034b68 100644 (file)
@@ -675,6 +675,10 @@ virStorageBackendFileSystemRefresh(virConnectPtr conn ATTRIBUTE_UNUSED,
                 goto cleanup;
         }
 
+        /* directory based volume */
+        if (vol->target.format == VIR_STORAGE_FILE_DIR)
+            vol->type = VIR_STORAGE_VOL_DIR;
+
         if (backingStore != NULL) {
             vol->backingStore.path = backingStore;
             vol->backingStore.format = backingStoreFormat;