Re: [Qemu-devel] [PATCH 13/14] raw-posix: Implement image locking

2017-01-18 Thread Fam Zheng
On Wed, 01/18 14:02, Max Reitz wrote: > >> Testing whether something is locked would be easier by using F_OFD_GETLK > >> instead of actually creating an exclusive lock and then releasing it. > > > > My attempt to do this shows it doesn't work: fcntl forces the tested lock > > type > > to read

Re: [Qemu-devel] [PATCH 13/14] raw-posix: Implement image locking

2017-01-18 Thread Max Reitz
On 18.01.2017 11:48, Fam Zheng wrote: > On Fri, 12/02 03:58, Max Reitz wrote: >> On 31.10.2016 16:38, 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 >>>

Re: [Qemu-devel] [PATCH 13/14] raw-posix: Implement image locking

2017-01-18 Thread Fam Zheng
On Fri, 12/02 03:58, Max Reitz wrote: > On 31.10.2016 16:38, 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

Re: [Qemu-devel] [PATCH 13/14] raw-posix: Implement image locking

2016-12-02 Thread Max Reitz
On 31.10.2016 16:38, 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

Re: [Qemu-devel] [PATCH 13/14] raw-posix: Implement image locking

2016-12-01 Thread Max Reitz
On 31.10.2016 16:38, 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

Re: [Qemu-devel] [PATCH 13/14] raw-posix: Implement image locking

2016-10-31 Thread Fam Zheng
On Mon, 10/31 17:01, Eric Blake wrote: > On 10/31/2016 10:38 AM, 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. > > What

Re: [Qemu-devel] [PATCH 13/14] raw-posix: Implement image locking

2016-10-31 Thread Richard W.M. Jones
On Mon, Oct 31, 2016 at 05:01:44PM -0500, Eric Blake wrote: > On 10/31/2016 10:38 AM, 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

Re: [Qemu-devel] [PATCH 13/14] raw-posix: Implement image locking

2016-10-31 Thread Eric Blake
On 10/31/2016 10:38 AM, 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. What happens if we try to use a raw file with less than 3 bytes?

[Qemu-devel] [PATCH 13/14] raw-posix: Implement image locking

2016-10-31 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