You are absolutely right.[?]
Thanks a lot.
________________________________
From: John Ferlan <jferlan(a)redhat.com>
Sent: Friday, December 2, 2016 11:06:37 PM
To: libvir-list(a)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(a)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;
--
2.7.4