From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:43624) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBSw3-00046L-VT for qemu-devel@nongnu.org; Wed, 05 Oct 2011 10:59:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RBSvz-0003X1-NJ for qemu-devel@nongnu.org; Wed, 05 Oct 2011 10:59:03 -0400 Received: from mail-gy0-f173.google.com ([209.85.160.173]:49046) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBSvz-0003Wv-J4 for qemu-devel@nongnu.org; Wed, 05 Oct 2011 10:58:59 -0400 Received: by gye5 with SMTP id 5so1991386gye.4 for ; Wed, 05 Oct 2011 07:58:58 -0700 (PDT) Message-ID: <4E8C70AE.9030004@codemonkey.ws> Date: Wed, 05 Oct 2011 09:58:54 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <808d7f54a5742f34d467a6293f6fff8fefbc6d15.1316782367.git.quintela@redhat.com> <4E8B18AE.8050804@codemonkey.ws> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 19/23] migration: Export a function that tells if the migration has finished correctly List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: quintela@redhat.com Cc: qemu-devel@nongnu.org On 10/05/2011 07:24 AM, Juan Quintela wrote: > 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? Yeah, that was what I was advocating. Regards, Anthony Liguori > > Later, Juan.