[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 7/8] QMP: Introduce VNC_DISCONNECTED event
From: |
Luiz Capitulino |
Subject: |
[Qemu-devel] [PATCH 7/8] QMP: Introduce VNC_DISCONNECTED event |
Date: |
Thu, 14 Jan 2010 14:50:58 -0200 |
It's emitted when a VNC client disconnects from QEMU, client's
information such as port and IP address are provided.
Event example:
{ "event": "VNC_DISCONNECTED",
"timestamp": { "seconds": 1262976601, "microseconds": 975795 },
"data": {
"server": { "auth": "sasl", "family": "ipv4",
"service": "5901", "host": "0.0.0.0" },
"client": { "family": "ipv4", "service": "58425",
"host": "127.0.0.1", "sasl_username": "foo" } } }
Signed-off-by: Luiz Capitulino <address@hidden>
---
QMP/qmp-events.txt | 6 ++++++
monitor.c | 3 +++
monitor.h | 1 +
vnc.c | 2 ++
4 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/QMP/qmp-events.txt b/QMP/qmp-events.txt
index d36da46..1e87eb1 100644
--- a/QMP/qmp-events.txt
+++ b/QMP/qmp-events.txt
@@ -31,3 +31,9 @@ Data: None.
Description: Issued when a VNC client establishes a connection.
Data: 'server' and 'client' keys with the same keys as 'query-vnc',
except that authentication ID is not provided.
+
+5 VNC_DISCONNECTED
+------------------
+
+Description: Issued when the conection is closed.
+Data: 'server' and 'client' keys with the same keys as 'query-vnc'.
diff --git a/monitor.c b/monitor.c
index 4a6af42..5ac1c5c 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_DISCONNECTED:
+ event_name = "VNC_DISCONNECTED";
+ break;
default:
abort();
break;
diff --git a/monitor.h b/monitor.h
index 4d57679..42386de 100644
--- a/monitor.h
+++ b/monitor.h
@@ -21,6 +21,7 @@ typedef enum MonitorEvent {
QEVENT_POWERDOWN,
QEVENT_STOP,
QEVENT_VNC_CONNECTED,
+ QEVENT_VNC_DISCONNECTED,
QEVENT_MAX,
} MonitorEvent;
diff --git a/vnc.c b/vnc.c
index 6d488e5..a590bb9 100644
--- a/vnc.c
+++ b/vnc.c
@@ -1108,6 +1108,8 @@ static void vnc_disconnect_start(VncState *vs)
static void vnc_disconnect_finish(VncState *vs)
{
+ vnc_qmp_event(vs, QEVENT_VNC_DISCONNECTED);
+
if (vs->input.buffer) {
qemu_free(vs->input.buffer);
vs->input.buffer = NULL;
--
1.6.6
- [Qemu-devel] [PATCH 1/8] VNC: Use 'enabled' key instead of 'status', (continued)
- [Qemu-devel] [PATCH 1/8] VNC: Use 'enabled' key instead of 'status', Luiz Capitulino, 2010/01/14
- [Qemu-devel] [PATCH 2/8] VNC: Make 'auth' key mandatory, Luiz Capitulino, 2010/01/14
- [Qemu-devel] [PATCH 3/8] VNC: Rename client's 'username' key, Luiz Capitulino, 2010/01/14
- [Qemu-devel] [PATCH 4/8] VNC: Add 'family' key, Luiz Capitulino, 2010/01/14
- [Qemu-devel] [PATCH 5/8] VNC: Cache client info at connection time, Luiz Capitulino, 2010/01/14
- [Qemu-devel] [PATCH 6/8] QMP: Introduce VNC_CONNECTED event, Luiz Capitulino, 2010/01/14
- [Qemu-devel] [PATCH 8/8] QMP: Introduce VNC_INITIALIZED event, Luiz Capitulino, 2010/01/14
- [Qemu-devel] [PATCH 7/8] QMP: Introduce VNC_DISCONNECTED event,
Luiz Capitulino <=
- [Qemu-devel] Re: [PATCH v0 0/8]: VNC events and cleanup, Daniel P. Berrange, 2010/01/14