From patchwork Mon Aug 13 19:48:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 177128 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 9FACD2C0089 for ; Tue, 14 Aug 2012 07:17:17 +1000 (EST) Received: from localhost ([::1]:35196 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T10eu-00039J-G9 for incoming@patchwork.ozlabs.org; Mon, 13 Aug 2012 15:50:40 -0400 Received: from eggs.gnu.org ([208.118.235.92]:38620) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T10dr-0001qx-Jl for qemu-devel@nongnu.org; Mon, 13 Aug 2012 15:49:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T10dp-0003wc-BR for qemu-devel@nongnu.org; Mon, 13 Aug 2012 15:49:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42925) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T10dp-0003wY-2c for qemu-devel@nongnu.org; Mon, 13 Aug 2012 15:49:33 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q7DJnW6C002977 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 13 Aug 2012 15:49:32 -0400 Received: from localhost (ovpn-113-98.phx2.redhat.com [10.3.113.98]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q7DJnV1T012537; Mon, 13 Aug 2012 15:49:32 -0400 From: Luiz Capitulino To: aliguori@us.ibm.com Date: Mon, 13 Aug 2012 16:48:59 -0300 Message-Id: <1344887349-13041-39-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1344887349-13041-1-git-send-email-lcapitulino@redhat.com> References: <1344887349-13041-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 38/48] qmp: emit the WAKEUP event when the guest is put to run 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 Today, the WAKEUP event is emitted when a wakeup _request_ is made. This could be the system_wakeup command, for example. A better semantic would be to emit the event when the guest is already running, as that's what matters in the end. This commit does that change. In theory, this could break compatibility. In practice, it shouldn't happen though, as clients shouldn't rely on timing characteristics of the events. That is, a client relying that the guest is not running when the event arrives may break if the event arrives after the guest is already running. This commit also adds the missing documentation for the WAKEUP event. Signed-off-by: Luiz Capitulino Acked-by: Gerd Hoffmann --- QMP/qmp-events.txt | 13 +++++++++++++ vl.c | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/QMP/qmp-events.txt b/QMP/qmp-events.txt index 9ba7079..10f69d1 100644 --- a/QMP/qmp-events.txt +++ b/QMP/qmp-events.txt @@ -264,6 +264,19 @@ Example: }} +WAKEUP +------ + +Emitted when the guest has woken up from S3 and is running. + +Data: None. + +Example: + +{ "event": "WATCHDOG", + "timestamp": { "seconds": 1344522075, "microseconds": 745528 } } + + WATCHDOG -------- diff --git a/vl.c b/vl.c index 68fa0a0..97ab39f 100644 --- a/vl.c +++ b/vl.c @@ -1465,7 +1465,6 @@ void qemu_system_wakeup_request(WakeupReason reason) return; } runstate_set(RUN_STATE_RUNNING); - monitor_protocol_event(QEVENT_WAKEUP, NULL); notifier_list_notify(&wakeup_notifiers, &reason); wakeup_requested = 1; qemu_notify_event(); @@ -1552,6 +1551,7 @@ static bool main_loop_should_exit(void) cpu_synchronize_all_states(); qemu_system_reset(VMRESET_SILENT); resume_all_vcpus(); + monitor_protocol_event(QEVENT_WAKEUP, NULL); } if (qemu_powerdown_requested()) { monitor_protocol_event(QEVENT_POWERDOWN, NULL);