[libvirt] [PATCH 09/11] event: Add guest agent lifecycle event
Eric Blake
eblake at redhat.com
Thu Nov 20 18:59:20 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.
> ---
Actually, after seeing patch 11, I think this event is too narrow. You
are only reporting if the guest agent on org.qemu.guest_agent.0 changes
state. But a user can provide more than one channel, and the
VSERPORT_CHANGE event works for every channel. I think we need to
broaden the definition of the event to allow the event on EVERY virtio
channel, and include the name of _which_ channel had the event, so that
someone using any other channel can also tell if their custom code in
the guest is properly connecting to that channel.
> +/**
> + * virConnectDomainEventAgentLifecycleCallback:
> + * @conn: connection object
> + * @dom: domain on which the event occurred
> + * @state: new state of the guest agent, one of virConnectDomainEventAgentLifecycleState
> + * @reason: reason for state change; currently only 0 is passed denoting change
> + * in the guest agent socket state
> + * @opaque: application specified data
> + *
> + * This callback occurs when libvirt detects a change in the state of a guest
> + * agent.
> + *
> + * The callback signature to use when registering for an event of type
> + * VIR_DOMAIN_EVENT_ID_AGENT_LIFECYCLE with virConnectDomainEventRegisterAny()
> + */
> +typedef void (*virConnectDomainEventAgentLifecycleCallback)(virConnectPtr conn,
> + virDomainPtr dom,
> + int state,
> + int reason,
> + void *opaque);
Thus, I think this signature needs an additional const char *channel
name, which provides the name of which agent channel is changing.
> +++ b/src/remote/remote_protocol.x
> @@ -3108,6 +3108,14 @@ struct remote_connect_get_all_domain_stats_args {
> unsigned int flags;
> };
>
> +struct remote_domain_event_callback_agent_lifecycle_msg {
> + int callbackID;
> + remote_nonnull_domain dom;
> +
> + int state;
> + int reason;
> +};
Similarly, you'll need a remote_nonnull_string as the channel name as
part of this RPC call.
--
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/f82632a9/attachment-0001.sig>
More information about the libvir-list
mailing list