Received: from eggs.gnu.org ([2001:4830:134:3::10]:60479) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQAvx-0003PO-E3 for qemu-devel@nongnu.org; Thu, 21 Jul 2016 06:10:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQAvr-0006Oc-JT for qemu-devel@nongnu.org; Thu, 21 Jul 2016 06:10:25 -0400 Received: from 4.mo178.mail-out.ovh.net ([46.105.49.171]:53212) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQAvr-0006OE-Cn for qemu-devel@nongnu.org; Thu, 21 Jul 2016 06:10:19 -0400 Received: from player169.ha.ovh.net (b9.ovh.net [213.186.33.59]) by mo178.mail-out.ovh.net (Postfix) with ESMTP id 0C88710048E6 for ; Thu, 21 Jul 2016 12:10:18 +0200 (CEST) Date: Thu, 21 Jul 2016 12:10:11 +0200 From: Greg Kurz Message-ID: <20160721121011.4f635b8f@bahia.lan> In-Reply-To: <1469092894-12801-1-git-send-email-thuth@redhat.com> References: <1469092894-12801-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH] hw/ppc/spapr: Make sure to close the htab_fd when migration is canceled List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Huth Cc: David Gibson , qemu-ppc@nongnu.org, qemu-devel@nongnu.org On Thu, 21 Jul 2016 11:21:34 +0200 Thomas Huth wrote: > When canceling a migration process, we currently do not close the > HTAB migration file descriptor since htab_save_complete() is never > called in that case. So we leave the migration process with a > dangling htab_fd value around, and this causes any further migration > attempts to fail. To fix this issue, simply make sure that the > htab_fd is closed during the migration cleanup stage. And since the > cleanup() function is also called when migration succeeds, we can > also remove the call to close_htab_fd() from the htab_save_complete() > function. > > Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1354341 > Signed-off-by: Thomas Huth > --- Reviewed-by: Greg Kurz > hw/ppc/spapr.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > index 7f33a1b..9193ac2 100644 > --- a/hw/ppc/spapr.c > +++ b/hw/ppc/spapr.c > @@ -1512,7 +1512,6 @@ static int htab_save_complete(QEMUFile *f, void *opaque) > if (rc < 0) { > return rc; > } > - close_htab_fd(spapr); > } else { > if (spapr->htab_first_pass) { > htab_save_first_pass(f, spapr, -1); > @@ -1614,10 +1613,18 @@ static int htab_load(QEMUFile *f, void *opaque, int version_id) > return 0; > } > > +static void htab_cleanup(void *opaque) > +{ > + sPAPRMachineState *spapr = opaque; > + > + close_htab_fd(spapr); > +} > + > static SaveVMHandlers savevm_htab_handlers = { > .save_live_setup = htab_save_setup, > .save_live_iterate = htab_save_iterate, > .save_live_complete_precopy = htab_save_complete, > + .cleanup = htab_cleanup, > .load_state = htab_load, > }; >