]> git.ipfire.org Git - thirdparty/libvirt.git/commit
tools: add helper method for printing an XML document
authorDaniel P. Berrangé <berrange@redhat.com>
Thu, 16 Jun 2022 14:59:03 +0000 (15:59 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Mon, 20 Jun 2022 09:40:34 +0000 (10:40 +0100)
commit8615c19b5d8650e0ef5cfb2ab41cee3b4d433bbb
tree16ec2e8eebad3b0e2782438854df8f659eb762f3
parent812edc95a36b997d674ce4f3a56f4fd01f31904e
tools: add helper method for printing an XML document

The trivial case of fully printing an XML document is boring, but
this helper does more by allowing an XPath expression to be given.
It will then print just the subset of nodes which match the
expression. It either print each match as a standalone XML doc
or can put them into one new XML doc wrapped woith <nodes>...</nodes>

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
tools/virsh-util.c
tools/virsh-util.h