From patchwork Tue May 25 14:21:03 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 53552 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 83FC1B7D18 for ; Wed, 26 May 2010 00:31:07 +1000 (EST) Received: from localhost ([127.0.0.1]:34620 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OGv9s-0005Rj-6i for incoming@patchwork.ozlabs.org; Tue, 25 May 2010 10:31:04 -0400 Received: from [140.186.70.92] (port=38649 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OGv0O-0002tn-Ns for qemu-devel@nongnu.org; Tue, 25 May 2010 10:21:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OGv0N-0002LM-5u for qemu-devel@nongnu.org; Tue, 25 May 2010 10:21:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33693) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OGv0M-0002LD-VE for qemu-devel@nongnu.org; Tue, 25 May 2010 10:21:15 -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.13.8/8.13.8) with ESMTP id o4PELE67011872 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 25 May 2010 10:21:14 -0400 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o4PEL6Ca020067; Tue, 25 May 2010 10:21:12 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Tue, 25 May 2010 16:21:03 +0200 Message-Id: <9b6575587d22a5c85ec536172810520ee3b945d5.1274796992.git.quintela@redhat.com> In-Reply-To: References: In-Reply-To: References: 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. 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..93caa4d 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_FAILED (no way to differentiate a FAILED +and CANCELED migration for target). + +Data: None + +Example: + +{ "event": "MIGRATION_CANCELED", + "timestamp": {"seconds": 1274687575, "microseconds": 592483} } + +MIGRATION_ENDED +--------------- + +Emitted when migration ends (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 ad50f12..5158780 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;