On Thu, Nov 14, 2024 at 06:32:10PM +0100, Emmanuel Kasper wrote:
Hi
The xpath example at https://libguestfs.org/virt-resize.1.html
|virsh dumpxml guestname | xpath /domain/devices/disk/source|
does not work anymore with recent xpath versions ?
virsh dumpxml domain | xpath /domain/devices/disk/source Usage: /usr/bin/xpath [options] -e query [-e query...] [filename...] If no filenames are given, supply XML on STDIN. You must provide at least one query. Each supplementary query is done in order, the previous query giving the context of the next one.
On Debian 12 and Fedora41 I need to add the -e switch to get the command working:
virsh dumpxml domain | xpath -e /domain/devices/disk/source Found 1 nodes in stdin: -- NODE -- <source file="/var/lib/libvirt/images/debian11.qcow2" />
On both systems I have xpath 1.48 coming from libxml-xpath-perl.
Thanks, I updated the documentation in a couple of places. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v