From patchwork Thu Aug 9 17:28:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 176198 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 397192C00F1 for ; Fri, 10 Aug 2012 03:28:23 +1000 (EST) Received: from localhost ([::1]:50285 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzWWz-0006hG-8I for incoming@patchwork.ozlabs.org; Thu, 09 Aug 2012 13:28:21 -0400 Received: from eggs.gnu.org ([208.118.235.92]:37224) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzWWb-0006JA-4o for qemu-devel@nongnu.org; Thu, 09 Aug 2012 13:28:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SzWWY-0005ca-P6 for qemu-devel@nongnu.org; Thu, 09 Aug 2012 13:27:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55892) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzWWY-0005cV-GN for qemu-devel@nongnu.org; Thu, 09 Aug 2012 13:27:54 -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.14.4/8.14.4) with ESMTP id q79HRrwX007419 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 9 Aug 2012 13:27:54 -0400 Received: from localhost (ovpn-113-85.phx2.redhat.com [10.3.113.85]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q79HRqp2003366; Thu, 9 Aug 2012 13:27:53 -0400 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Thu, 9 Aug 2012 14:28:18 -0300 Message-Id: <1344533300-6422-3-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1344533300-6422-1-git-send-email-lcapitulino@redhat.com> References: <1344533300-6422-1-git-send-email-lcapitulino@redhat.com> 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. X-Received-From: 209.132.183.28 Cc: kraxel@redhat.com Subject: [Qemu-devel] [PATCH 2/4] 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 --- 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..b8afedb 100644 --- a/QMP/qmp-events.txt +++ b/QMP/qmp-events.txt @@ -264,6 +264,19 @@ Example: }} +WAKEUP +------ + +Emitted when the guest has been waken 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 b642637..9d783b7 100644 --- a/vl.c +++ b/vl.c @@ -1460,7 +1460,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(); @@ -1547,6 +1546,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);