From patchwork Thu Jan 14 16:50:59 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 42916 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 7176EB7CD5 for ; Fri, 15 Jan 2010 04:12:40 +1100 (EST) Received: from localhost ([127.0.0.1]:38570 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NVTF3-00071i-LQ for incoming@patchwork.ozlabs.org; Thu, 14 Jan 2010 12:12:17 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NVSvl-0007OA-9Y for qemu-devel@nongnu.org; Thu, 14 Jan 2010 11:52:21 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NVSve-0007IS-Fe for qemu-devel@nongnu.org; Thu, 14 Jan 2010 11:52:18 -0500 Received: from [199.232.76.173] (port=44460 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NVSvd-0007Hi-84 for qemu-devel@nongnu.org; Thu, 14 Jan 2010 11:52:13 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34256) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NVSvc-0002Fb-LH for qemu-devel@nongnu.org; Thu, 14 Jan 2010 11:52:13 -0500 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o0EGqB4Q002920 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 14 Jan 2010 11:52:11 -0500 Received: from localhost (vpn-10-170.rdu.redhat.com [10.11.10.170]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o0EGqAf0004263; Thu, 14 Jan 2010 11:52:10 -0500 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Thu, 14 Jan 2010 14:50:59 -0200 Message-Id: <1263487859-6318-9-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1263487859-6318-1-git-send-email-lcapitulino@redhat.com> References: <1263487859-6318-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: armbru@redhat.com Subject: [Qemu-devel] [PATCH 8/8] QMP: Introduce VNC_INITIALIZED event X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- 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 5ac1c5c..f2abd3c 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 a590bb9..c7d6652 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);