
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