From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39657) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d5yfi-0004ao-T6 for qemu-devel@nongnu.org; Wed, 03 May 2017 14:06:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d5yfd-0005CS-NY for qemu-devel@nongnu.org; Wed, 03 May 2017 14:06:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36741) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d5yfd-0005CI-Hh for qemu-devel@nongnu.org; Wed, 03 May 2017 14:06:37 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 92FC480C17 for ; Wed, 3 May 2017 18:06:35 +0000 (UTC) From: Juan Quintela In-Reply-To: <20170503104257.5127-1-dgilbert@redhat.com> (David Alan Gilbert's message of "Wed, 3 May 2017 11:42:57 +0100") References: <20170503104257.5127-1-dgilbert@redhat.com> Reply-To: quintela@redhat.com Date: Wed, 03 May 2017 20:06:28 +0200 Message-ID: <87pofpizmj.fsf@secure.mitica> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH] block migration: Allow compile time disable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert (git)" Cc: qemu-devel@nongnu.org, jcody@redhat.com, kwolf@redhat.com, kashyap@redhat.com "Dr. David Alan Gilbert (git)" wrote: > From: "Dr. David Alan Gilbert" > > Many users now prefer to use drive_mirror over NBD as an > alternative to the older migrate -b option; drive_mirror is > more complex to setup but gives you more options (e.g. only > migrating some of the disks if some of them are shared). > > Allow the large chunk of block migration code to be compiled > out for those who don't use it. > > Based on a downstream-patch we've had for a while by Jeff Cody. > > Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela > diff --git a/migration/migration.c b/migration/migration.c > index 353f2728cf..ffce72aabc 100644 > --- a/migration/migration.c > +++ b/migration/migration.c > @@ -692,6 +692,7 @@ MigrationInfo *qmp_query_migrate(Error **errp) > > populate_ram_info(info, s); > > +#ifdef CONFIG_LIVE_BLOCK_MIGRATION > if (blk_mig_active()) { > info->has_disk = true; > info->disk = g_malloc0(sizeof(*info->disk)); > @@ -699,6 +700,7 @@ MigrationInfo *qmp_query_migrate(Error **errp) > info->disk->remaining = blk_mig_bytes_remaining(); > info->disk->total = blk_mig_bytes_total(); > } > +#endif I think it can be cleaner to move this inside block.c and just export a function that is empty in case it is compiled out, but that it is just me, so you got the revieweb by anyways. > } > } > > +#ifdef CONFIG_LIVE_BLOCK_MIGRATION > blk_mig_init(); > +#endif > ram_mig_init(); > > /* If the currently selected machine wishes to override the units-per-bus Same here, I preffer the ifdef in the header than here. Later, Juan.