Quantcast
Channel: Adam Young's Web Log
Viewing all articles
Browse latest Browse all 516

XPath for libvirt external snapshop path

$
0
0

The following xmllint XPath query will pull out the name of the backing file for a VM named fedora-server-36 and an external snapshot named fedora-36-post-install,

virsh snapshot-dumpxml fedora-server-36 fedora-server-36-post-install | xmllint --xpath "string(//domainsnapshot/disks/disk[@snapshot='external']/source/@file)" -

The string function extracts the attribute value.

This value can be used in the process of using or deleting the snapshot.


Viewing all articles
Browse latest Browse all 516

Latest Images

Trending Articles



Latest Images