Re: [PATCH 2/5] python: add API exports for virConnectListAllDomains()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/20/2012 09:56 AM, Peter Krempa wrote:
> This patch adds export of the new API function
> virConnectListAllDomains() to the libvirt-python bindings. The
> virConnect object now has method "listAllDomains" that takes only the
> flags parameter and returns a python list of virDomain object
> corresponding to virDomainPtrs returned by the underlying api.
> 
> The implementation is done manually as the generator does not support
> wrapping list of virDomainPtrs into virDomain objects.
> ---
>  python/libvirt-override-api.xml       |   12 ++++++--
>  python/libvirt-override-virConnect.py |   12 ++++++++
>  python/libvirt-override.c             |   49 ++++++++++++++++++++++++++++++++-
>  3 files changed, 69 insertions(+), 4 deletions(-)

Just noticed another thing:


> +    <function name='virConnectListAllDomains' file='python'>
> +      <info>returns list of all defined domains</info>
> +      <arg name='conn' type='virConnectPtr' info='pointer to the hypervisor connection'/>
> +      <arg name='flags' type='unsigned int' info='optional flags'/>

This does not expose any way to trigger the underlying C code of passing
NULL as a means of just counting.  That might be useful, so maybe we need:

conn.numOfAllDomains

in python code, which wraps virConnectListAllDomains but passes NULL and
returns just an integer instead of a list.  After all, if we make RPC
more efficient for just counting when passing NULL, then it is feasible
to write python code that could benefit from that efficiency.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]