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

Peter Krempa pkrempa at redhat.com
Thu Nov 20 19:01:30 UTC 2014


On 11/20/14 19:54, Eric Blake wrote:
> 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?

Hmm, the 0 value also might be treated as
VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_PORT_STATUS or similar
denoting that the reason is that the socket state changed. This might
then change if we detect that the agent sent garbage or other stuff.

Providing an enum for this may be a way then.

Peter

> 
> Everything else looks good.
> 


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


More information about the libvir-list mailing list