docs: recipes: Update xpath command

Link: https://lists.libguestfs.org/archives/list/guestfs@lists.libguestfs.org/thread/SOWJHHHJXDFAKSCCLXCNUE5X7W22VUEQ/
Reported-by: Emmanuel Kasper
This commit is contained in:
Richard W.M. Jones
2024-11-18 14:05:06 +00:00
parent 73186b154c
commit 4ebec324fe

View File

@@ -398,18 +398,18 @@ Save the following script into a file called F<product-name.sh>:
Make the script executable and run it on a named guest:
# product-name.sh RHEL60x64
Red Hat Enterprise Linux Server release 6.0 (Santiago)
$ product-name.sh fedora-40.img
Fedora Linux 40 (Forty)
You can also use an XPath query on the L<virt-inspector(1)> XML using
the C<xpath> command line tool or from your favourite programming
language:
# virt-inspector RHEL60x64 > xml
# xpath '//product_name' < xml
Found 1 nodes:
$ virt-inspector -a fedora-40.img > xml
$ xpath -e '//product_name' < xml
Found 1 nodes in stdin:
-- NODE --
<product_name>Red Hat Enterprise Linux Server release 6.0 (Santiago)</product_name>
<product_name>Fedora Linux 40 (Forty)</product_name>
=head1 Get the default boot kernel for a Linux VM