[PATCH 3/3] test: Fix parsing nested <volume> XML

Cole Robinson posted 3 patches 3 years, 3 months ago
[PATCH 3/3] test: Fix parsing nested <volume> XML
Posted by Cole Robinson 3 years, 3 months ago
Reproducer:

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

Fixes: b3e33a0ef7e62169175280c647aa9ac361bd554d

Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
 src/test/test_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 8675f8ad07..67c70de11d 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -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;
 
-- 
2.37.3
Re: [PATCH 3/3] test: Fix parsing nested <volume> XML
Posted by Peter Krempa 3 years, 3 months ago
On Mon, Oct 17, 2022 at 12:16:41 -0400, Cole Robinson wrote:
> Reproducer:
> 
> ./build/tools/virsh \
>     --connect test:///`pwd`/examples/xml/test/testnodeinline.xml \
>     vol-list default-pool
> 
> Fixes: b3e33a0ef7e62169175280c647aa9ac361bd554d
> 
> Signed-off-by: Cole Robinson <crobinso@redhat.com>
> ---

Oops.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>