From: Eric Blake <eblake@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: Kevin Wolf <kwolf@redhat.com>, Pavel Hrdina <phrdina@redhat.com>,
Juan Quintela <quintela@redhat.com>,
qemu-devel <qemu-devel@nongnu.org>,
Dietmar Maurer <dietmar@proxmox.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [RFC] qmp interface for save vmstate to image
Date: Thu, 21 Mar 2013 09:08:39 -0600 [thread overview]
Message-ID: <514B2277.8070502@redhat.com> (raw)
In-Reply-To: <20130321145630.GA16677@stefanha-thinkpad.redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1438 bytes --]
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.
>>> 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 the
>> parent:
>
> 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.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]
next prev parent reply other threads:[~2013-03-21 15:08 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-15 7:24 [Qemu-devel] [RFC] qmp interface for save vmstate to image Wenchao Xia
2013-03-15 14:51 ` Stefan Hajnoczi
2013-03-18 6:40 ` Wenchao Xia
2013-03-18 9:04 ` Kevin Wolf
2013-03-18 10:08 ` Paolo Bonzini
2013-03-18 10:50 ` Wenchao Xia
2013-03-18 10:47 ` Wenchao Xia
2013-03-18 10:09 ` Stefan Hajnoczi
2013-03-18 13:28 ` Pavel Hrdina
2013-03-21 6:43 ` Wenchao Xia
2013-03-21 11:48 ` Pavel Hrdina
2013-03-21 13:38 ` Stefan Hajnoczi
2013-03-21 13:42 ` Paolo Bonzini
2013-03-21 13:53 ` Pavel Hrdina
2013-03-21 14:56 ` Stefan Hajnoczi
2013-03-21 15:08 ` Eric Blake [this message]
2013-03-23 4:36 ` Wenchao Xia
2013-03-27 3:35 ` Wenchao Xia
2013-03-21 13:43 ` Pavel Hrdina
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=514B2277.8070502@redhat.com \
--to=eblake@redhat.com \
--cc=dietmar@proxmox.com \
--cc=kwolf@redhat.com \
--cc=pbonzini@redhat.com \
--cc=phrdina@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=stefanha@gmail.com \
--cc=xiawenc@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).