[Libvir] Difference between API functions virConnectNumOfDefinedDomains and virConnectNumOfDomains

Hello libvirt fellows, I have some problems to distinguish between those function calls in libvirt API:
virConnectNumOfDefinedDomains virConnectNumOfDomains
The API description states on both function that they will return me the number of active domain. Am I right if I assume that the first function virConnectNumOfDefinedDomains returns me all defined, but necessarily not running domains, and the second one only running and therefore active domains? Can you please help me and clarify this? Didn't had the chance to test this so far. But I will do so asap. Maybe the API documentation has to be updated in this point. Cheers, Jan

Jan Michael wrote:
Hello libvirt fellows,
I have some problems to distinguish between those function calls in libvirt API:
virConnectNumOfDefinedDomains virConnectNumOfDomains
The API description states on both function that they will return me the number of active domain. Am I right if I assume that the first function virConnectNumOfDefinedDomains returns me all defined, but necessarily not running domains, and the second one only running and therefore active domains?
I looked at this and I think you're right - it's a documentation error. I will ask Dan Berrange about this when he wakes up (he wrote that bit). Rich. -- Emerging Technologies, Red Hat http://et.redhat.com/~rjones/ 64 Baker Street, London, W1U 7DF Mobile: +44 7866 314 421 Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Directors: Michael Cunningham (USA), Charlie Peters (USA) and David Owens (Ireland)

On Mon, Apr 30, 2007 at 10:12:43AM +0100, Richard W.M. Jones wrote:
Jan Michael wrote:
Hello libvirt fellows,
I have some problems to distinguish between those function calls in libvirt API:
virConnectNumOfDefinedDomains virConnectNumOfDomains
The API description states on both function that they will return me the number of active domain. Am I right if I assume that the first function virConnectNumOfDefinedDomains returns me all defined, but necessarily not running domains, and the second one only running and therefore active domains?
I looked at this and I think you're right - it's a documentation error. I will ask Dan Berrange about this when he wakes up (he wrote that bit).
Yes, that's docs error. virConnectNumOfDomains lists active guests while virConnectNumOfDefinedDomains lists inactive guests. NB, there are not 100% guarenteed to be distinct sets, since obviously between the time of calling one & calling the other a guest may have started / stopped, thus moving from one list to the other. Mildly annoying, but not much we can do about it in practice since the underlying APIs can't always give us the complet list of active & inactive guests atomically. Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|

Daniel P. Berrange wrote:
On Mon, Apr 30, 2007 at 10:12:43AM +0100, Richard W.M. Jones wrote:
Jan Michael wrote:
Hello libvirt fellows,
I have some problems to distinguish between those function calls in libvirt API:
virConnectNumOfDefinedDomains virConnectNumOfDomains The API description states on both function that they will return me the number of active domain. Am I right if I assume that the first function virConnectNumOfDefinedDomains returns me all defined, but necessarily not running domains, and the second one only running and therefore active domains? I looked at this and I think you're right - it's a documentation error. I will ask Dan Berrange about this when he wakes up (he wrote that bit).
Yes, that's docs error. virConnectNumOfDomains lists active guests while virConnectNumOfDefinedDomains lists inactive guests. NB, there are not 100% guarenteed to be distinct sets, since obviously between the time of calling one & calling the other a guest may have started / stopped, thus moving from one list to the other. Mildly annoying, but not much we can do about it in practice since the underlying APIs can't always give us the complet list of active & inactive guests atomically.
Documentation fixed in CVS. Rich. -- Emerging Technologies, Red Hat http://et.redhat.com/~rjones/ 64 Baker Street, London, W1U 7DF Mobile: +44 7866 314 421 Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Directors: Michael Cunningham (USA), Charlie Peters (USA) and David Owens (Ireland)
participants (3)
-
Daniel P. Berrange
-
Jan Michael
-
Richard W.M. Jones