<blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote">From my understanding virConnectListActiveDomains() is listing all the 
active (running) domains and virConnectListDefinedDomains() is listing 
all the inactive domains that are defined since if we create a domain 
directly from XML, i.e. non-persistent, we have the domain in active 
domains list but it's not defined. Only inactive but defined domains are
 in the defined list AFAIK.<br></blockquote>
<br>I can't find the function virConnectListActiveDomains(), did you mean virConnectListActiveDomains()?<br><br><blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote">

If we have 2 domains created *directly* from XML file, 3 persistent 
domains active and 4 domains inactive (but defined) we should be getting
 number 5 from virConnectListActiveDomains() since 2 + 3. For defined 
(inactive) domains we should be getting number for and total number 
should be 2 + 3 + 4 = 9 domains.</blockquote><div><br>Confused, do you missed some words? Shouldn't it be:<br><br>2 active but not defined<br>3 active but defined<br>4 inactive and defined<br>2 + 3 = 5 active<br>3 + 4 = 7 defined<br>
2 + 3 + 4 = 9 total<br><br>libvirt_list_domains() should gets 9;<br>libvirt_list_active_domains() gets 5<br>libivrt_list_inactive_domains() gets 4?<br>libvirt_list_defined_domains() (if there's such a function) gets 7?<br>
</div>