]> xenbits.xensource.com Git - libvirt.git/commitdiff
test: Fix parsing nested <volume> XML
authorCole Robinson <crobinso@redhat.com>
Mon, 17 Oct 2022 16:11:22 +0000 (12:11 -0400)
committerCole Robinson <crobinso@redhat.com>
Wed, 19 Oct 2022 20:40:36 +0000 (16:40 -0400)
Reproducer:

./build/tools/virsh \
    --connect test:///`pwd`/examples/xml/test/testnodeinline.xml \
    vol-list default-pool

Fixes: b3e33a0ef7e62169175280c647aa9ac361bd554d
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
src/test/test_driver.c

index 8675f8ad07726b797a1f11dd93e0b433b2d68e16..67c70de11d0c032c2f7be2aba8a6e0eda213e9e0 100644 (file)
@@ -1152,7 +1152,7 @@ testOpenVolumesForPool(const char *file,
     g_autofree xmlNodePtr *nodes = NULL;
     g_autoptr(virStorageVolDef) volDef = NULL;
 
-    num = virXPathNodeSet("/pool/volume", ctxt, &nodes);
+    num = virXPathNodeSet("./volume", ctxt, &nodes);
     if (num < 0)
         return -1;