Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NLDzU-0003NI-TT for qemu-devel@nongnu.org; Thu, 17 Dec 2009 05:53:53 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NLDzQ-0003KC-4A for qemu-devel@nongnu.org; Thu, 17 Dec 2009 05:53:52 -0500 Received: from [199.232.76.173] (port=59807 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NLDzP-0003Js-By for qemu-devel@nongnu.org; Thu, 17 Dec 2009 05:53:47 -0500 Received: from verein.lst.de ([213.95.11.210]:60163) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1NLDzO-0003vW-RU for qemu-devel@nongnu.org; Thu, 17 Dec 2009 05:53:47 -0500 Date: Thu, 17 Dec 2009 11:53:45 +0100 From: Christoph Hellwig Subject: Re: [Qemu-devel] [PATCH VERSION 3] Disk image exclusive and shared locks. Message-ID: <20091217105345.GB17205@lst.de> References: <20091215164238.GA24410@amd.home.annexia.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091215164238.GA24410@amd.home.annexia.org> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Richard W.M. Jones" Cc: qemu-devel@nongnu.org FYI I don't think this is all too useful. Just about no one actually uses file locking APIs on block devices. If you want to provide protection against mounting the image on the host or scribbling over it using mkfs you need to open the block device node with O_EXCL on Linux as that's the mechanisms most tools and the filesystem code us for exclusion. If you're primarily interested in protection against other qemu instances you can add you code on top, but that seems like a rather marginal use case.