[libvirt] [PATCH] storage: Set correct vol->type at VolCreate

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. Signed-off-by: John Ferlan <jferlan@redhat.com> --- src/storage/storage_backend_fs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c index b751687..0eebac3 100644 --- a/src/storage/storage_backend_fs.c +++ b/src/storage/storage_backend_fs.c @@ -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", -- 2.1.0

On Mon, Jun 29, 2015 at 02:24:37PM -0400, John Ferlan wrote:
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.
Signed-off-by: John Ferlan <jferlan@redhat.com> --- src/storage/storage_backend_fs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c index b751687..0eebac3 100644 --- a/src/storage/storage_backend_fs.c +++ b/src/storage/storage_backend_fs.c @@ -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",
ACK looks like trivial fix, Daniel -- Daniel Veillard | Open Source and Standards, Red Hat veillard@redhat.com | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | virtualization library http://libvirt.org/
participants (2)
-
Daniel Veillard
-
John Ferlan