From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58116) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ws7Pi-0007mC-TQ for qemu-devel@nongnu.org; Wed, 04 Jun 2014 05:23:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ws7Pd-00021M-OD for qemu-devel@nongnu.org; Wed, 04 Jun 2014 05:23:18 -0400 Received: from mail-wi0-x22f.google.com ([2a00:1450:400c:c05::22f]:40416) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ws7Pd-000215-Hm for qemu-devel@nongnu.org; Wed, 04 Jun 2014 05:23:13 -0400 Received: by mail-wi0-f175.google.com with SMTP id f8so7980266wiw.8 for ; Wed, 04 Jun 2014 02:23:12 -0700 (PDT) Date: Wed, 4 Jun 2014 11:23:09 +0200 From: Stefan Hajnoczi Message-ID: <20140604092309.GC26902@stefanha-thinkpad.redhat.com> References: <1401853657-31014-1-git-send-email-chaiw.fnst@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1401853657-31014-1-git-send-email-chaiw.fnst@cn.fujitsu.com> 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: chai wen Cc: kwolf@redhat.com, famz@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, quintela@redhat.com 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' should be > added to block_mig_state.bmds_list first for subsequent processing. > Otherwise set_dirty_tracking will do nothing on an empty list than allocating > dirty_bitmaps for them. And bdrv_get_dirty_count will access the > 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(-) Thanks, applied to my block tree: https://github.com/stefanha/qemu/commits/block Stefan