Re: [Qemu-devel] [PATCH for-2.7 v2 05/17] raw-posix: Implement .bdrv_lockf

2016-04-19 Thread Daniel P. Berrange
On Tue, Apr 19, 2016 at 02:36:05PM +0100, Richard W.M. Jones wrote: > > I'd prefer some kind of no lock / ignore lock. There is a legitimate > case where you want to have the shared lock behaviour, but also a > legitimate one for turning it off. I'm not opposed to the idea -- > there are very re

Re: [Qemu-devel] [PATCH for-2.7 v2 05/17] raw-posix: Implement .bdrv_lockf

2016-04-19 Thread Richard W.M. Jones
On Tue, Apr 19, 2016 at 02:34:30PM +0100, Daniel P. Berrange wrote: > Have you ever considered integration with the QEMU NBD server. We > don't have APIs for enabling it explicitly in libvirt, but it strikes > me that it could be ideally suited for your needs. > > eg a hypothetical libvirt command

Re: [Qemu-devel] [PATCH for-2.7 v2 05/17] raw-posix: Implement .bdrv_lockf

2016-04-19 Thread Richard W.M. Jones
On Tue, Apr 19, 2016 at 09:19:02PM +0800, Fam Zheng wrote: > On Tue, 04/19 14:07, Richard W.M. Jones wrote: > > We've done this successfully for years, for people monitoring their > > VMs using virt-df, pulling out files using guestfish and so on. We > > allow you to do it while the guest is live

Re: [Qemu-devel] [PATCH for-2.7 v2 05/17] raw-posix: Implement .bdrv_lockf

2016-04-19 Thread Daniel P. Berrange
On Mon, Apr 18, 2016 at 09:04:19AM +0100, Richard W.M. Jones wrote: > On Mon, Apr 18, 2016 at 09:10:36AM +0800, Fam Zheng wrote: > > On Sun, 04/17 20:27, Richard W.M. Jones wrote: > > > On Fri, Apr 15, 2016 at 11:27:55AM +0800, Fam Zheng wrote: > > > > virtlockd in libvirt locks the first byte, we

Re: [Qemu-devel] [PATCH for-2.7 v2 05/17] raw-posix: Implement .bdrv_lockf

2016-04-19 Thread Fam Zheng
On Tue, 04/19 14:07, Richard W.M. Jones wrote: > On Tue, Apr 19, 2016 at 08:37:14PM +0800, Fam Zheng wrote: > > On Mon, 04/18 09:04, Richard W.M. Jones wrote: > > > On Mon, Apr 18, 2016 at 09:10:36AM +0800, Fam Zheng wrote: > > > > On Sun, 04/17 20:27, Richard W.M. Jones wrote: > > > > > On Fri, Ap

Re: [Qemu-devel] [PATCH for-2.7 v2 05/17] raw-posix: Implement .bdrv_lockf

2016-04-19 Thread Richard W.M. Jones
On Tue, Apr 19, 2016 at 08:37:14PM +0800, Fam Zheng wrote: > On Mon, 04/18 09:04, Richard W.M. Jones wrote: > > On Mon, Apr 18, 2016 at 09:10:36AM +0800, Fam Zheng wrote: > > > On Sun, 04/17 20:27, Richard W.M. Jones wrote: > > > > On Fri, Apr 15, 2016 at 11:27:55AM +0800, Fam Zheng wrote: > > > >

Re: [Qemu-devel] [PATCH for-2.7 v2 05/17] raw-posix: Implement .bdrv_lockf

2016-04-19 Thread Fam Zheng
On Mon, 04/18 09:04, Richard W.M. Jones wrote: > On Mon, Apr 18, 2016 at 09:10:36AM +0800, Fam Zheng wrote: > > On Sun, 04/17 20:27, Richard W.M. Jones wrote: > > > On Fri, Apr 15, 2016 at 11:27:55AM +0800, Fam Zheng wrote: > > > > virtlockd in libvirt locks the first byte, we lock byte 1 to avoid

Re: [Qemu-devel] [PATCH for-2.7 v2 05/17] raw-posix: Implement .bdrv_lockf

2016-04-18 Thread Denis V. Lunev
On 04/18/2016 12:34 PM, Daniel P. Berrange wrote: On Mon, Apr 18, 2016 at 09:12:44AM +0800, Fam Zheng wrote: On Sat, 04/16 16:29, Denis V. Lunev wrote: On 04/15/2016 06:27 AM, Fam Zheng wrote: virtlockd in libvirt locks the first byte, we lock byte 1 to avoid the intervene. Suggested-by: "Dan

Re: [Qemu-devel] [PATCH for-2.7 v2 05/17] raw-posix: Implement .bdrv_lockf

2016-04-18 Thread Daniel P. Berrange
On Mon, Apr 18, 2016 at 09:12:44AM +0800, Fam Zheng wrote: > On Sat, 04/16 16:29, Denis V. Lunev wrote: > > On 04/15/2016 06:27 AM, Fam Zheng wrote: > > >virtlockd in libvirt locks the first byte, we lock byte 1 to avoid > > >the intervene. > > > > > >Suggested-by: "Daniel P. Berrange" > > >Signed

Re: [Qemu-devel] [PATCH for-2.7 v2 05/17] raw-posix: Implement .bdrv_lockf

2016-04-18 Thread Richard W.M. Jones
On Mon, Apr 18, 2016 at 09:10:36AM +0800, Fam Zheng wrote: > On Sun, 04/17 20:27, Richard W.M. Jones wrote: > > On Fri, Apr 15, 2016 at 11:27:55AM +0800, Fam Zheng wrote: > > > virtlockd in libvirt locks the first byte, we lock byte 1 to avoid > > > the intervene. > > > +static int raw_lockf(BlockD

Re: [Qemu-devel] [PATCH for-2.7 v2 05/17] raw-posix: Implement .bdrv_lockf

2016-04-17 Thread Denis V. Lunev
On 04/18/2016 04:12 AM, Fam Zheng wrote: On Sat, 04/16 16:29, Denis V. Lunev wrote: On 04/15/2016 06:27 AM, Fam Zheng wrote: virtlockd in libvirt locks the first byte, we lock byte 1 to avoid the intervene. Suggested-by: "Daniel P. Berrange" Signed-off-by: Fam Zheng --- block/raw-posix.c |

Re: [Qemu-devel] [PATCH for-2.7 v2 05/17] raw-posix: Implement .bdrv_lockf

2016-04-17 Thread Fam Zheng
On Sat, 04/16 16:29, Denis V. Lunev wrote: > On 04/15/2016 06:27 AM, Fam Zheng wrote: > >virtlockd in libvirt locks the first byte, we lock byte 1 to avoid > >the intervene. > > > >Suggested-by: "Daniel P. Berrange" > >Signed-off-by: Fam Zheng > >--- > > block/raw-posix.c | 35 ++

Re: [Qemu-devel] [PATCH for-2.7 v2 05/17] raw-posix: Implement .bdrv_lockf

2016-04-17 Thread Fam Zheng
On Sun, 04/17 20:27, Richard W.M. Jones wrote: > On Fri, Apr 15, 2016 at 11:27:55AM +0800, Fam Zheng wrote: > > virtlockd in libvirt locks the first byte, we lock byte 1 to avoid > > the intervene. > > +static int raw_lockf(BlockDriverState *bs, BdrvLockfCmd cmd) > > +{ > > + > > +BDRVRawState

Re: [Qemu-devel] [PATCH for-2.7 v2 05/17] raw-posix: Implement .bdrv_lockf

2016-04-17 Thread Richard W.M. Jones
On Fri, Apr 15, 2016 at 11:27:55AM +0800, Fam Zheng wrote: > virtlockd in libvirt locks the first byte, we lock byte 1 to avoid > the intervene. > +static int raw_lockf(BlockDriverState *bs, BdrvLockfCmd cmd) > +{ > + > +BDRVRawState *s = bs->opaque; > +int ret; > +struct flock fl = (st

Re: [Qemu-devel] [PATCH for-2.7 v2 05/17] raw-posix: Implement .bdrv_lockf

2016-04-16 Thread Denis V. Lunev
On 04/15/2016 06:27 AM, Fam Zheng wrote: virtlockd in libvirt locks the first byte, we lock byte 1 to avoid the intervene. Suggested-by: "Daniel P. Berrange" Signed-off-by: Fam Zheng --- block/raw-posix.c | 35 +++ 1 file changed, 35 insertions(+) diff --git