From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NGyTT-0007Pd-3R for qemu-devel@nongnu.org; Sat, 05 Dec 2009 12:31:15 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NGyTO-0007N6-3m for qemu-devel@nongnu.org; Sat, 05 Dec 2009 12:31:14 -0500 Received: from [199.232.76.173] (port=37981 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NGyTN-0007N3-RK for qemu-devel@nongnu.org; Sat, 05 Dec 2009 12:31:09 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51554) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NGyTN-00005O-Of for qemu-devel@nongnu.org; Sat, 05 Dec 2009 12:31:10 -0500 Message-ID: <4B1A98D9.7010408@redhat.com> Date: Sat, 05 Dec 2009 19:31:05 +0200 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Disk image shared and exclusive locks. References: <20091204165301.GA4167@amd.home.annexia.org> <4B1943A0.7030509@codemonkey.ws> <20091204215517.GA5938@amd.home.annexia.org> <4B198D5B.5080803@codemonkey.ws> In-Reply-To: <4B198D5B.5080803@codemonkey.ws> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: "Richard W.M. Jones" , qemu-devel@nongnu.org On 12/05/2009 12:29 AM, Anthony Liguori wrote: > > Well disk sharing isn't actually bad as long as it's raw or a physical > device. > > For qcow2, it's very complicated by backing files because we really > need to express the concept of a read-write lock. > > That is, as long as the guests are opening the file read only, you > should allow many readers. However, you should prevent anyone from > opening with write permission. Likewise, writes should prevent future > reads. > Well shared/exclusive or read/write locks support exactly that. For non-raw storage we should take the locks unconditionally, since there is no useful way to share such images opened for write access. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic.