public static List < Domain > getDefinedDomains ( Connect libvirt ) { try { List < Domain > domains = new ArrayList <> ( ) ; String [ ] domainNames = libvirt . listDefinedDomains ( ) ; for ( String name : domainNames ) { domains . add ( libvirt . domainLookupByName ( name ) ) ; } return domains ; } catch ( LibvirtException e ) { throw new LibvirtRuntimeException ( "Unable to list defined domains" , e ) ; } }
Get list of the inactive domains .