From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60835) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ws9WX-0002Y5-Pp for qemu-devel@nongnu.org; Wed, 04 Jun 2014 07:38:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ws9WS-0004sY-Pm for qemu-devel@nongnu.org; Wed, 04 Jun 2014 07:38:29 -0400 Received: from [59.151.112.132] (port=64354 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ws9WS-0004qT-4Q for qemu-devel@nongnu.org; Wed, 04 Jun 2014 07:38:24 -0400 Message-ID: <538F04BE.5020309@cn.fujitsu.com> Date: Wed, 4 Jun 2014 19:36:30 +0800 From: Chai Wen MIME-Version: 1.0 References: <1401853657-31014-1-git-send-email-chaiw.fnst@cn.fujitsu.com> <20140604092309.GC26902@stefanha-thinkpad.redhat.com> In-Reply-To: <20140604092309.GC26902@stefanha-thinkpad.redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH resend] block: fix wrong order in live block migration setup List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: kwolf@redhat.com, famz@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, quintela@redhat.com On 06/04/2014 05:23 PM, Stefan Hajnoczi wrote: > On Wed, Jun 04, 2014 at 11:47:37AM +0800, chai wen wrote: >> >> The function init_blk_migration is better to be called before >> set_dirty_tracking as the reasons below. >> >> If we want to track dirty blocks via dirty_maps on a BlockDriverState >> when doing live block-migration, its correspoding 'BlkMigDevState' shoul= d be >> added to block_mig_state.bmds_list first for subsequent processing. >> Otherwise set_dirty_tracking will do nothing on an empty list than alloc= ating >> dirty_bitmaps for them. And bdrv_get_dirty_count will access the=20 >> bmds->dirty_maps directly, then there would be a segfault triggered. >> >> If the set_dirty_tracking fails, qemu_savevm_state_cancel will handle >> the cleanup of init_blk_migration automatically. >> >> >> Reviewed-by: Fam Zheng >> Signed-off-by: chai wen >> --- >> block-migration.c | 3 +-- >> 1 files changed, 1 insertions(+), 2 deletions(-) >=20 > Thanks, applied to my block tree: > https://github.com/stefanha/qemu/commits/block >=20 OK=EF=BC=8C thanks for your attention about this fix. :) thanks chai wen > Stefan > . >=20 --=20 Regards Chai Wen