qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC] qmp interface for save vmstate to image


From: Eric Blake
Subject: Re: [Qemu-devel] [RFC] qmp interface for save vmstate to image
Date: Thu, 21 Mar 2013 09:08:39 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4

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: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]