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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
> 


Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]