[PATCH] qemu: Forbid specify target path for disk vol

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



target path for disk vol is just meaningless, and it's never used
but free()ed silently when creating the volume.
---
 src/conf/storage_conf.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
index e893b2d..5f4f264 100644
--- a/src/conf/storage_conf.c
+++ b/src/conf/storage_conf.c
@@ -1052,6 +1052,12 @@ virStorageVolDefParseXML(virStoragePoolDefPtr pool,
     }
 
     ret->target.path = virXPathString("string(./target/path)", ctxt);
+    if (ret->target.path && (pool->type == VIR_STORAGE_POOL_DISK)) {
+        virStorageReportError(VIR_ERR_XML_ERROR, "%s",
+                              _("target path for disk vol is just meaningless"));
+        goto cleanup;
+    }
+
     if (options->formatFromString) {
         char *format = virXPathString("string(./target/format/@type)", ctxt);
         if (format == NULL)
-- 
1.7.6

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]