mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
8603b3d76c
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> |
||
---|---|---|
.. | ||
index.rst | ||
libvirt-guests.rst | ||
libvirtd.rst | ||
meson.build | ||
virsh.rst | ||
virt-admin.rst | ||
virt-host-validate.rst | ||
virt-login-shell.rst | ||
virt-pki-query-dn.rst | ||
virt-pki-validate.rst | ||
virt-qemu-run.rst | ||
virt-sanlock-cleanup.rst | ||
virt-ssh-helper.rst | ||
virt-xml-validate.rst | ||
virtbhyved.rst | ||
virtinterfaced.rst | ||
virtlockd.rst | ||
virtlogd.rst | ||
virtlxcd.rst | ||
virtnetworkd.rst | ||
virtnodedevd.rst | ||
virtnwfilterd.rst | ||
virtproxyd.rst | ||
virtqemud.rst | ||
virtsecretd.rst | ||
virtstoraged.rst | ||
virtvboxd.rst | ||
virtvzd.rst | ||
virtxend.rst |