From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43567) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XriBT-0007mE-Qi for qemu-devel@nongnu.org; Fri, 21 Nov 2014 01:59:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XriBE-0008BX-9S for qemu-devel@nongnu.org; Fri, 21 Nov 2014 01:59:11 -0500 Received: from ozlabs.org ([2401:3900:2:1::2]:55373) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XriBD-000890-To for qemu-devel@nongnu.org; Fri, 21 Nov 2014 01:58:56 -0500 Date: Fri, 21 Nov 2014 17:53:47 +1100 From: David Gibson Message-ID: <20141121065347.GM2867@voom.redhat.com> References: <1412358473-31398-1-git-send-email-dgilbert@redhat.com> <1412358473-31398-20-git-send-email-dgilbert@redhat.com> <20141103050819.GP8949@voom.redhat.com> <20141119175010.GN2355@work-vm> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lbQeYSs6J2ITmUo7" Content-Disposition: inline In-Reply-To: <20141119175010.GN2355@work-vm> Subject: Re: [Qemu-devel] [PATCH v4 19/47] Rework loadvm path for subloops List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert" Cc: aarcange@redhat.com, yamahata@private.email.ne.jp, quintela@redhat.com, cristian.klein@cs.umu.se, qemu-devel@nongnu.org, amit.shah@redhat.com, yanghy@cn.fujitsu.com --lbQeYSs6J2ITmUo7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 19, 2014 at 05:50:11PM +0000, Dr. David Alan Gilbert wrote: > * David Gibson (david@gibson.dropbear.id.au) wrote: > > On Fri, Oct 03, 2014 at 06:47:25PM +0100, Dr. David Alan Gilbert (git) = wrote: > > > From: "Dr. David Alan Gilbert" > > >=20 > > > Postcopy needs to have two migration streams loading concurrently; > > > one from memory (with the device state) and the other from the fd > > > with the memory transactions. > > >=20 > > > Split the core of qemu_loadvm_state out so we can use it for both. > > >=20 > > > Allow the inner loadvm loop to quit and signal whether the parent > > > should. > > >=20 > > > loadvm_handlers is made static since it's lifetime is greater > > > than the outer qemu_loadvm_state. > >=20 > > Maybe it's just me, but "made static" to me indicates either a change > > from fully-global to module-global, or (function) local automatic to > > local static, not a change from function local-automatic to > > module-global as here. > >=20 > > It's also not clear from this patch alone why the lifetime of > > loadvm_handlers now needs to exceed that of qemu_loadvm_state(). >=20 > OK, how about if I reworked that last sentence to be: >=20 > loadvm_handlers is made module-global to survive beyond the lifetime > of the outer qemu_loadvm_state since it may still be in use by > a subloop in the postcopy listen thread. Yeah, that's better. A global seems ugly though. Would it be better to dynamically allocate the list head and pass a pointer into the listen thread, or even to pass the list head by value into the listen thread. The individual list elements need to be cleaned up at some point anyway, so I don't think that introduces any lifetime questions that weren't already there. --=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 --lbQeYSs6J2ITmUo7 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJUbuF7AAoJEGw4ysog2bOSqKoP/37SmtRfAQ280FGPhwUvgXmT Sxt4/r2lioWUt+Jv8ApCoD0P+KJ/95VATQh8WV+JGwtaOGTw+f8NU1KVC7h2voAC vSpHXM6oU6nXv5dvoL4NTNRFocjJkTczxc4ZsoaNM3OEW5RKTH4BiWNqsxLaLaud JJtb5A4xI5Y6+OHjn+q2vvceCRwHcunssF7FU19BxR56HEXbVc/LZvum5i3inxhV eqGAzT+XSrdAhYQLArfopprLgwt+7tbJFO7GugQCqUJ5yhaFeIgaNsclIARyaN8K c71c6g74ACscQZIRvgEK2Z27Gby+vzi8yA9LHqUfo+2WQa6eN6QfK9UyLvpc2ANX YKai41xYVMDr+ip0Dp6xoMkLAaCBbvT9Ml+B0vppqpksb5YE0itCaY4yUBPMn7gL jxNHNDh2O83vygF+r2LIK8eATsBLlNkKTazGHXY0ubz5386x+CWBFAIafi9k8nk9 u9gPRwY5igAlyY14zcuxThexxMdQUcSYOVs7HMti8JqJKpXMjljCAqzf60PNtw2q Q0pKxBNHWJH6Vikd6sDzdOsQ4FzIm/FV+4f0T2u5tmhUPHS4EGt3R6FsbdE1xEBJ x+JvjOES6PO5LU4BTmDFEPWQiH0BYZ0+N3Qlvq/lwb1feV9hMFap66NyYhaYcxiO 1tDYJ9INU/diCdZdfJcp =WQ80 -----END PGP SIGNATURE----- --lbQeYSs6J2ITmUo7--