qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] Disk image shared and exclusive locks.


From: Richard W.M. Jones
Subject: Re: [Qemu-devel] [PATCH] Disk image shared and exclusive locks.
Date: Mon, 7 Dec 2009 10:58:55 +0000
User-agent: Mutt/1.5.18 (2008-05-17)

On Sat, Dec 05, 2009 at 11:47:11AM -0600, Anthony Liguori wrote:
> I think I made my point poorly.  Consider the following:
>
> qemu-img create -f raw base.img 10G
> qemu-img create -f qcow2 -b base.img cow1.img
> qemu-img create -f qcow2 -b base.img cow2.img
>
> qemu -drive file=cow1.img,lock=exclusive
> qemu -drive file=cow2.img,lock=exclusive
>
> With the current patch, the second command will fail and it's impossible  
> to invoke correctly.  That's because flags are passed down to backing  
> devices directly.

Isn't it correct that the second command fails?  Although the base
image is mostly used read-only, if the user does the "commit" command
in the monitor then the backing image is overwritten.  (That's my
understanding of the documentation anyway - I've never actually used
this feature of qcow2).

Also if we only acquire the lock during the commit operation then
we'll end up with disk corruption.  So we have to acquire the
exclusive lock the whole time, for the image and the backing store.

(That's my interpretation anyway -- it could very likely be wrong)

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://et.redhat.com/~rjones/virt-top




reply via email to

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