From patchwork Tue Apr 27 23:35: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: 51130 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 4A1F8B7D30 for ; Wed, 28 Apr 2010 10:07:48 +1000 (EST) Received: from localhost ([127.0.0.1]:36098 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O6uoa-00068W-OS for incoming@patchwork.ozlabs.org; Tue, 27 Apr 2010 20:07:44 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O6unv-00068Q-Av for qemu-devel@nongnu.org; Tue, 27 Apr 2010 20:07:03 -0400 Received: from [140.186.70.92] (port=51173 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O6uns-00068H-TD for qemu-devel@nongnu.org; Tue, 27 Apr 2010 20:07:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O6unq-0005Xu-RS for qemu-devel@nongnu.org; Tue, 27 Apr 2010 20:07:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10582) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O6unq-0005Xm-Ee for qemu-devel@nongnu.org; Tue, 27 Apr 2010 20:06:58 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o3RNaAmR002724 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 27 Apr 2010 19:36:11 -0400 Received: from localhost (vpn-11-191.rdu.redhat.com [10.11.11.191]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o3RNa2mS028280 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Tue, 27 Apr 2010 19:36:05 -0400 Date: Tue, 27 Apr 2010 20:35:59 -0300 From: Luiz Capitulino To: qemu-devel@nongnu.org Message-ID: <20100427203559.3db863e1@redhat.com> Organization: Red Hat Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH] QMP: Introduce RESUME 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 the Virtual Machine resumes execution. We currently have the STOP event but don't have the matching RESUME one, this means that clients are notified when the VM is stopped but don't get anything when it resumes. Let's fix that as it's already causing some trouble to libvirt. Signed-off-by: Luiz Capitulino --- QMP/qmp-events.txt | 12 ++++++++++++ monitor.c | 3 +++ monitor.h | 1 + vl.c | 1 + 4 files changed, 17 insertions(+), 0 deletions(-) diff --git a/QMP/qmp-events.txt b/QMP/qmp-events.txt index c084a47..01ec85f 100644 --- a/QMP/qmp-events.txt +++ b/QMP/qmp-events.txt @@ -38,6 +38,18 @@ Example: { "event": "RESET", "timestamp": { "seconds": 1267041653, "microseconds": 9518 } } +RESUME +------ + +Emitted when the Virtual Machine resumes execution. + +Data: None. + +Example: + +{ "event": "RESUME", + "timestamp": { "seconds": 1271770767, "microseconds": 582542 } } + RTC_CHANGE ---------- diff --git a/monitor.c b/monitor.c index 754bcc5..bb87479 100644 --- a/monitor.c +++ b/monitor.c @@ -423,6 +423,9 @@ void monitor_protocol_event(MonitorEvent event, QObject *data) case QEVENT_STOP: event_name = "STOP"; break; + case QEVENT_RESUME: + event_name = "RESUME"; + break; case QEVENT_VNC_CONNECTED: event_name = "VNC_CONNECTED"; break; diff --git a/monitor.h b/monitor.h index 5bdeed1..ea15469 100644 --- a/monitor.h +++ b/monitor.h @@ -21,6 +21,7 @@ typedef enum MonitorEvent { QEVENT_RESET, QEVENT_POWERDOWN, QEVENT_STOP, + QEVENT_RESUME, QEVENT_VNC_CONNECTED, QEVENT_VNC_INITIALIZED, QEVENT_VNC_DISCONNECTED, diff --git a/vl.c b/vl.c index a485c58..6dfbf07 100644 --- a/vl.c +++ b/vl.c @@ -1679,6 +1679,7 @@ void vm_start(void) vm_running = 1; vm_state_notify(1, 0); resume_all_vcpus(); + monitor_protocol_event(QEVENT_RESUME, NULL); } }