Re: [RFC][scale] new API for querying domains stats

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

 



On 07/01/2014 02:35 AM, Daniel P. Berrange wrote:

> 1. A custom callback to run per API
> 
>      typedef (void)(*virDomainBlockInfoCallback)(virDomainPtr dom,
>                                                  bool isError,
>                                                  virDomainBlockInfoPtr info,
>                                                  void *opaque);
> 

It might be nice to require the callback to return an int; 0 to keep
going, non-zero to stop immediately.

>     int virDomainGetBlockInfoAsync(virDomainPtr dom,
>                                    const char *disk,
>                                    virDomainBlockInfoCallback cb,
>                                    void *opaque,
>                                    unsigned int flags);

What should this function return on success, 0 or the number of times
the callback was reached?  However, even if we add a callback return
value (non-zero to quit immediately), I don't think feeding it directly
to the return value is nice; we still want to reserve negative values
for errors (couldn't even invoke callbacks, perhaps because dom was a
bad pointer).  Besides, a user can always use opaque to collect counts
of how many times the callback was invoked, and/or a specific return
value on early exit.


-- 
Eric Blake   eblake redhat com    +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]