]> git.proxmox.com Git - qemu.git/commitdiff
QMP: Introduce VNC_INITIALIZED event
authorLuiz Capitulino <lcapitulino@redhat.com>
Thu, 14 Jan 2010 16:50:59 +0000 (14:50 -0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Tue, 19 Jan 2010 22:31:04 +0000 (16:31 -0600)
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 <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
QMP/qmp-events.txt
monitor.c
monitor.h
vnc.c

index 1e87eb16c6ecace8dfa16a52b91f79bb191836a4..dc48cccea17444eb8ae1b083d2e2e1f8decd8761 100644 (file)
@@ -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'.
index 2540d9467df590907a11ffcc1feb5f080e6261af..fea73834d0da9510e42e452cbbc371ced8facda1 100644 (file)
--- 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;
index 42386de222ce6b9554e260d3b9c601cdd3fc82fe..2da30e880429ced0a9aedd100e4b1a8e4dbff630 100644 (file)
--- 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 a590bb9c81eb428606e1a84d459969b64b9199a5..c7d6652e1556d5c99ea0e7a5da7512f9f66f898c 100644 (file)
--- 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);