mirror of https://github.com/xqemu/xqemu.git
QMP: Introduce VNC_DISCONNECTED event
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 <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
586153d952
commit
0d72f3d31b
|
@ -31,3 +31,9 @@ Data: None.
|
||||||
Description: Issued when a VNC client establishes a connection.
|
Description: Issued when a VNC client establishes a connection.
|
||||||
Data: 'server' and 'client' keys with the same keys as 'query-vnc',
|
Data: 'server' and 'client' keys with the same keys as 'query-vnc',
|
||||||
except that authentication ID is not provided.
|
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'.
|
||||||
|
|
|
@ -360,6 +360,9 @@ void monitor_protocol_event(MonitorEvent event, QObject *data)
|
||||||
case QEVENT_VNC_CONNECTED:
|
case QEVENT_VNC_CONNECTED:
|
||||||
event_name = "VNC_CONNECTED";
|
event_name = "VNC_CONNECTED";
|
||||||
break;
|
break;
|
||||||
|
case QEVENT_VNC_DISCONNECTED:
|
||||||
|
event_name = "VNC_DISCONNECTED";
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
abort();
|
abort();
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -21,6 +21,7 @@ typedef enum MonitorEvent {
|
||||||
QEVENT_POWERDOWN,
|
QEVENT_POWERDOWN,
|
||||||
QEVENT_STOP,
|
QEVENT_STOP,
|
||||||
QEVENT_VNC_CONNECTED,
|
QEVENT_VNC_CONNECTED,
|
||||||
|
QEVENT_VNC_DISCONNECTED,
|
||||||
QEVENT_MAX,
|
QEVENT_MAX,
|
||||||
} MonitorEvent;
|
} MonitorEvent;
|
||||||
|
|
||||||
|
|
2
vnc.c
2
vnc.c
|
@ -1108,6 +1108,8 @@ static void vnc_disconnect_start(VncState *vs)
|
||||||
|
|
||||||
static void vnc_disconnect_finish(VncState *vs)
|
static void vnc_disconnect_finish(VncState *vs)
|
||||||
{
|
{
|
||||||
|
vnc_qmp_event(vs, QEVENT_VNC_DISCONNECTED);
|
||||||
|
|
||||||
if (vs->input.buffer) {
|
if (vs->input.buffer) {
|
||||||
qemu_free(vs->input.buffer);
|
qemu_free(vs->input.buffer);
|
||||||
vs->input.buffer = NULL;
|
vs->input.buffer = NULL;
|
||||||
|
|
Loading…
Reference in New Issue