qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Hrdina <phrdina@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	Juan Quintela <quintela@redhat.com>,
	Stefan Hajnoczi <stefanha@gmail.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	Dietmar Maurer <dietmar@proxmox.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 14:53:02 +0100	[thread overview]
Message-ID: <514B10BE.2020000@redhat.com> (raw)
In-Reply-To: <514B0E3F.5070309@redhat.com>

On 03/21/2013 02:42 PM, 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:
>
> 1. save non-RAM device state
> 2. quiesce QEMU to a state that is safe for forking
> 3. create a memory map and a pipe
> 4. fork and pass the write end of the pipe to the child
> 5. parent continues running VM
> 6. child reads the memory map and writes data to the pipe
> 7. parent copies data from the pipe to the migration stream
> 8. child exits, parent raises live savevm completion QMP event
>
> Paolo
>

As I just wrote to Stefan, I've already heard the fork idea.
I was trying to do it without forking the QEMU, but it will need support 
from KVM and it could be harder to do instead of forking the QEMU.

I'll start working on this.

Thanks Paolo

Pavel

  reply	other threads:[~2013-03-21 13:54 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 [this message]
2013-03-21 14:56           ` Stefan Hajnoczi
2013-03-21 15:08             ` Eric Blake
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=514B10BE.2020000@redhat.com \
    --to=phrdina@redhat.com \
    --cc=dietmar@proxmox.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@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).