From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34225) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqay5-0005bq-0k for qemu-devel@nongnu.org; Thu, 14 Apr 2016 02:41:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aqay4-0006oV-8R for qemu-devel@nongnu.org; Thu, 14 Apr 2016 02:41:32 -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> <570F355E.1080603@openvz.org> <20160414062313.GA13950@ad.usersys.redhat.com> From: "Denis V. Lunev" Message-ID: <570F3B8D.9000500@openvz.org> Date: Thu, 14 Apr 2016 09:41:17 +0300 MIME-Version: 1.0 In-Reply-To: <20160414062313.GA13950@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 09:23 AM, Fam Zheng wrote: > 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 thank you for clarification. This should work. I am eager to see the next version :) Den