From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=45938 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OGvlY-00086V-Pv for qemu-devel@nongnu.org; Tue, 25 May 2010 11:10:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OGvlX-0006Aa-DK for qemu-devel@nongnu.org; Tue, 25 May 2010 11:10:00 -0400 Received: from mail-gy0-f173.google.com ([209.85.160.173]:36113) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OGvlX-0006AN-AS for qemu-devel@nongnu.org; Tue, 25 May 2010 11:09:59 -0400 Received: by gyd5 with SMTP id 5so2114922gyd.4 for ; Tue, 25 May 2010 08:09:58 -0700 (PDT) Message-ID: <4BFBE843.5070202@codemonkey.ws> Date: Tue, 25 May 2010 10:09:55 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 3/5] QMP: Introduce MIGRATION events References: <9b6575587d22a5c85ec536172810520ee3b945d5.1274796992.git.quintela@redhat.com> In-Reply-To: <9b6575587d22a5c85ec536172810520ee3b945d5.1274796992.git.quintela@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: qemu-devel@nongnu.org On 05/25/2010 09:21 AM, Juan Quintela wrote: > 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). > But the management tool is the one that cancels so surely, it knows why already. > +Data: None > + > +Example: > + > +{ "event": "MIGRATION_CANCELED", > + "timestamp": {"seconds": 1274687575, "microseconds": 592483} } > + > +MIGRATION_ENDED > +--------------- > + > +Emitted when migration ends (both in source and target) > A start event is going to be generated already, no? > +Data: None > + > +Example: > + > +{ "event": "MIGRATION_ENDED", > + "timestamp": {"seconds": 1274687575, "microseconds": 592483} } > + > +MIGRATION_FAILED > +---------------- > + > +Emitted when migration fails (both is source and target). > + > +Data: None > There should be some information about why it failed, no? Preferrably in a QError format. > +Example: > + > +{ "event": "MIGRATION_FAILED", > + "timestamp": {"seconds": 1274687575, "microseconds": 592483} } > + > +MIGRATION_STARTED > +----------------- > + > +Emitted when migration starts (both in source and target). > I think this makes more sense as a MIGRATION_CONNECTED event. It probably should carry peer information too. Regards, Anthony Liguori > +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; > >