[libvirt-users] listing active and defined vs inactive and defined domains

Eric Blake eblake at redhat.com
Thu May 10 23:17:32 UTC 2012


On 05/04/2012 11:10 PM, John Wayne wrote:
> i am trying to list active + defined and inactive + defined domains using libvirt 0.9.4
> i can get active domains using:
> 
> def s_activedomains(conn):
> #get active domain ids
> numofdomains=libvirt.virConnect.numOfDomains(conn)
> activedomains=libvirt.virConnect.listDomainsID(conn)
> return activedomains
> 
> i am stuck on how to get inactive domains

virConnect.numOfDefinedDomains(conn)
virConnect.listDefinedDomains(conn)
then convert with virDomainLookupByName

I still want to add a new API that returns a filterable list of ALL
domains in one API, where the return is virDomainPtr rather than id or
name (basically, a virDomainPtr is name, id, and uuid all rolled into
one struct), and where you can use flags to filter the list (active
only, inactive only, transient only, persistent only, and possibly other
useful filters).  Too late for 0.9.12, but should hit in 0.9.13...

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20120510/8a5d62a7/attachment.sig>


More information about the libvirt-users mailing list