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: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH] Disk image shared and exclusive locks.
Date: Sat, 05 Dec 2009 11:59:40 -0600
User-agent: Thunderbird 2.0.0.23 (X11/20090825)

Avi Kivity 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. You really need to be much smarter here in how you handle locking.

Oh, that's just an implementation bug. Obviously there's no need to open a file for exclusive access if it will only be accessed for read (when merging a snapshot we'd need to upgrade the lock to exclusive while that takes place). I thought you objected to the whole concept.

I'm not sure whether it's best to enable it by default because, as I said earlier, I'm not comfortable with the lack of correctness wrt advisory vs. mandatory locking. Only qemu can implement this level of locking though so it's definitely something we ought to support.

However, from a UI and implementation perspective, I think we need significantly different semantics. You either want locking or you don't. I don't think the selection of none|shared|exclusive really makes sense.

Regards,

Anthony Liguori




reply via email to

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