From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35719) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqb4Q-0006Z9-BB for qemu-devel@nongnu.org; Thu, 14 Apr 2016 02:48:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aqb4L-0008D8-7z for qemu-devel@nongnu.org; Thu, 14 Apr 2016 02:48:06 -0400 Received: from mail-db5eur01on0096.outbound.protection.outlook.com ([104.47.2.96]:44260 helo=EUR01-DB5-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqb4K-0008Ck-Tv for qemu-devel@nongnu.org; Thu, 14 Apr 2016 02:48:01 -0400 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> From: "Denis V. Lunev" Message-ID: <570F355E.1080603@openvz.org> Date: Thu, 14 Apr 2016 09:14:54 +0300 MIME-Version: 1.0 In-Reply-To: <20160414054653.GF31467@ad.usersys.redhat.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit 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: Fam Zheng 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 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? Den