From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43433) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b02oO-0003Hu-PG for qemu-devel@nongnu.org; Tue, 10 May 2016 04:14:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b02oN-0006O6-G7 for qemu-devel@nongnu.org; Tue, 10 May 2016 04:14:36 -0400 Date: Tue, 10 May 2016 09:14:26 +0100 From: "Richard W.M. Jones" Message-ID: <20160510081425.GV1683@redhat.com> References: <1462848659-28659-1-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1462848659-28659-1-git-send-email-famz@redhat.com> Subject: Re: [Qemu-devel] [PATCH v4 00/27] block: Lock images when opening List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: qemu-devel@nongnu.org, Kevin Wolf , Max Reitz , Jeff Cody , Markus Armbruster , Eric Blake , qemu-block@nongnu.org, stefanha@redhat.com, pbonzini@redhat.com, John Snow , berrange@redhat.com, den@openvz.org On Tue, May 10, 2016 at 10:50:32AM +0800, Fam Zheng wrote: > v4: Don't lock RO image. [Rich] I applied this on top of HEAD and added some debugging messages to block/raw-posix.c so I can see when files are being opened and locked, and it does appear to do the right thing for read-only and write-exclusive files, ie. it applies an exclusive lock when opening a file for write-exclusive, and no lock when opening a file for read. However I didn't test the write-shareable case (the libvirt flag which should map to a shared lock -- is that right Dan?). Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top