From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41160) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqa7K-0003tN-9a for qemu-devel@nongnu.org; Thu, 14 Apr 2016 01:47:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aqa7J-00044c-CE for qemu-devel@nongnu.org; Thu, 14 Apr 2016 01:47:02 -0400 Date: Thu, 14 Apr 2016 13:46:53 +0800 From: Fam Zheng Message-ID: <20160414054653.GF31467@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <570F24C8.9020501@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 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