From c759ca862fe0f92cf307cc858aa7ae7de3507d9a Mon Sep 17 00:00:00 2001 From: Luiz Capitulino Date: Tue, 26 Jan 2010 18:53:46 -0200 Subject: [PATCH 8/9] QMP: Introduce VNC_INITIALIZED event RH-Author: Luiz Capitulino Message-id: <1264532026-7620-9-git-send-email-lcapitulino@redhat.com> Patchwork-id: 6634 O-Subject: [PATCH RHEL6 qemu-kvm 8/8] QMP: Introduce VNC_INITIALIZED event Bugzilla: 549759 RH-Acked-by: Markus Armbruster RH-Acked-by: Daniel P. Berrange RH-Acked-by: Juan Quintela It's emitted when a VNC client session is activated by QEMU, client's information such as port, IP and auth ID (if the session is authenticated) are provided. Event example: { "event": "VNC_INITIALIZED", "timestamp": {"seconds": 1263475302, "microseconds": 150772}, "data": { "server": { "auth": "sasl", "family": "ipv4", "service": "5901", "host": "0.0.0.0"}, "client": { "family": "ipv4", "service": "46089", "host": "127.0.0.1", "sasl_username": "lcapitulino" } } } Signed-off-by: Luiz Capitulino Signed-off-by: Anthony Liguori (cherry picked from commit 0d2ed46af43365fd713532c5eb9450380635b694) --- QMP/qmp-events.txt | 6 ++++++ monitor.c | 3 +++ monitor.h | 1 + vnc.c | 1 + 4 files changed, 11 insertions(+), 0 deletions(-) Signed-off-by: Eduardo Habkost --- QMP/qmp-events.txt | 6 ++++++ monitor.c | 3 +++ monitor.h | 1 + vnc.c | 1 + 4 files changed, 11 insertions(+), 0 deletions(-) diff --git a/QMP/qmp-events.txt b/QMP/qmp-events.txt index 1e87eb1..dc48ccc 100644 --- a/QMP/qmp-events.txt +++ b/QMP/qmp-events.txt @@ -37,3 +37,9 @@ except that authentication ID is not provided. Description: Issued when the conection is closed. Data: 'server' and 'client' keys with the same keys as 'query-vnc'. + +6 VNC_INITIALIZED +----------------- + +Description: Issued when the VNC session is made active. +Data: 'server' and 'client' keys with the same keys as 'query-vnc'. diff --git a/monitor.c b/monitor.c index 5ae6339..9e46bdf 100644 --- a/monitor.c +++ b/monitor.c @@ -360,6 +360,9 @@ void monitor_protocol_event(MonitorEvent event, QObject *data) case QEVENT_VNC_CONNECTED: event_name = "VNC_CONNECTED"; break; + case QEVENT_VNC_INITIALIZED: + event_name = "VNC_INITIALIZED"; + break; case QEVENT_VNC_DISCONNECTED: event_name = "VNC_DISCONNECTED"; break; diff --git a/monitor.h b/monitor.h index 42386de..2da30e8 100644 --- a/monitor.h +++ b/monitor.h @@ -21,6 +21,7 @@ typedef enum MonitorEvent { QEVENT_POWERDOWN, QEVENT_STOP, QEVENT_VNC_CONNECTED, + QEVENT_VNC_INITIALIZED, QEVENT_VNC_DISCONNECTED, QEVENT_MAX, } MonitorEvent; diff --git a/vnc.c b/vnc.c index 1bf9694..a042f24 100644 --- a/vnc.c +++ b/vnc.c @@ -2112,6 +2112,7 @@ static int protocol_client_init(VncState *vs, uint8_t *data, size_t len) vnc_flush(vs); vnc_client_cache_auth(vs); + vnc_qmp_event(vs, QEVENT_VNC_INITIALIZED); vnc_read_when(vs, protocol_client_msg, 1); -- 1.6.3.rc4.29.g8146