From nobody Sun May 5 19:24:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1493116372666319.3525449360527; Tue, 25 Apr 2017 03:32:52 -0700 (PDT) Received: from localhost ([::1]:48277 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d2xm7-000246-5T for importer@patchew.org; Tue, 25 Apr 2017 06:32:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49958) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d2xkG-0000ud-Dq for qemu-devel@nongnu.org; Tue, 25 Apr 2017 06:30:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d2xkF-0004wY-AI for qemu-devel@nongnu.org; Tue, 25 Apr 2017 06:30:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37660) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d2xkF-0004wL-1c for qemu-devel@nongnu.org; Tue, 25 Apr 2017 06:30:55 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 08C958047F for ; Tue, 25 Apr 2017 10:30:54 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 96D468078C; Tue, 25 Apr 2017 10:30:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 08C958047F Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=quintela@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 08C958047F From: Juan Quintela To: qemu-devel@nongnu.org Date: Tue, 25 Apr 2017 12:30:47 +0200 Message-Id: <20170425103049.4073-2-quintela@redhat.com> In-Reply-To: <20170425103049.4073-1-quintela@redhat.com> References: <20170425103049.4073-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 25 Apr 2017 10:30:54 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 1/3] migration: Create block capabilities for shared and enable X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lvivier@redhat.com, dgilbert@redhat.com, peterx@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Those two capabilities were added through the command line. Notice that we just created them. This is just the boilerplate. Signed-off-by: Juan Quintela Reviewed-by: Eric Blake --- include/migration/migration.h | 3 +++ migration/migration.c | 36 ++++++++++++++++++++++++++++++++++++ qapi-schema.json | 7 ++++++- 3 files changed, 45 insertions(+), 1 deletion(-) diff --git a/include/migration/migration.h b/include/migration/migration.h index dfeca38..618ab0e 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -307,6 +307,9 @@ bool migrate_colo_enabled(void); =20 int64_t xbzrle_cache_resize(int64_t new_size); =20 +bool migrate_use_block_enabled(void); +bool migrate_use_block_shared(void); + bool migrate_use_compression(void); int migrate_compress_level(void); int migrate_compress_threads(void); diff --git a/migration/migration.c b/migration/migration.c index 5447cab..775b24c 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1195,6 +1195,16 @@ bool migration_is_blocked(Error **errp) return false; } =20 +static void migrate_set_block_shared(MigrationState *s) +{ + s->enabled_capabilities[MIGRATION_CAPABILITY_BLOCK_SHARED] =3D true; +} + +static void migrate_set_block_enabled(MigrationState *s) +{ + s->enabled_capabilities[MIGRATION_CAPABILITY_BLOCK_ENABLED] =3D true; +} + void qmp_migrate(const char *uri, bool has_blk, bool blk, bool has_inc, bool inc, bool has_detach, bool detach, Error **errp) @@ -1224,6 +1234,14 @@ void qmp_migrate(const char *uri, bool has_blk, bool= blk, =20 s =3D migrate_init(¶ms); =20 + if (has_blk && blk) { + migrate_set_block_enabled(s); + } + + if (has_inc && inc) { + migrate_set_block_shared(s); + } + if (strstart(uri, "tcp:", &p)) { tcp_start_outgoing_migration(s, p, &local_err); #ifdef CONFIG_RDMA @@ -1419,6 +1437,24 @@ int64_t migrate_xbzrle_cache_size(void) return s->xbzrle_cache_size; } =20 +bool migrate_use_block_enabled(void) +{ + MigrationState *s; + + s =3D migrate_get_current(); + + return s->enabled_capabilities[MIGRATION_CAPABILITY_BLOCK_ENABLED]; +} + +bool migrate_use_block_shared(void) +{ + MigrationState *s; + + s =3D migrate_get_current(); + + return s->enabled_capabilities[MIGRATION_CAPABILITY_BLOCK_SHARED]; +} + /* migration thread support */ /* * Something bad happened to the RP stream, mark an error diff --git a/qapi-schema.json b/qapi-schema.json index 01b087f..e963bb3 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -894,11 +894,16 @@ # @release-ram: if enabled, qemu will free the migrated ram pages on the s= ource # during postcopy-ram migration. (since 2.9) # +# @block-enabled: enable block migration (Since 2.10) +# +# @block-shared: enable block shared migration (Since 2.10) +# # Since: 1.2 ## { 'enum': 'MigrationCapability', 'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks', - 'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram'] } + 'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram', + 'block-enabled', 'block-shared' ] } =20 ## # @MigrationCapabilityStatus: --=20 2.9.3 From nobody Sun May 5 19:24:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1493116484748709.3000866805719; Tue, 25 Apr 2017 03:34:44 -0700 (PDT) Received: from localhost ([::1]:48290 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d2xnv-0003ag-Dx for importer@patchew.org; Tue, 25 Apr 2017 06:34:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49990) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d2xkJ-0000wh-4C for qemu-devel@nongnu.org; Tue, 25 Apr 2017 06:31:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d2xkH-0004xQ-0m for qemu-devel@nongnu.org; Tue, 25 Apr 2017 06:30:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34226) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d2xkG-0004wx-Nc for qemu-devel@nongnu.org; Tue, 25 Apr 2017 06:30:56 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B5AF47CFAD for ; Tue, 25 Apr 2017 10:30:55 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5930E8078C; Tue, 25 Apr 2017 10:30:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B5AF47CFAD Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=quintela@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com B5AF47CFAD From: Juan Quintela To: qemu-devel@nongnu.org Date: Tue, 25 Apr 2017 12:30:48 +0200 Message-Id: <20170425103049.4073-3-quintela@redhat.com> In-Reply-To: <20170425103049.4073-1-quintela@redhat.com> References: <20170425103049.4073-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 25 Apr 2017 10:30:55 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 2/3] migration: Remove use of old MigrationParams X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lvivier@redhat.com, dgilbert@redhat.com, peterx@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" We have change in the previous patch to use migration capabilities for it. Notice that we continue using the old command line flags from migrate command from the time being. Remove the set_params method as now it is empty. Signed-off-by: Juan Quintela --- include/migration/migration.h | 3 +-- migration/block.c | 17 ++--------------- migration/colo.c | 3 --- migration/migration.c | 8 +++++--- migration/savevm.c | 2 -- 5 files changed, 8 insertions(+), 25 deletions(-) diff --git a/include/migration/migration.h b/include/migration/migration.h index 618ab0e..2917baa 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -42,8 +42,7 @@ extern int only_migratable; =20 struct MigrationParams { - bool blk; - bool shared; + bool unused; /* C don't allow empty structs */ }; =20 /* Messages sent on the return path from destination to source */ diff --git a/migration/block.c b/migration/block.c index 060087f..fcfa823 100644 --- a/migration/block.c +++ b/migration/block.c @@ -94,9 +94,6 @@ typedef struct BlkMigBlock { } BlkMigBlock; =20 typedef struct BlkMigState { - /* Written during setup phase. Can be read without a lock. */ - int blk_enable; - int shared_base; QSIMPLEQ_HEAD(bmds_list, BlkMigDevState) bmds_list; int64_t total_sector_sum; bool zero_blocks; @@ -425,7 +422,7 @@ static int init_blk_migration(QEMUFile *f) bmds->bulk_completed =3D 0; bmds->total_sectors =3D sectors; bmds->completed_sectors =3D 0; - bmds->shared_base =3D block_mig_state.shared_base; + bmds->shared_base =3D migrate_use_block_shared(); =20 assert(i < num_bs); bmds_bs[i].bmds =3D bmds; @@ -994,22 +991,12 @@ static int block_load(QEMUFile *f, void *opaque, int = version_id) return 0; } =20 -static void block_set_params(const MigrationParams *params, void *opaque) -{ - block_mig_state.blk_enable =3D params->blk; - block_mig_state.shared_base =3D params->shared; - - /* shared base means that blk_enable =3D 1 */ - block_mig_state.blk_enable |=3D params->shared; -} - static bool block_is_active(void *opaque) { - return block_mig_state.blk_enable =3D=3D 1; + return migrate_use_block_enabled(); } =20 static SaveVMHandlers savevm_block_handlers =3D { - .set_params =3D block_set_params, .save_live_setup =3D block_save_setup, .save_live_iterate =3D block_save_iterate, .save_live_complete_precopy =3D block_save_complete, diff --git a/migration/colo.c b/migration/colo.c index c19eb3f..5c6c2f0 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -332,9 +332,6 @@ static int colo_do_checkpoint_transaction(MigrationStat= e *s, goto out; } =20 - /* Disable block migration */ - s->params.blk =3D 0; - s->params.shared =3D 0; qemu_savevm_state_header(fb); qemu_savevm_state_begin(fb, &s->params); qemu_mutex_lock_iothread(); diff --git a/migration/migration.c b/migration/migration.c index 775b24c..9b96f1a 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -787,6 +787,10 @@ void qmp_migrate_set_capabilities(MigrationCapabilityS= tatusList *params, s->enabled_capabilities[cap->value->capability] =3D cap->value->st= ate; } =20 + if (s->enabled_capabilities[MIGRATION_CAPABILITY_BLOCK_SHARED]) { + s->enabled_capabilities[MIGRATION_CAPABILITY_BLOCK_ENABLED] =3D tr= ue; + } + if (migrate_postcopy_ram()) { if (migrate_use_compression()) { /* The decompression threads asynchronously write into RAM @@ -1214,9 +1218,6 @@ void qmp_migrate(const char *uri, bool has_blk, bool = blk, MigrationParams params; const char *p; =20 - params.blk =3D has_blk && blk; - params.shared =3D has_inc && inc; - if (migration_is_setup_or_active(s->state) || s->state =3D=3D MIGRATION_STATUS_CANCELLING || s->state =3D=3D MIGRATION_STATUS_COLO) { @@ -1239,6 +1240,7 @@ void qmp_migrate(const char *uri, bool has_blk, bool = blk, } =20 if (has_inc && inc) { + migrate_set_block_enabled(s); migrate_set_block_shared(s); } =20 diff --git a/migration/savevm.c b/migration/savevm.c index 0c01988..102b11d 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1233,8 +1233,6 @@ static int qemu_savevm_state(QEMUFile *f, Error **err= p) { int ret; MigrationParams params =3D { - .blk =3D 0, - .shared =3D 0 }; MigrationState *ms =3D migrate_init(¶ms); MigrationStatus status; --=20 2.9.3 From nobody Sun May 5 19:24:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 14931163763941013.5938011786402; Tue, 25 Apr 2017 03:32:56 -0700 (PDT) Received: from localhost ([::1]:48278 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d2xmA-00027W-Ts for importer@patchew.org; Tue, 25 Apr 2017 06:32:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50011) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d2xkK-0000xk-Cg for qemu-devel@nongnu.org; Tue, 25 Apr 2017 06:31:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d2xkJ-0004y0-0L for qemu-devel@nongnu.org; Tue, 25 Apr 2017 06:31:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34376) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d2xkI-0004xa-IG for qemu-devel@nongnu.org; Tue, 25 Apr 2017 06:30:58 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 83A4361BAB for ; Tue, 25 Apr 2017 10:30:57 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 12C2B8078C; Tue, 25 Apr 2017 10:30:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 83A4361BAB Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=quintela@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 83A4361BAB From: Juan Quintela To: qemu-devel@nongnu.org Date: Tue, 25 Apr 2017 12:30:49 +0200 Message-Id: <20170425103049.4073-4-quintela@redhat.com> In-Reply-To: <20170425103049.4073-1-quintela@redhat.com> References: <20170425103049.4073-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 25 Apr 2017 10:30:57 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 3/3] migration: Remove old MigrationParams X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lvivier@redhat.com, dgilbert@redhat.com, peterx@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Not used anymore after moving block migration to use capabilities. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- include/migration/migration.h | 10 ++-------- include/migration/vmstate.h | 1 - include/qemu/typedefs.h | 1 - include/sysemu/sysemu.h | 3 +-- migration/colo.c | 2 +- migration/migration.c | 8 +++----- migration/savevm.c | 16 +++------------- 7 files changed, 10 insertions(+), 31 deletions(-) diff --git a/include/migration/migration.h b/include/migration/migration.h index 2917baa..3495162 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -41,10 +41,6 @@ /* for vl.c */ extern int only_migratable; =20 -struct MigrationParams { - bool unused; /* C don't allow empty structs */ -}; - /* Messages sent on the return path from destination to source */ enum mig_rp_message_type { MIG_RP_MSG_INVALID =3D 0, /* Must be 0 */ @@ -134,12 +130,10 @@ struct MigrationState QEMUBH *cleanup_bh; QEMUFile *to_dst_file; =20 - /* New style params from 'migrate-set-parameters' */ + /* params from 'migrate-set-parameters' */ MigrationParameters parameters; =20 int state; - /* Old style params from 'migrate' command */ - MigrationParams params; =20 /* State related to return path */ struct { @@ -229,7 +223,7 @@ void migrate_fd_connect(MigrationState *s); =20 void add_migration_state_change_notifier(Notifier *notify); void remove_migration_state_change_notifier(Notifier *notify); -MigrationState *migrate_init(const MigrationParams *params); +MigrationState *migrate_init(void); bool migration_is_blocked(Error **errp); bool migration_in_setup(MigrationState *); bool migration_is_idle(void); diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index 9452dec..4396d7e 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -37,7 +37,6 @@ typedef int LoadStateHandler(QEMUFile *f, void *opaque, i= nt version_id); =20 typedef struct SaveVMHandlers { /* This runs inside the iothread lock. */ - void (*set_params)(const MigrationParams *params, void * opaque); SaveStateHandler *save_state; =20 void (*cleanup)(void *opaque); diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index f08d327..a388243 100644 --- a/include/qemu/typedefs.h +++ b/include/qemu/typedefs.h @@ -49,7 +49,6 @@ typedef struct MemoryRegion MemoryRegion; typedef struct MemoryRegionCache MemoryRegionCache; typedef struct MemoryRegionSection MemoryRegionSection; typedef struct MigrationIncomingState MigrationIncomingState; -typedef struct MigrationParams MigrationParams; typedef struct MigrationState MigrationState; typedef struct Monitor Monitor; typedef struct MonitorDef MonitorDef; diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 058d5eb..3340202 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -102,8 +102,7 @@ enum qemu_vm_cmd { #define MAX_VM_CMD_PACKAGED_SIZE (1ul << 24) =20 bool qemu_savevm_state_blocked(Error **errp); -void qemu_savevm_state_begin(QEMUFile *f, - const MigrationParams *params); +void qemu_savevm_state_begin(QEMUFile *f); void qemu_savevm_state_header(QEMUFile *f); int qemu_savevm_state_iterate(QEMUFile *f, bool postcopy); void qemu_savevm_state_cleanup(void); diff --git a/migration/colo.c b/migration/colo.c index 5c6c2f0..75e8807 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -333,7 +333,7 @@ static int colo_do_checkpoint_transaction(MigrationStat= e *s, } =20 qemu_savevm_state_header(fb); - qemu_savevm_state_begin(fb, &s->params); + qemu_savevm_state_begin(fb); qemu_mutex_lock_iothread(); qemu_savevm_state_complete_precopy(fb, false); qemu_mutex_unlock_iothread(); diff --git a/migration/migration.c b/migration/migration.c index 9b96f1a..f094079 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1102,7 +1102,7 @@ bool migration_is_idle(void) return false; } =20 -MigrationState *migrate_init(const MigrationParams *params) +MigrationState *migrate_init(void) { MigrationState *s =3D migrate_get_current(); =20 @@ -1116,7 +1116,6 @@ MigrationState *migrate_init(const MigrationParams *p= arams) s->cleanup_bh =3D 0; s->to_dst_file =3D NULL; s->state =3D MIGRATION_STATUS_NONE; - s->params =3D *params; s->rp_state.from_dst_file =3D NULL; s->rp_state.error =3D false; s->mbps =3D 0.0; @@ -1215,7 +1214,6 @@ void qmp_migrate(const char *uri, bool has_blk, bool = blk, { Error *local_err =3D NULL; MigrationState *s =3D migrate_get_current(); - MigrationParams params; const char *p; =20 if (migration_is_setup_or_active(s->state) || @@ -1233,7 +1231,7 @@ void qmp_migrate(const char *uri, bool has_blk, bool = blk, return; } =20 - s =3D migrate_init(¶ms); + s =3D migrate_init(); =20 if (has_blk && blk) { migrate_set_block_enabled(s); @@ -1966,7 +1964,7 @@ static void *migration_thread(void *opaque) qemu_savevm_send_postcopy_advise(s->to_dst_file); } =20 - qemu_savevm_state_begin(s->to_dst_file, &s->params); + qemu_savevm_state_begin(s->to_dst_file); =20 s->setup_time =3D qemu_clock_get_ms(QEMU_CLOCK_HOST) - setup_start; migrate_set_state(&s->state, MIGRATION_STATUS_SETUP, diff --git a/migration/savevm.c b/migration/savevm.c index 102b11d..97c6908 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -966,21 +966,13 @@ void qemu_savevm_state_header(QEMUFile *f) =20 } =20 -void qemu_savevm_state_begin(QEMUFile *f, - const MigrationParams *params) +void qemu_savevm_state_begin(QEMUFile *f) { SaveStateEntry *se; int ret; =20 trace_savevm_state_begin(); QTAILQ_FOREACH(se, &savevm_state.handlers, entry) { - if (!se->ops || !se->ops->set_params) { - continue; - } - se->ops->set_params(params, se->opaque); - } - - QTAILQ_FOREACH(se, &savevm_state.handlers, entry) { if (!se->ops || !se->ops->save_live_setup) { continue; } @@ -1232,9 +1224,7 @@ void qemu_savevm_state_cleanup(void) static int qemu_savevm_state(QEMUFile *f, Error **errp) { int ret; - MigrationParams params =3D { - }; - MigrationState *ms =3D migrate_init(¶ms); + MigrationState *ms =3D migrate_init(); MigrationStatus status; ms->to_dst_file =3D f; =20 @@ -1245,7 +1235,7 @@ static int qemu_savevm_state(QEMUFile *f, Error **err= p) =20 qemu_mutex_unlock_iothread(); qemu_savevm_state_header(f); - qemu_savevm_state_begin(f, ¶ms); + qemu_savevm_state_begin(f); qemu_mutex_lock_iothread(); =20 while (qemu_file_get_error(f) =3D=3D 0) { --=20 2.9.3