From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:52496) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROx3F-0006AD-SJ for qemu-devel@nongnu.org; Fri, 11 Nov 2011 14:46:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ROx35-0002BK-Ob for qemu-devel@nongnu.org; Fri, 11 Nov 2011 14:46:08 -0500 Received: from e5.ny.us.ibm.com ([32.97.182.145]:34389) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROx35-00028R-Lk for qemu-devel@nongnu.org; Fri, 11 Nov 2011 14:46:03 -0500 Received: from /spool/local by e5.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 11 Nov 2011 14:45:34 -0500 Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pABJjUXi306334 for ; Fri, 11 Nov 2011 14:45:31 -0500 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pABJjTvZ001832 for ; Fri, 11 Nov 2011 12:45:30 -0700 Message-ID: <4EBD7B57.5060207@us.ibm.com> Date: Fri, 11 Nov 2011 13:45:27 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <1320870541-4571-1-git-send-email-quintela@redhat.com> In-Reply-To: <1320870541-4571-1-git-send-email-quintela@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] migration: fix detached migration with fd List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: qemu-devel@nongnu.org On 11/09/2011 02:29 PM, Juan Quintela wrote: > Migration with fd uses s->mon to pass the fd. But we only assign the > s->mon for !detached migration. Fix it. Once there add a comment > indicating that s->mon has two uses. > > Bug reported by: Wen Congyang > > Signed-off-by: Juan Quintela > CC: Wen Congyang Applied. Thanks. Regards, Anthony Liguori > --- > migration.c | 12 ++++++++++-- > 1 files changed, 10 insertions(+), 2 deletions(-) > > diff --git a/migration.c b/migration.c > index 4b17566..41c3c24 100644 > --- a/migration.c > +++ b/migration.c > @@ -155,7 +155,6 @@ MigrationInfo *qmp_query_migrate(Error **errp) > > static void migrate_fd_monitor_suspend(MigrationState *s, Monitor *mon) > { > - s->mon = mon; > if (monitor_suspend(mon) == 0) { > DPRINTF("suspending monitor\n"); > } else { > @@ -383,7 +382,12 @@ static MigrationState *migrate_init(Monitor *mon, int detach, int blk, int inc) > s->bandwidth_limit = bandwidth_limit; > s->blk = blk; > s->shared = inc; > - s->mon = NULL; > + > + /* s->mon is used for two things: > + - pass fd in fd migration > + - suspend/resume monitor for not detached migration > + */ > + s->mon = mon; > s->bandwidth_limit = bandwidth_limit; > s->state = MIG_STATE_SETUP; > > @@ -435,6 +439,10 @@ int do_migrate(Monitor *mon, const QDict *qdict, QObject **ret_data) > return ret; > } > > + if (detach) { > + s->mon = NULL; > + } > + > notifier_list_notify(&migration_state_notifiers, s); > return 0; > }