From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NHcFk-00050O-JS for qemu-devel@nongnu.org; Mon, 07 Dec 2009 06:59:44 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NHcFe-0004r7-8W for qemu-devel@nongnu.org; Mon, 07 Dec 2009 06:59:43 -0500 Received: from [199.232.76.173] (port=41831 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHcFd-0004qq-Tm for qemu-devel@nongnu.org; Mon, 07 Dec 2009 06:59:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]:30839) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NHcFd-0004CB-BG for qemu-devel@nongnu.org; Mon, 07 Dec 2009 06:59:37 -0500 Date: Mon, 7 Dec 2009 11:59:33 +0000 From: "Richard W.M. Jones" Subject: Re: [Qemu-devel] [PATCH] Disk image shared and exclusive locks. Message-ID: <20091207115933.GA27840@amd.home.annexia.org> References: <4B1A98D9.7010408@redhat.com> <4B1A9C9F.5040705@codemonkey.ws> <4B1A9E83.2050103@redhat.com> <4B1A9F8C.3010106@codemonkey.ws> <20091207103128.GA26970@shareable.org> <20091207104517.GJ24530@redhat.com> <20091207111953.GA29980@shareable.org> <20091207113014.GK24530@redhat.com> <20091207113147.GO23109@amd.home.annexia.org> <20091207114932.GL24530@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091207114932.GL24530@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" Cc: qemu-devel@nongnu.org, Avi Kivity On Mon, Dec 07, 2009 at 11:49:32AM +0000, Daniel P. Berrange wrote: > On Mon, Dec 07, 2009 at 11:31:47AM +0000, Richard W.M. Jones wrote: > > On Mon, Dec 07, 2009 at 11:30:14AM +0000, Daniel P. Berrange wrote: > > > On Mon, Dec 07, 2009 at 11:19:54AM +0000, Jamie Lokier wrote: > > > > > > > > No, the question is whether it makes sense to provide a 'shared' > > > > option on the command line, or simply to always map: > > > > > > > > image opened read only => F_FDLCK > > > > image opened writable => F_WRLCK > > > > > > > > and provide only a single command line option: 'lock'. > > > > > > That doesn't work in the case of setting up a clustered filesystem > > > shared between guests. That requires that the disk be opened writable, > > > but with a shared (F_RDLOCK) lock. > > > > I think Jamie's point is that you might as well use no locking at all > > in this configuration. It's hard to see what lock=shared is > > protecting you against. > > This is saying that there is no need to protect 'shared writers' > from 'exclusive writers', which is not true. [example snipped] OK so the case for lock=shared is where you have a shared clustered resource, *and* an uber-admin-tool which may require exclusive access to the resource. I now understand, and that seems to make sense (albeit a rather rare case). It has to be said the only reason I implemented the shared mode in the original patch, was because both POSIX and Win32 (LockFileEx) have the distinction between shared and exclusive, in other words 'coz it was easy :-) Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://et.redhat.com/~rjones/virt-df/