libvirt/docs
Daniel P. Berrangé 8603b3d76c tools: add '--xpath EXPRESSION --wrap' args to all dumpxml commands
While you can chain the virsh output up to a later 'xmllint' or 'xpath'
command, integrating it into virsh avoids needs for installing extra
binaries which we've often found to be missing on production installs
of libvirt. It also gives better response if the initial virsh command
hits an error, as you don't get an aborted pipeline.

    $ virsh pool-dumpxml --xpath //permissions default
    <permissions>
      <mode>0711</mode>
      <owner>1000</owner>
      <group>1000</group>
      <label>unconfined_u:object_r:svirt_home_t:s0</label>
    </permissions>

If multiple nodes match, they are emitted individually:

    $ virsh dumpxml --xpath '//devices/*/address[@type="pci"]' --wrap demo
    <address type="pci" domain="0x0000" bus="0x05" slot="0x00" function="0x0"/>
    <address type="pci" domain="0x0000" bus="0x03" slot="0x00" function="0x0"/>
    ...snip...
    <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x0" multifunction="on"/>
    <address type="pci" domain="0x0000" bus="0x07" slot="0x00" function="0x0"/>

but if intending to post-process the output further, the results
can be wrapped in a parent node

    $ virsh dumpxml --xpath '//devices/*/address[@type="pci"]' --wrap demo
    <nodes>
      <address type="pci" domain="0x0000" bus="0x05" slot="0x00" function="0x0"/>
      <address type="pci" domain="0x0000" bus="0x03" slot="0x00" function="0x0"/>
      ...snip...
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x0" multifunction="on"/>
      <address type="pci" domain="0x0000" bus="0x07" slot="0x00" function="0x0"/>
    </nodes>

Fixes https://gitlab.com/libvirt/libvirt/-/issues/244
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-06-20 10:40:45 +01:00
..
css docs: Adapt to semantic tag usage of docutils-0.17 and later 2022-04-13 13:02:06 +02:00
fonts docs: Move font definitions with other CSS files 2022-01-04 15:47:28 +01:00
gitdm gitdm: Add other email into Red Hat company list 2021-10-12 16:46:45 +02:00
go docs: Simplify passing of 'href_base' XSL variable 2022-04-12 12:53:32 +02:00
html meson: add rule to build and install only web documentation 2020-08-03 09:27:06 +02:00
images docs: Drop node.gif 2022-01-21 10:17:11 +01:00
js meson: add rule to build and install only web documentation 2020-08-03 09:27:06 +02:00
kbase kbase: launch_security_sev: Break up overly long line 2022-06-13 16:09:32 +02:00
logos docs: fix misc spelling errors reported by codespell 2020-10-05 10:28:37 +01:00
manpages tools: add '--xpath EXPRESSION --wrap' args to all dumpxml commands 2022-06-20 10:40:45 +01:00
404.html.in Use https:// links for most sites 2017-10-16 10:22:34 +01:00
acl.html.in Prefer https: everywhere where possible 2020-09-01 21:58:46 +02:00
aclpolkit.rst docs: html.in: Convert aclpolkit to rst 2021-03-15 17:31:35 +01:00
advanced-tests.rst lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
android-chrome-192x192.png docs: add full set of "favicon" files to support modern clients 2017-08-02 17:00:11 +01:00
android-chrome-256x256.png docs: add full set of "favicon" files to support modern clients 2017-08-02 17:00:11 +01:00
api_extension.rst docs: Update obsolete reference to formatdomain.html.in 2022-03-22 11:05:09 +01:00
api.rst docs: Remove extra leading slash in 'api' and 'formatdomaincaps' pages 2022-06-01 12:27:10 +02:00
apple-touch-icon.png docs: add full set of "favicon" files to support modern clients 2017-08-02 17:00:11 +01:00
apps.rst docs: Update various URLs 2022-05-24 12:19:16 +02:00
auditlog.rst docs: html.in: Convert auditlog to rst 2021-03-15 17:31:57 +01:00
auth.rst docs: auth: Fix a couple of stylistic issues 2021-03-23 17:55:06 +01:00
best-practices.rst Prefer https: for Red Hat websites 2020-09-01 21:58:46 +02:00
bindings.rst docs: Update more links to point to the new Go modules 2021-12-09 12:16:17 +01:00
browserconfig.xml docs: add full set of "favicon" files to support modern clients 2017-08-02 17:00:11 +01:00
bugs.rst docs: bugs: Remove raw HTML anchor 'quality' 2022-04-25 16:33:01 +02:00
cgroups.rst docs: Convert 'cgroups' page to rST 2022-04-01 16:33:19 +02:00
ci.rst docs: switch ci status page to use Go -module repos 2021-06-09 14:48:40 +01:00
coding-style.rst docs: coding-style: One variable declaration per line 2022-01-19 14:54:08 +01:00
committer-guidelines.rst meson: adjust our documentation to mention meson instead of autoconf 2020-08-03 09:27:09 +02:00
compiling.rst docs/compiling: Add note on how to check minimum meson version 2021-03-16 10:49:33 +01:00
contact.rst docs: contact: recommend the TLS port for IRC 2022-06-07 15:22:32 +02:00
contribute.rst docs: contact: Remove HTML anchors and adjust documents using them 2022-04-25 16:33:01 +02:00
csharp.rst docs: convert 'csharp' page to rst 2022-04-07 15:10:26 +02:00
daemons.rst docs: Move 'tlscerts' page to 'kbase/' 2022-04-07 15:10:26 +02:00
dbus.rst docs: convert 'dbus' page to rst 2022-04-07 15:10:26 +02:00
docs.rst docs: Fix link to 'tlscerts' article 2022-06-01 12:27:10 +02:00
downloads.rst docs: downloads: fix link to libvirt GitLab group 2022-03-11 14:29:31 +01:00
drivers.rst docs: drivers: Mention KVM/HVF in the link of qemu driver 2022-05-19 10:10:31 +02:00
drvbhyve.rst docs: drvbhve: Fix local anchor links 2022-04-19 16:19:48 +02:00
drvch.rst Add basic driver for the Cloud-Hypervisor 2021-06-04 10:56:06 +01:00
drvesx.rst Correct links to TLS certificate setup page 2022-04-25 16:33:01 +02:00
drvhyperv.rst docs: Update various URLs 2022-05-24 12:19:16 +02:00
drvlxc.rst docs: formatdomain: Remove 'elementsOSContainer' anchor 2022-06-01 12:27:09 +02:00
drvnodedev.rst docs: Convert 'formatnode' page to rst 2022-04-19 16:19:48 +02:00
drvopenvz.rst docs: Convert 'drvopenvz' page to rST 2022-04-01 16:33:19 +02:00
drvqemu.rst docs: drvqemu: Fix the syntax typo of Hypervisor.framework link 2022-05-19 10:10:33 +02:00
drvsecret.rst docs: Convert 'drvsecret' page to rST 2022-04-01 16:33:19 +02:00
drvtest.rst docs: Convert 'drvtest' page to rST 2022-04-01 16:33:19 +02:00
drvvbox.rst docs: Convert 'drvvbox' page to rST 2022-04-01 16:33:19 +02:00
drvvirtuozzo.rst docs: Convert 'drvvirtuozzo' page to rST 2022-04-01 16:33:19 +02:00
drvvmware.rst docs: Convert 'drvvmware' page to rST 2022-04-01 16:33:19 +02:00
drvxen.rst docs: Convert 'drvxen' page to rST 2022-04-01 16:33:19 +02:00
errors.rst docs: Convert 'errors' page to rST 2022-03-08 17:40:47 +01:00
favicon-16x16.png docs: add full set of "favicon" files to support modern clients 2017-08-02 17:00:11 +01:00
favicon-32x32.png docs: add full set of "favicon" files to support modern clients 2017-08-02 17:00:11 +01:00
favicon.ico docs: add full set of "favicon" files to support modern clients 2017-08-02 17:00:11 +01:00
firewall.rst docs: Convert 'formatnwfilter' page to rst 2022-04-19 16:19:48 +02:00
format.rst docs: Convert 'format' page to rST 2022-04-01 16:33:19 +02:00
formatbackup.rst docs: formatdomain: Remove 'elementsDisks' anchor 2022-06-01 12:27:09 +02:00
formatcaps.rst docs: formatcaps: Fix anchors of links into formatdomain.rst 2022-06-01 12:27:10 +02:00
formatcheckpoint.rst docs: formatdomain: Remove 'elementsDisks' anchor 2022-06-01 12:27:09 +02:00
formatdomain.rst conf: virtiofs: add thread_pool element 2022-06-16 14:58:25 +02:00
formatdomaincaps.rst docs: Remove extra leading slash in 'api' and 'formatdomaincaps' pages 2022-06-01 12:27:10 +02:00
formatnetwork.rst docs: formatdomain: Remove 'elementsNICSDirect' anchor 2022-06-01 12:27:09 +02:00
formatnetworkport.rst docs: formatdomain: Remove 'elementsNICSDirect' anchor 2022-06-01 12:27:09 +02:00
formatnode.rst docs: formatdomain: Remove 'elementsHostDev' anchor 2022-06-01 12:27:09 +02:00
formatnwfilter.rst docs: Convert 'formatnwfilter' page to rst 2022-04-19 16:19:48 +02:00
formatsecret.rst docs: formatdomain: Remove 'elementsTpm' anchor 2022-06-01 12:27:10 +02:00
formatsnapshot.rst docs: formatdomain: Remove 'seclabel' anchor 2022-06-01 12:27:10 +02:00
formatstorage.rst storage: Introduce 'extended_l2' feature for storage volume 2021-12-21 13:23:09 +01:00
formatstoragecaps.rst docs: Convert 'formatstoragecaps' page to rST 2022-04-07 17:15:52 +02:00
formatstorageencryption.rst docs: formatstorageencryption: Use correct anchor into formatsecret page 2022-06-01 12:27:10 +02:00
glib-adoption.rst docs: glib-adoption: add string arrays and objects 2020-10-02 14:10:44 +02:00
goals.rst docs: Convert 'goals' to rST 2022-03-08 17:40:47 +01:00
governance.rst docs: governance: Remove unused HTML anchors 2022-04-25 16:33:01 +02:00
hacking.rst Drop YouCompleteMe and color_coded integration 2022-03-17 14:35:05 +01:00
hooks.rst docs: Convert 'hooks' page to rST 2022-04-01 16:33:20 +02:00
index.html.in docs: Add support page for libvirt on macOS 2022-01-25 16:54:44 +01:00
java.rst docs: Convert 'java' page to rST 2022-04-01 16:33:20 +02:00
libvirt-go-xml.rst docs: introduce stubs for new libvirt Go packages 2021-06-07 17:04:14 +01:00
libvirt-go.rst docs: introduce stubs for new libvirt Go packages 2021-06-07 17:04:14 +01:00
logging.rst docs: logging: Replace example by link to kbase/debuglogs.html 2022-04-01 16:33:20 +02:00
macos.rst docs: Add support page for libvirt on macOS 2022-01-25 16:54:44 +01:00
manifest.json docs: Fix syntax-check error 2017-08-02 15:00:28 -04:00
meson.build docs: Add HTML reference checker 2022-06-01 12:27:10 +02:00
migration.rst docs: Move all images to a subdirectory 2022-01-04 15:47:25 +01:00
mstile-150x150.png docs: add full set of "favicon" files to support modern clients 2017-08-02 17:00:11 +01:00
newapi.xsl docs: Format @variable properly 2021-09-15 08:37:40 +02:00
newreposetup.rst docs: Document CIRRUS_GITHUB_REPO variable 2020-06-11 12:03:41 +02:00
nss.rst docs: Convert 'nss' page to rST 2022-03-10 17:52:07 +01:00
page.xsl docs: page.xsl: Fix link to 'mailing-lists' section 2022-06-01 12:27:10 +02:00
pci-addresses.rst Fix spelling 2021-04-15 15:42:21 +02:00
pci-hotplug.rst docs: pci-hotplug: Fix local anchor links 2022-04-19 16:19:48 +02:00
php.rst docs: Convert 'php' page to rST 2022-04-01 16:33:20 +02:00
platforms.rst docs: Fix spelling for Homebrew 2022-04-14 11:54:28 +02:00
programming-languages.rst Fix capitalization "CLang" -> "Clang" 2020-11-12 15:01:42 +01:00
python.rst docs: convert 'python' page to rst 2022-04-07 15:10:26 +02:00
remote.rst docs: remote: Fix anchor names in links to uri.html 2022-06-01 12:27:10 +02:00
securityprocess.rst docs: contact: Remove HTML anchors and adjust documents using them 2022-04-25 16:33:01 +02:00
site.xsl docs: Simplify passing of 'href_base' XSL variable 2022-04-12 12:53:32 +02:00
storage.rst docs: formatdomain: Remove 'elementsDisks' anchor 2022-06-01 12:27:09 +02:00
strategy.rst docs: Convert 'strategy' to rST 2022-03-08 17:40:47 +01:00
styleguide.rst docs: Document list-tables as recommended 2020-05-11 13:55:27 +02:00
submitting-patches.rst docs/submitting-patches: add reference to DCO 2020-10-09 09:12:39 +02:00
support.rst docs: Convert 'support' page to rST 2022-03-08 17:40:47 +01:00
testapi.rst docs: Convert 'testapi' page to rST 2022-03-10 17:52:07 +01:00
testsuites.rst docs: Convert 'testsuites' page to rST 2022-03-10 17:52:07 +01:00
testtck.rst docs: Convert 'testtck' page to rST 2022-03-10 17:52:07 +01:00
uri.rst uri: Fix link to qemu KVM example config 2022-06-01 12:27:10 +02:00
windows.rst docs: Update URL for MinGW 2022-05-24 12:19:15 +02:00