From patchwork Mon May 24 08:25:27 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 53404 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 95724B7D4E for ; Mon, 24 May 2010 18:34:48 +1000 (EST) Received: from localhost ([127.0.0.1]:44917 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OGT7U-0007ey-3f for incoming@patchwork.ozlabs.org; Mon, 24 May 2010 04:34:44 -0400 Received: from [140.186.70.92] (port=57731 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OGSyi-0003YP-NZ for qemu-devel@nongnu.org; Mon, 24 May 2010 04:25:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OGSyg-0004SS-D9 for qemu-devel@nongnu.org; Mon, 24 May 2010 04:25:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52776) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OGSyg-0004SJ-2m for qemu-devel@nongnu.org; Mon, 24 May 2010 04:25:38 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o4O8PbW0019210 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 24 May 2010 04:25:37 -0400 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o4O8PTZ3015804; Mon, 24 May 2010 04:25:35 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Mon, 24 May 2010 10:25:27 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH 3/5] QMP: Introduce MIGRATION events 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 They are emitted when migration starts, ends, has a failure or is canceled. Signed-off-by: Juan Quintela --- QMP/qmp-events.txt | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ monitor.c | 12 ++++++++++++ monitor.h | 4 ++++ 3 files changed, 66 insertions(+), 0 deletions(-) diff --git a/QMP/qmp-events.txt b/QMP/qmp-events.txt index 01ec85f..234360f 100644 --- a/QMP/qmp-events.txt +++ b/QMP/qmp-events.txt @@ -26,6 +26,56 @@ Example: Note: If action is "stop", a STOP event will eventually follow the BLOCK_IO_ERROR event. +MIGRATION_CANCELED +------------------ + +Emitted when migration is canceled. This is emitted in the source. +Target will emit MIGRATION_CANCELED (no way to differentiate a FAILED +and CANCELED migration). + +Data: None + +Example: + +{ "event": "MIGRATION_CANCELED", + "timestamp": {"seconds": 1274687575, "microseconds": 592483} } + +MIGRATION_ENDED +--------------- + +Emitted when migration starts (both in source and target) + +Data: None + +Example: + +{ "event": "MIGRATION_ENDED", + "timestamp": {"seconds": 1274687575, "microseconds": 592483} } + +MIGRATION_FAILED +---------------- + +Emitted when migration fails (both is source and target). + +Data: None + +Example: + +{ "event": "MIGRATION_FAILED", + "timestamp": {"seconds": 1274687575, "microseconds": 592483} } + +MIGRATION_STARTED +----------------- + +Emitted when migration starts (both in source and target). + +Data: None + +Example: + +{ "event": "MIGRATION_STARTED", + "timestamp": {"seconds": 1274687575, "microseconds": 592483} } + RESET ----- diff --git a/monitor.c b/monitor.c index a1ebc5d..723ca73 100644 --- a/monitor.c +++ b/monitor.c @@ -444,6 +444,18 @@ void monitor_protocol_event(MonitorEvent event, QObject *data) case QEVENT_WATCHDOG: event_name = "WATCHDOG"; break; + case QEVENT_MIGRATION_STARTED: + event_name = "MIGRATION_STARTED"; + break; + case QEVENT_MIGRATION_ENDED: + event_name = "MIGRATION_ENDED"; + break; + case QEVENT_MIGRATION_FAILED: + event_name = "MIGRATION_FAILED"; + break; + case QEVENT_MIGRATION_CANCELED: + event_name = "MIGRATION_CANCELED"; + break; default: abort(); break; diff --git a/monitor.h b/monitor.h index ea15469..34bcd38 100644 --- a/monitor.h +++ b/monitor.h @@ -28,6 +28,10 @@ typedef enum MonitorEvent { QEVENT_BLOCK_IO_ERROR, QEVENT_RTC_CHANGE, QEVENT_WATCHDOG, + QEVENT_MIGRATION_STARTED, + QEVENT_MIGRATION_ENDED, + QEVENT_MIGRATION_FAILED, + QEVENT_MIGRATION_CANCELED, QEVENT_MAX, } MonitorEvent;