From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49622) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCx8e-00027T-B9 for qemu-devel@nongnu.org; Mon, 10 Feb 2014 15:07:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WCx8Z-0007q9-At for qemu-devel@nongnu.org; Mon, 10 Feb 2014 15:07:32 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42547) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCx8Z-0007pV-3G for qemu-devel@nongnu.org; Mon, 10 Feb 2014 15:07:27 -0500 Date: Mon, 10 Feb 2014 15:07:12 -0500 From: Luiz Capitulino Message-ID: <20140210150712.144ae7df@redhat.com> In-Reply-To: <20140127194611.679775b92d4be424325b6ecf@nii.ac.jp> References: <20140127194611.679775b92d4be424325b6ecf@nii.ac.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] Human Monitor: migrate command (without -d) now blocks correctly List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Soramichi AKIYAMA Cc: qemu-devel@nongnu.org On Mon, 27 Jan 2014 19:46:11 +0900 Soramichi AKIYAMA wrote: > This patch fixes a timing issue that migrate command (without -d) does not block in some cases. > The original version of hmp.c:hmp_migrate_status_cb checks if the migration status is 'active' or not to detect the complition of a migration. > However, if this function is executed when the migration status is still 'setup' (the status before 'active'), > migration command returns immediately even if the user does not specify -d option. > > Signed-off-by: Soramichi Akiyama > --- > hmp.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hmp.c b/hmp.c > index 1af0809..eb887bf 100644 > --- a/hmp.c > +++ b/hmp.c > @@ -1234,7 +1234,7 @@ static void hmp_migrate_status_cb(void *opaque) > MigrationInfo *info; > > info = qmp_query_migrate(NULL); > - if (!info->has_status || strcmp(info->status, "active") == 0) { > + if (!info->has_status || strcmp(info->status, "active") == 0 || strcmp(info->status, "setup") == 0 ) { > if (info->has_disk) { > int progress; > Good catch, applied to the qmp branch, thanks.