From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:50261) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBQWh-0002wA-Fy for qemu-devel@nongnu.org; Wed, 05 Oct 2011 08:24:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RBQWg-0007c1-E7 for qemu-devel@nongnu.org; Wed, 05 Oct 2011 08:24:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:26490) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBQWg-0007bs-3h for qemu-devel@nongnu.org; Wed, 05 Oct 2011 08:24:42 -0400 From: Juan Quintela In-Reply-To: <4E8B18AE.8050804@codemonkey.ws> (Anthony Liguori's message of "Tue, 04 Oct 2011 09:31:10 -0500") References: <808d7f54a5742f34d467a6293f6fff8fefbc6d15.1316782367.git.quintela@redhat.com> <4E8B18AE.8050804@codemonkey.ws> Date: Wed, 05 Oct 2011 14:24:30 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH 19/23] migration: Export a function that tells if the migration has finished correctly Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org Anthony Liguori wrote: > On 09/23/2011 07:57 AM, Juan Quintela wrote: >> This will allows us to hide the status values. >> >> --- a/ui/spice-core.c >> +++ b/ui/spice-core.c >> @@ -447,9 +447,7 @@ void do_info_spice(Monitor *mon, QObject **ret_data) >> >> static void migration_state_notifier(Notifier *notifier, void *data) >> { >> - int state = get_migration_state(); >> - >> - if (state == MIG_STATE_COMPLETED) { >> + if (migration_has_finished()) { >> #if SPICE_SERVER_VERSION>= 0x000701 /* 0.7.1 */ >> spice_server_migrate_switch(spice_server); >> #endif > > I think the bug here is migration_state_notifier. It should take an > additional argument of MigrationState. Otherwise, how does this code > work with FT? Thinking about it, we need to pass MigrationState and export the function that see if migration has finished (otherwise we also need to export all STATE definitions, or worse, the whole MigrationState definition. Moving to have a function bool migration_has_finished(MIgrationState *s); That does the obvious thing. What do you think? Later, Juan.