]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virsh: add support for virConnectListAllDomains and clean up cmdList
authorPeter Krempa <pkrempa@redhat.com>
Tue, 19 Jun 2012 13:18:16 +0000 (15:18 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 21 Jun 2012 14:07:06 +0000 (16:07 +0200)
commitd62e51f86b4eb5b069985da88de3cc502f1e0e94
treecc00877703cbb79ff17d0327ad23949099a8cd8d
parentf1b872b25a4a143ec45fb1a6eac6604cfd0268a7
virsh: add support for virConnectListAllDomains and clean up cmdList

This patch makes use of the newly added api virConnectListAllDomains()
to list domains in virsh.

Virsh now represents lists of domains using an internal structure
vshDomainList. This structure contains the virDomainPtr list as provided
by virConnectListAllDomains() and the count of domains in the list.

For backwards compatibility, the function vshDomainListCollect was added
that tries to enumerate the domains using the new API and if the API is
not supported falls back to the older approach with the two list
functions.  The helper function also simulates filtering by all
currently supported flags added with virConnectListAllDomains().

This patch also cleans up the "list" command handler to use the new
helpers and adds new command line flags to make use of filtering.
tools/virsh.c
tools/virsh.pod