From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51749) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWmaC-0007mo-HY for qemu-devel@nongnu.org; Fri, 19 Feb 2016 10:03:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aWma6-0000Rg-PS for qemu-devel@nongnu.org; Fri, 19 Feb 2016 10:03:00 -0500 Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]:37128) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWma6-0000RS-Is for qemu-devel@nongnu.org; Fri, 19 Feb 2016 10:02:54 -0500 Received: by mail-wm0-x232.google.com with SMTP id g62so74985257wme.0 for ; Fri, 19 Feb 2016 07:02:54 -0800 (PST) Sender: Paolo Bonzini References: <1455470231-5223-1-git-send-email-pbonzini@redhat.com> <1455470231-5223-2-git-send-email-pbonzini@redhat.com> <20160216071711.GI18664@ad.usersys.redhat.com> From: Paolo Bonzini Message-ID: <56C72E9A.5000109@redhat.com> Date: Fri, 19 Feb 2016 16:02:50 +0100 MIME-Version: 1.0 In-Reply-To: <20160216071711.GI18664@ad.usersys.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/8] block-migration: acquire AioContext as necessary List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: qemu-devel@nongnu.org, stefanha@redhat.com, mst@redhat.com On 16/02/2016 08:17, Fam Zheng wrote: >> @@ -321,8 +339,9 @@ static int set_dirty_tracking(void) >> int ret; >> >> QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) { >> + /* Creating/dropping dirty bitmaps only requires the big QEMU lock. */ > > Why? I don't think it is safe today. The BDS state is mutated and it can race > with bdrv_set_dirty() etc. You're completely right. > (Also the refresh_total_sectors in bdrv_nb_sectors > can even do read/write, no?) refresh_total_sectors will just do a lseek(SEEK_END) basically. So that's safe. Paolo