From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57569) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqagW-0007L0-Da for qemu-devel@nongnu.org; Thu, 14 Apr 2016 02:23:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aqagV-0001ir-JP for qemu-devel@nongnu.org; Thu, 14 Apr 2016 02:23:24 -0400 Date: Thu, 14 Apr 2016 14:23:13 +0800 From: Fam Zheng Message-ID: <20160414062313.GA13950@ad.usersys.redhat.com> References: <1460538604-12132-1-git-send-email-famz@redhat.com> <570E1CFE.3070907@openvz.org> <20160414023627.GD31467@ad.usersys.redhat.com> <570F24C8.9020501@openvz.org> <20160414054653.GF31467@ad.usersys.redhat.com> <570F355E.1080603@openvz.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <570F355E.1080603@openvz.org> Subject: Re: [Qemu-devel] [PATCH for-2.7 00/15] block: Lock images when opening List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Denis V. Lunev" Cc: qemu-devel@nongnu.org, Kevin Wolf , Max Reitz , Jeff Cody , Markus Armbruster , Eric Blake , John Snow , qemu-block@nongnu.org, berrange@redhat.com, pbonzini@redhat.com On Thu, 04/14 09:14, Denis V. Lunev wrote: > On 04/14/2016 08:46 AM, Fam Zheng wrote: > >On Thu, 04/14 08:04, Denis V. Lunev wrote: > >>unfortunately no. If the lock will be on the image file, > >>we will have get it on the target node on QEMU start > >>and re-acquire it in bdrv_invalidate_cache. > >> > >> From my POW you should not get the lock if > >>BDRV_O_INACTIVE is set. > >That is what I meant. :) > > > >At source: Images are unlocked in bdrv_inactivate(). > > > >At destinition: Images are not locked if opened with BDRV_O_INACTIVE, and > >are locked in bdrv_invalidate_cache() (at the INMIGRATE -> RUNNING switch). > > > >Fam > it looks I have missed something. The above will work, but > I do not see clause where you set BDRV_O_NOLOCK when BDRV_O_INACTIVE > is set. > > Do you mean that we will not reach bdrv_open_common with this flag > set? I'm updating the patch to also check BDRV_O_INACTIVE in bdrv_open_common in v2. Fam