From patchwork Mon Mar 5 15:56:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alon Levy X-Patchwork-Id: 144706 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A6D1AB6FA3 for ; Tue, 6 Mar 2012 02:58:19 +1100 (EST) Received: from localhost ([::1]:50918 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S4aIe-0008HS-9a for incoming@patchwork.ozlabs.org; Mon, 05 Mar 2012 10:58:12 -0500 Received: from eggs.gnu.org ([208.118.235.92]:60860) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S4aHx-00070L-Se for qemu-devel@nongnu.org; Mon, 05 Mar 2012 10:58:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S4aHG-0001iO-I3 for qemu-devel@nongnu.org; Mon, 05 Mar 2012 10:57:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34226) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S4aHG-0001fX-A2 for qemu-devel@nongnu.org; Mon, 05 Mar 2012 10:56:46 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q25FuXIh029766 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 5 Mar 2012 10:56:33 -0500 Received: from garlic.tlv.redhat.com (spice-ovirt.tlv.redhat.com [10.35.4.71]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q25FuTKO029598; Mon, 5 Mar 2012 10:56:32 -0500 From: Alon Levy To: qemu-devel@nongnu.org, anthony@codemonkey.ws, kraxel@redhat.com, lcapitulino@redhat.com Date: Mon, 5 Mar 2012 17:56:27 +0200 Message-Id: <1330962989-20077-2-git-send-email-alevy@redhat.com> In-Reply-To: <1330962989-20077-1-git-send-email-alevy@redhat.com> References: <4F54CEA2.10808@codemonkey.ws> <1330962989-20077-1-git-send-email-alevy@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 1/3] monitor, console: add QEVENT_SCREEN_DUMP_COMPLETE X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Alon Levy --- QMP/qmp-events.txt | 15 +++++++++++++++ console.c | 11 +++++++++++ console.h | 1 + monitor.c | 2 ++ monitor.h | 1 + 5 files changed, 30 insertions(+), 0 deletions(-) diff --git a/QMP/qmp-events.txt b/QMP/qmp-events.txt index 9286af5..49c8d77 100644 --- a/QMP/qmp-events.txt +++ b/QMP/qmp-events.txt @@ -335,3 +335,18 @@ Example: "len": 10737418240, "offset": 134217728, "speed": 0 }, "timestamp": { "seconds": 1267061043, "microseconds": 959568 } } + +SCREEN_DUMP_COMPLETE +-------------------- + +Emitted when screen-dump-async completes. + +Data: + +- "filename": Name of file containing screen dump (json-string) + +Example: + +{ "event": "SCREEN_DUMP_COMPLETE", + "data": { "filename": "/tmp/a.ppm" }, + "timestamp": { "seconds": 1267061043, "microseconds": 959568 } } diff --git a/console.c b/console.c index 6a463f5..beebced 100644 --- a/console.c +++ b/console.c @@ -24,6 +24,8 @@ #include "qemu-common.h" #include "console.h" #include "qemu-timer.h" +#include "qjson.h" +#include "monitor.h" //#define DEBUG_CONSOLE #define DEFAULT_BACKSCROLL 512 @@ -1707,3 +1709,12 @@ PixelFormat qemu_default_pixelformat(int bpp) } return pf; } + +void monitor_protocol_screen_dump_complete_event(const char *filename) +{ + QObject *event_data; + + event_data = qobject_from_jsonf("{ 'filename': %s }", filename); + monitor_protocol_event(QEVENT_SCREEN_DUMP_COMPLETE, event_data); + qobject_decref(event_data); +} diff --git a/console.h b/console.h index a95b581..c22803c 100644 --- a/console.h +++ b/console.h @@ -353,6 +353,7 @@ void vga_hw_update(void); void vga_hw_invalidate(void); void vga_hw_screen_dump(const char *filename); void vga_hw_text_update(console_ch_t *chardata); +void monitor_protocol_screen_dump_complete_event(const char *filename); int is_graphic_console(void); int is_fixedsize_console(void); diff --git a/monitor.c b/monitor.c index cbdfbad..a8c84c0 100644 --- a/monitor.c +++ b/monitor.c @@ -493,6 +493,8 @@ void monitor_protocol_event(MonitorEvent event, QObject *data) break; case QEVENT_WAKEUP: event_name = "WAKEUP"; + case QEVENT_SCREEN_DUMP_COMPLETE: + event_name = "SCREEN_DUMP_COMPLETE"; break; default: abort(); diff --git a/monitor.h b/monitor.h index 0d49800..227ebf2 100644 --- a/monitor.h +++ b/monitor.h @@ -41,6 +41,7 @@ typedef enum MonitorEvent { QEVENT_DEVICE_TRAY_MOVED, QEVENT_SUSPEND, QEVENT_WAKEUP, + QEVENT_SCREEN_DUMP_COMPLETE, QEVENT_MAX, } MonitorEvent;