[libvirt] libvirt zsh completions

Marko Myllynen myllynen at redhat.com
Wed Oct 5 09:29:59 UTC 2016


Hi,

FWIW, FYI, I've contributed completions for the commands part of libvirt
to zsh upstream, here's a quick screenshot:

$ virsh <TAB>
zsh: do you wish to see all 222 possibilities (111 lines)? n
$ virsh allocpages <TAB>
--add        --all        --cellno     --pagecount  --pagesize
$ virsh start <TAB>
f23-test        fedora-24-beta  rhel-7-server
$ virsh stop <TAB>
f24-test        rhel-6-server   ubuntu-16.04
$ 

There's also support for the -c/--connect flag and selective completion
support for the following (domains seen as an example above):

  + domains
  + interfaces
  + networks
  + devices
  + nwfilters
  + pools
  + secrets
  + snapshots
  + volumes

Supported commands are:

virsh virt-admin virt-host-validate virt-pki-validate virt-xml-validate

Since virt-admin requires root/sudo, there are some additional security
checks in zsh upstream to enable sudo for completions only by request.
This will require the next zsh release. I've uploaded a version of these
completions which uses sudo unconditionally to my fedorapeople.org page
and it can be used by the adventurous already today (by placing it under
/usr/share/zsh/*/functions/):

https://myllynen.fedorapeople.org/_libvirt

Cheers,

-- 
Marko Myllynen




More information about the libvir-list mailing list