From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQDaw-00087I-Ra for qemu-devel@nongnu.org; Thu, 21 Jul 2016 09:00:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQDat-0001Yt-N4 for qemu-devel@nongnu.org; Thu, 21 Jul 2016 09:00:53 -0400 Date: Thu, 21 Jul 2016 22:51:38 +1000 From: David Gibson Message-ID: <20160721125138.GD31439@voom.fritz.box> References: <1469092894-12801-1-git-send-email-thuth@redhat.com> <20160721121011.4f635b8f@bahia.lan> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IDYEmSnFhs3mNXr+" Content-Disposition: inline In-Reply-To: <20160721121011.4f635b8f@bahia.lan> 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: Greg Kurz Cc: Thomas Huth , qemu-ppc@nongnu.org, qemu-devel@nongnu.org --IDYEmSnFhs3mNXr+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 21, 2016 at 12:10:11PM +0200, Greg Kurz wrote: > On Thu, 21 Jul 2016 11:21:34 +0200 > Thomas Huth wrote: >=20 > > 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. > >=20 > > Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=3D1354341 > > Signed-off-by: Thomas Huth > > --- >=20 > Reviewed-by: Greg Kurz Applied to ppc-for-2.7 >=20 > > hw/ppc/spapr.c | 9 ++++++++- > > 1 file changed, 8 insertions(+), 1 deletion(-) > >=20 > > 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; > > } > > =20 > > +static void htab_cleanup(void *opaque) > > +{ > > + sPAPRMachineState *spapr =3D opaque; > > + > > + close_htab_fd(spapr); > > +} > > + > > static SaveVMHandlers savevm_htab_handlers =3D { > > .save_live_setup =3D htab_save_setup, > > .save_live_iterate =3D htab_save_iterate, > > .save_live_complete_precopy =3D htab_save_complete, > > + .cleanup =3D htab_cleanup, > > .load_state =3D htab_load, > > }; > > =20 >=20 --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --IDYEmSnFhs3mNXr+ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXkMVaAAoJEGw4ysog2bOSs28P/REDp6n9S5c7HQdrJ4XHjXam mLRHc/WENRWCdRG+a/1FPIigaBIxM8Q+FYUM4U9bRks29D8pXE86NtD4+ouYAYwd JwyGN8kXDM0VmDfbfhpubj1fabtsxmSzXgkV5Pcf2h8QupAzv0Kqg2ZpeKHa44GH 9C6fsf9QEBrvAPSQdFFToYc0J/lw8z4jZjb/aLKDC70tWjL55lCpXqtILQQqfyKf jG7JmZq2bWpzO9Bo5MQPU3wlI6aA1xQlY0nSIMFe+nZFx8alCPz6W/mah25wv2Fe jqGxLYpjd9QMdNHLaan+SF8GxwKbws4e/D7EeU4V28bvfu96/VwezDYyhCkccdd2 DLWJHOU2+uHY/HQ09sg2ZUCl6Jid1AYEHHDLB4fqaB6IUSzHoi7AybT8ZhwVrdIb YPOOz3HMcyob/bUUQ882bjp+daZo5suNp4Q5vRpUuCCmCzldauwcI3BdILTh4enx p+1S24z/FCB0Rk5+/JC/Cu2aTJ0IOMS6nu2qrQ2CSYlkO2UjWNUyzDxwG2iSbEEw rVSnvOmN0fvZ0iihtsCvQB4ParNvAc4nc3wPEot7tRhdKyk/vbYl81z0aSa0xx6u WLIBYGRdmmpqizBJE38BM7DyhOtPmdOAxt3f6qVHnLjwQJW2bpGcyoLe64kIoMAD LevPj0xAZfO06qYKUSHm =vi+v -----END PGP SIGNATURE----- --IDYEmSnFhs3mNXr+--