On Tue, Jul 01, 2014 at 09:35:21AM +0100, Daniel P. Berrange wrote:
For the async API design, I could see two potential designs
1. A custom callback to run per API
typedef (void)(*virDomainBlockInfoCallback)(virDomainPtr dom,
bool isError,
virDomainBlockInfoPtr info,
void *opaque);
int virDomainGetBlockInfoAsync(virDomainPtr dom,
const char *disk,
virDomainBlockInfoCallback cb,
void *opaque,
unsigned int flags);
2. A standard callback and a pair of APIs
typedef void *virDomainAsyncResult;
typedef (void)(*virDomainAsyncCallback)(virDomainPtr dom,
virDomainAsyncResult res);
void virDomainGetBlockInfoAsync(virDomainPtr dom,
const char *disk,
virDomainBlockInfoCallback cb,
void *opaque,
unsigned int flags);
int virDomainGetBlockInfoFinish(virDomainPtr dom,
virDomainAsyncResult res,
virDomainBlockInfoPtr info);
Could we consider an API which worked across all active domains?
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming and virtualization blog:
http://rwmj.wordpress.com
virt-top is 'top' for virtual machines. Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top