[libvirt] [PATCH] storage: Fix type PLOOP type check for storageVolUpload

Olga Krishtal okrishtal at virtuozzo.com
Mon Dec 5 09:25:01 UTC 2016

You are absolutely right.[?]

Thanks a lot.

From: John Ferlan <jferlan at redhat.com>
Sent: Friday, December 2, 2016 11:06:37 PM
To: libvir-list at redhat.com
Cc: Olga Krishtal
Subject: [PATCH] storage: Fix type PLOOP type check for storageVolUpload

Commit id '03e750f3' added support for checking the PLOOP type; however,
it used 'target.type' which no storage code ever fills in, so it will
never be set.  Change to just vol->type (could use vol->target.format
as well).

Signed-off-by: John Ferlan <jferlan at redhat.com>

 Found this by chance while digging through the code to investigate
 something else. Turns out the storage/volume code does not fill in
 the target.type field.

 src/storage/storage_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
index df65807..a79acc6 100644
--- a/src/storage/storage_driver.c
+++ b/src/storage/storage_driver.c
@@ -2427,7 +2427,7 @@ storageVolUpload(virStorageVolPtr obj,
     if (VIR_ALLOC(cbdata) < 0 ||
         VIR_STRDUP(cbdata->pool_name, pool->def->name) < 0)
         goto cleanup;
-    if (vol->target.type == VIR_STORAGE_VOL_PLOOP &&
+    if (vol->type == VIR_STORAGE_VOL_PLOOP &&
         VIR_STRDUP(cbdata->vol_path, vol->target.path) < 0)
         goto cleanup;


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20161205/e86b3c01/attachment-0001.htm>

More information about the libvir-list mailing list