[libvirt] [PATCH 2/3]: Fix storage_conf parsing for empty <source>

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

 



This patch fixes a minor bug in the storage_conf parsing.  Creating logical
volume pool XML without a source definition is a valid operation (for example,
if you just want to scan an already existing LVM group), but this bug was making
the parser reject that XML.  Bugfix from Dan Berrange, tested by me.

Signed-off-by: Chris Lalancette <clalance@xxxxxxxxxx>
Index: src/storage_conf.c
===================================================================
RCS file: /data/cvs/libvirt/src/storage_conf.c,v
retrieving revision 1.14
diff -u -r1.14 storage_conf.c
--- a/src/storage_conf.c	5 Sep 2008 12:03:45 -0000	1.14
+++ b/src/storage_conf.c	19 Sep 2008 08:18:41 -0000
@@ -295,7 +295,7 @@
         xmlNodePtr *nodeset = NULL;
         int nsource, i;
 
-        if ((nsource = virXPathNodeSet(conn, "/pool/source/device", ctxt, &nodeset)) <= 0) {
+        if ((nsource = virXPathNodeSet(conn, "/pool/source/device", ctxt, &nodeset)) < 0) {
             virStorageReportError(conn, VIR_ERR_XML_ERROR,
                         "%s", _("cannot extract storage pool source devices"));
             goto cleanup;
--
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]