[libvirt] [PATCH 09/11] event: Add guest agent lifecycle event

Eric Blake eblake at redhat.com
Thu Nov 20 18:54:28 UTC 2014


On 11/19/2014 03:23 AM, Peter Krempa wrote:
> As qemu is now able to notify us about change of the channel state used
> for communication with the guest agent we now can more precisely track
> the state of the guest agent.
> 
> To allow notifying management apps this patch implements a new event
> that will be triggered on changes of the guest agent state.
> ---
>  daemon/remote.c                  | 36 +++++++++++++++++++
>  include/libvirt/libvirt-domain.h | 28 +++++++++++++++
>  src/conf/domain_event.c          | 78 ++++++++++++++++++++++++++++++++++++++++
>  src/conf/domain_event.h          |  9 +++++
>  src/libvirt_private.syms         |  2 ++
>  src/remote/remote_driver.c       | 31 ++++++++++++++++
>  src/remote/remote_protocol.x     | 16 ++++++++-
>  src/remote_protocol-structs      |  7 ++++
>  tools/virsh-domain.c             | 40 +++++++++++++++++++++
>  9 files changed, 246 insertions(+), 1 deletion(-)
> 

> +++ b/include/libvirt/libvirt-domain.h
> @@ -3332,6 +3332,33 @@ typedef void (*virConnectDomainEventTunableCallback)(virConnectPtr conn,
>                                                       void *opaque);
> 
> 
> +typedef enum {
> +    VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_CONNECTED = 1, /* agent connected */
> +    VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_DISCONNECTED = 2, /* agent disconnected */
> +} virConnectDomainEventAgentLifecycleState;

Do we want to explicitly reserve 0 for unknown state?  Do we want to
provide a _LAST flag so that additions of future states can be detected
by the increase in the value of _LAST?

Everything else looks good.

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

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


More information about the libvir-list mailing list