qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC] New thread for the VM migration


From: Anthony Liguori
Subject: Re: [Qemu-devel] [RFC] New thread for the VM migration
Date: Thu, 14 Jul 2011 11:49:55 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110516 Lightning/1.0b2 Thunderbird/3.1.10

On 07/14/2011 07:32 AM, Avi Kivity wrote:
On 07/14/2011 03:30 PM, Anthony Liguori wrote:
Does this mean that the following code is sometimes executed without
qemu_mutex? I don't think any of it is thread safe.


That was my reaction too.

I think the most rational thing to do is have a separate thread and a
pair of producer/consumer queues.

The I/O thread can push virtual addresses and sizes to the queue for
the migration thread to compress/write() to the fd. The migration
thread can then push sent regions onto a separate queue for the I/O
thread to mark as dirty.

Even virtual addresses are not safe enough, because of hotunplug.
Without some kind of locking, you have to copy the data.

We don't know yet how we're going to implement hot unplug so let's not worry about this for now.

I think a reference count based approach is really the only sane thing to do and if we did that, it wouldn't be a problem since the reference would be owned by the I/O thread and would live until the migration thread is done with the VA.

Regards,

Anthony Liguori






reply via email to

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