From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48931) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIh6j-0001mD-Nf for qemu-devel@nongnu.org; Thu, 21 Mar 2013 11:08:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UIh6i-0005JC-8w for qemu-devel@nongnu.org; Thu, 21 Mar 2013 11:08:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10032) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIh6i-0005Iv-17 for qemu-devel@nongnu.org; Thu, 21 Mar 2013 11:08:44 -0400 Message-ID: <514B2277.8070502@redhat.com> Date: Thu, 21 Mar 2013 09:08:39 -0600 From: Eric Blake MIME-Version: 1.0 References: <5142CCB6.7000004@linux.vnet.ibm.com> <51471686.3030505@redhat.com> <514AABFC.1030605@linux.vnet.ibm.com> <514AF393.8030109@redhat.com> <20130321133802.GA15276@stefanha-thinkpad.redhat.com> <514B0E3F.5070309@redhat.com> <20130321145630.GA16677@stefanha-thinkpad.redhat.com> In-Reply-To: <20130321145630.GA16677@stefanha-thinkpad.redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2VFHKOFXLUNRRQMBKUNJM" Subject: Re: [Qemu-devel] [RFC] qmp interface for save vmstate to image List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , Pavel Hrdina , Juan Quintela , qemu-devel , Dietmar Maurer , Paolo Bonzini , Wenchao Xia This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2VFHKOFXLUNRRQMBKUNJM Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 03/21/2013 08:56 AM, Stefan Hajnoczi wrote: > On Thu, Mar 21, 2013 at 02:42:23PM +0100, Paolo Bonzini wrote: >> Il 21/03/2013 14:38, Stefan Hajnoczi ha scritto: >>> There already is a guest RAM cloning mechanism: fork the QEMU process= =2E >>> Then you have a copy-on-write guest RAM. >>> >>> In a little more detail: >>> >>> 1. save non-RAM device state >>> 2. quiesce QEMU to a state that is safe for forking >>> 3. create an EventNotifier for live savevm completion signal >>> 4. fork and pass completion EventNotifier to child >>> 5. parent continues running VM >>> 6. child performs vmsave of copy-on-write guest RAM >>> 7. child signals completion EventNotifier and terminates >>> 8. parent raises live savevm completion QMP event >> >> Forking a threaded program is not so easy, but it could be done if the= >> child is very simple and only uses syscalls to communicate back with t= he >> parent: >=20 > On Linux you should be able to use clone(2) to spawn a thread with > copy-on-write memory. Too bad it's not portable because it gets around= > the messy fork issues. And introduces its own messy issues - once you clone() using different flags than what fork() does, you have invalidated the use of a LOT of libc interfaces in that child; in particular, any use of pthread is liable to break. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2VFHKOFXLUNRRQMBKUNJM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJRSyJ3AAoJEKeha0olJ0NqQocIAKgNb02IWMD+c7rgEtFFFPYa Ncn+TU5LALYybIlLrOWAtrLpzTgaZFmcUZM8jfIlC42/Dy7R7sCJsXB8/jYryJjX xr+pUXRAGXa1Pltqo8c9wO0xO6PAAytWQRVqobanja2/ySgCUaASd44jzbaQO9iZ RhGI8XGcJmPkbZhGSrrwvLDIzfxzHjh2fslfbAsAxZ4m6gE/8qdslJ1OfWlfBKv+ PrV8SFfCrnR8j9gOuvox1eCsl0ftxMAX92H5rqastG5zF6USZgzsrzXHzv7Mvv4Y 1PLv0uHfAsduheoqH20/ctYWOf1SC/Fap6+hfWkpBF+eMslX+tcv5AbjSUYImKo= =j4qw -----END PGP SIGNATURE----- ------enig2VFHKOFXLUNRRQMBKUNJM--