From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60043) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6Gzz-0006oC-QT for qemu-devel@nongnu.org; Fri, 27 May 2016 08:36:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b6Gzx-0002sF-Ui for qemu-devel@nongnu.org; Fri, 27 May 2016 08:36:18 -0400 Date: Fri, 27 May 2016 20:36:13 +0800 From: Fam Zheng Message-ID: <20160527123613.GD7880@ad.usersys.redhat.com> References: <1463470536-8981-1-git-send-email-famz@redhat.com> <1463470536-8981-8-git-send-email-famz@redhat.com> <20160527074846.GB15113@ad.usersys.redhat.com> <3a4f4b70-cc34-ddee-ce3d-9fe19a806f05@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3a4f4b70-cc34-ddee-ce3d-9fe19a806f05@redhat.com> Subject: Re: [Qemu-devel] [PATCH v5 07/27] block: Handle image locking during reopen List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: qemu-devel@nongnu.org, Kevin Wolf , Jeff Cody , Markus Armbruster , Eric Blake , John Snow , qemu-block@nongnu.org, berrange@redhat.com, pbonzini@redhat.com, den@openvz.org, stefanha@redhat.com On Fri, 05/27 11:57, Max Reitz wrote: > On 27.05.2016 09:48, Fam Zheng wrote: > > On Tue, 05/24 18:28, Max Reitz wrote: > > [...] > > >> Also: Should bdrv_reopen_prepare() check that the locking flags are not > >> changed? > > > > Read only flag also matters in fcntl locks, so practically we almost always > > need some change on the lock. > > Hm, but as far as I can see, you don't handle changed locking flags > here; the reopened image is just locked if the old one had been locked > before. Since the handling of BDRV_O_SHARED_LOCK is done in > bdrv_lock_unlock_image_do(), that means that BDRV_O_NO_LOCK is ignored > if changed, isn't it? Yes you are rigth. I'm reworking this patch and it should fix this problem too. Fam