Re: [Qemu-devel] [PATCH v12 14/16] file-posix: Implement image locking

2017-02-08 Thread Fam Zheng
On Wed, 02/08 14:18, Max Reitz wrote: > On 08.02.2017 07:00, Fam Zheng wrote: > > On Wed, 02/08 04:05, Max Reitz wrote: > >>> +static int raw_lt_write_to_write_share(RawLockTransOp op, > >>> + int old_lock_fd, int new_lock_fd, > >>> +

Re: [Qemu-devel] [PATCH v12 14/16] file-posix: Implement image locking

2017-02-08 Thread Max Reitz
On 08.02.2017 07:00, Fam Zheng wrote: > On Wed, 02/08 04:05, Max Reitz wrote: >>> +static int raw_lt_write_to_write_share(RawLockTransOp op, >>> + int old_lock_fd, int new_lock_fd, >>> + BDRVRawLockMode old_lock, >>> +

Re: [Qemu-devel] [PATCH v12 14/16] file-posix: Implement image locking

2017-02-07 Thread Fam Zheng
On Wed, 02/08 04:05, Max Reitz wrote: > > +static int raw_lt_write_to_write_share(RawLockTransOp op, > > + int old_lock_fd, int new_lock_fd, > > + BDRVRawLockMode old_lock, > > + BDRVRa

Re: [Qemu-devel] [PATCH v12 14/16] file-posix: Implement image locking

2017-02-07 Thread Max Reitz
On 23.01.2017 13:30, Fam Zheng wrote: > This implements open flag sensible image locking for local file > and host device protocol. > > virtlockd in libvirt locks the first byte, so we start looking at the > file bytes from 1. > > Quoting what was proposed by Kevin Wolf , there are > four locking

[Qemu-devel] [PATCH v12 14/16] file-posix: Implement image locking

2017-01-23 Thread Fam Zheng
This implements open flag sensible image locking for local file and host device protocol. virtlockd in libvirt locks the first byte, so we start looking at the file bytes from 1. Quoting what was proposed by Kevin Wolf , there are four locking modes by combining two bits (BDRV_O_RDWR and BDRV_O_S