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.
Showing
此差异已折叠。
想要评论请 注册 或 登录