Re: [Qemu-devel] [PATCH for-2.7 00/15] block: Lock images when opening

2016-04-17 Thread Richard W.M. Jones
On Wed, Apr 13, 2016 at 05:09:49PM +0800, Fam Zheng wrote: > Underneath is the fcntl syscall that locks the local file, similar to what is > already used in libvirt virtlockd. Also because of that, we cannot directly > apply fcntl lock on the image file itself, instead we open and lock > "/var/tm

Re: [Qemu-devel] [PATCH for-2.7 00/15] block: Lock images when opening

2016-04-13 Thread Denis V. Lunev
On 04/14/2016 08:46 AM, Fam Zheng wrote: On Thu, 04/14 08:04, Denis V. Lunev wrote: unfortunately no. If the lock will be on the image file, we will have get it on the target node on QEMU start and re-acquire it in bdrv_invalidate_cache. From my POW you should not get the lock if BDRV_O_INACTI

Re: [Qemu-devel] [PATCH for-2.7 00/15] block: Lock images when opening

2016-04-13 Thread Denis V. Lunev
On 04/14/2016 09:23 AM, Fam Zheng wrote: On Thu, 04/14 09:14, Denis V. Lunev wrote: On 04/14/2016 08:46 AM, Fam Zheng wrote: On Thu, 04/14 08:04, Denis V. Lunev wrote: unfortunately no. If the lock will be on the image file, we will have get it on the target node on QEMU start and re-acquire i

Re: [Qemu-devel] [PATCH for-2.7 00/15] block: Lock images when opening

2016-04-13 Thread Fam Zheng
On Thu, 04/14 09:14, Denis V. Lunev wrote: > On 04/14/2016 08:46 AM, Fam Zheng wrote: > >On Thu, 04/14 08:04, Denis V. Lunev wrote: > >>unfortunately no. If the lock will be on the image file, > >>we will have get it on the target node on QEMU start > >>and re-acquire it in bdrv_invalidate_cache. >

Re: [Qemu-devel] [PATCH for-2.7 00/15] block: Lock images when opening

2016-04-13 Thread Fam Zheng
On Thu, 04/14 08:04, Denis V. Lunev wrote: > unfortunately no. If the lock will be on the image file, > we will have get it on the target node on QEMU start > and re-acquire it in bdrv_invalidate_cache. > > From my POW you should not get the lock if > BDRV_O_INACTIVE is set. That is what I meant.

Re: [Qemu-devel] [PATCH for-2.7 00/15] block: Lock images when opening

2016-04-13 Thread Denis V. Lunev
On 04/14/2016 05:36 AM, Fam Zheng wrote: On Wed, 04/13 13:18, Denis V. Lunev wrote: On 04/13/2016 12:09 PM, Fam Zheng wrote: Too many troubles have been caused by two processes writing to the same image unexpectedly. This series introduces automatical image locking into QEMU to avoid such trage

Re: [Qemu-devel] [PATCH for-2.7 00/15] block: Lock images when opening

2016-04-13 Thread Fam Zheng
On Wed, 04/13 13:18, Denis V. Lunev wrote: > On 04/13/2016 12:09 PM, Fam Zheng wrote: > >Too many troubles have been caused by two processes writing to the same image > >unexpectedly. This series introduces automatical image locking into QEMU to > >avoid such tragedy. With this, the user won't be a

Re: [Qemu-devel] [PATCH for-2.7 00/15] block: Lock images when opening

2016-04-13 Thread Fam Zheng
On Wed, 04/13 10:19, Daniel P. Berrange wrote: > On Wed, Apr 13, 2016 at 05:09:49PM +0800, Fam Zheng wrote: > > Too many troubles have been caused by two processes writing to the same > > image > > unexpectedly. This series introduces automatical image locking into QEMU to > > avoid such tragedy.

Re: [Qemu-devel] [PATCH for-2.7 00/15] block: Lock images when opening

2016-04-13 Thread Denis V. Lunev
On 04/13/2016 12:09 PM, Fam Zheng wrote: Too many troubles have been caused by two processes writing to the same image unexpectedly. This series introduces automatical image locking into QEMU to avoid such tragedy. With this, the user won't be able to open the image from two processes (e.g. using

Re: [Qemu-devel] [PATCH for-2.7 00/15] block: Lock images when opening

2016-04-13 Thread Daniel P. Berrange
On Wed, Apr 13, 2016 at 05:09:49PM +0800, Fam Zheng wrote: > Too many troubles have been caused by two processes writing to the same image > unexpectedly. This series introduces automatical image locking into QEMU to > avoid such tragedy. With this, the user won't be able to open the image from > t

[Qemu-devel] [PATCH for-2.7 00/15] block: Lock images when opening

2016-04-13 Thread Fam Zheng
Too many troubles have been caused by two processes writing to the same image unexpectedly. This series introduces automatical image locking into QEMU to avoid such tragedy. With this, the user won't be able to open the image from two processes (e.g. using qemu-img when the image is attached to the