[libvirt] [PATCH 4/8] domain_event: Add common domain event queue/flush helpers

Eric Blake eblake at redhat.com
Mon Jan 10 18:22:10 UTC 2011


On 01/10/2011 10:38 AM, Cole Robinson wrote:
> The same code for queueing, flushing, and deregistering events exists
> in multiple drivers, which will soon use these common functions.
> 
> Signed-off-by: Cole Robinson <crobinso at redhat.com>
> ---
>  src/conf/domain_event.c |   74 ++++++++++++++++++++++++++++++++++++++++++++++-
>  src/conf/domain_event.h |   17 +++++++++++
>  2 files changed, 90 insertions(+), 1 deletions(-)
> 
> diff --git a/src/conf/domain_event.c b/src/conf/domain_event.c
> index 4f0e4da..84f4709 100644
> --- a/src/conf/domain_event.c
> +++ b/src/conf/domain_event.c
> +void
> +virDomainEventStateFlush(virDomainEventStatePtr state,
> +                         virDomainEventDispatchFunc dispatchFunc,
> +                         void *opaque)
> +{
> +    virDomainEventQueue tempQueue;
> +
> +    state->isDispatching = 1;

s/1/true/, if you changed the type of isDispatching per my comment on 3/8.

> diff --git a/src/conf/domain_event.h b/src/conf/domain_event.h
> index 98a2870..9893cf2 100644
> --- a/src/conf/domain_event.h
> +++ b/src/conf/domain_event.h
> @@ -203,4 +203,21 @@ void virDomainEventQueueDispatch(virDomainEventQueuePtr queue,
>                                   virDomainEventDispatchFunc dispatch,
>                                   void *opaque);
>  
> +
> +void
> +virDomainEventStateQueue(virDomainEventStatePtr state,
> +                         virDomainEventPtr event);

ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)

> +void
> +virDomainEventStateFlush(virDomainEventStatePtr state,
> +                         virDomainEventDispatchFunc dispatchFunc,
> +                         void *opaque);

ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)

> +int
> +virDomainEventStateDeregister(virConnectPtr conn,
> +                              virDomainEventStatePtr state,
> +                              virConnectDomainEventCallback callback);

ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)


> +int
> +virDomainEventStateDeregisterAny(virConnectPtr conn,
> +                                 virDomainEventStatePtr state,
> +                                 int callbackID);

ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110110/064b766e/attachment-0001.sig>


More information about the libvir-list mailing list