mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35: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> |
||
---|---|---|
.. | ||
bash-completion | ||
nss | ||
wireshark | ||
libvirt_recover_xattrs.sh | ||
libvirt_win_icon_16x16.ico | ||
libvirt_win_icon_32x32.ico | ||
libvirt_win_icon_48x48.ico | ||
libvirt_win_icon_64x64.ico | ||
libvirt-guests.service.in | ||
libvirt-guests.sh.in | ||
meson.build | ||
virsh_win_icon.rc | ||
virsh-backup.c | ||
virsh-backup.h | ||
virsh-checkpoint.c | ||
virsh-checkpoint.h | ||
virsh-completer-checkpoint.c | ||
virsh-completer-checkpoint.h | ||
virsh-completer-domain.c | ||
virsh-completer-domain.h | ||
virsh-completer-host.c | ||
virsh-completer-host.h | ||
virsh-completer-interface.c | ||
virsh-completer-interface.h | ||
virsh-completer-network.c | ||
virsh-completer-network.h | ||
virsh-completer-nodedev.c | ||
virsh-completer-nodedev.h | ||
virsh-completer-nwfilter.c | ||
virsh-completer-nwfilter.h | ||
virsh-completer-pool.c | ||
virsh-completer-pool.h | ||
virsh-completer-secret.c | ||
virsh-completer-secret.h | ||
virsh-completer-snapshot.c | ||
virsh-completer-snapshot.h | ||
virsh-completer-volume.c | ||
virsh-completer-volume.h | ||
virsh-completer.c | ||
virsh-completer.h | ||
virsh-console.c | ||
virsh-console.h | ||
virsh-domain-event.c | ||
virsh-domain-event.h | ||
virsh-domain-monitor.c | ||
virsh-domain-monitor.h | ||
virsh-domain.c | ||
virsh-domain.h | ||
virsh-edit.c | ||
virsh-host.c | ||
virsh-host.h | ||
virsh-interface.c | ||
virsh-interface.h | ||
virsh-network.c | ||
virsh-network.h | ||
virsh-nodedev.c | ||
virsh-nodedev.h | ||
virsh-nwfilter.c | ||
virsh-nwfilter.h | ||
virsh-pool.c | ||
virsh-pool.h | ||
virsh-secret.c | ||
virsh-secret.h | ||
virsh-snapshot.c | ||
virsh-snapshot.h | ||
virsh-util.c | ||
virsh-util.h | ||
virsh-volume.c | ||
virsh-volume.h | ||
virsh.c | ||
virsh.h | ||
virt-admin-completer.c | ||
virt-admin-completer.h | ||
virt-admin.c | ||
virt-admin.h | ||
virt-host-validate-bhyve.c | ||
virt-host-validate-bhyve.h | ||
virt-host-validate-ch.c | ||
virt-host-validate-ch.h | ||
virt-host-validate-common.c | ||
virt-host-validate-common.h | ||
virt-host-validate-lxc.c | ||
virt-host-validate-lxc.h | ||
virt-host-validate-qemu.c | ||
virt-host-validate-qemu.h | ||
virt-host-validate.c | ||
virt-login-shell-helper.c | ||
virt-login-shell.c | ||
virt-login-shell.conf | ||
virt-pki-query-dn.c | ||
virt-pki-validate.in | ||
virt-sanlock-cleanup.in | ||
virt-xml-validate.in | ||
vsh-table.c | ||
vsh-table.h | ||
vsh.c | ||
vsh.h |