From nobody Wed Nov 5 15:51:27 2025 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 1496745145479481.87198270987335; Tue, 6 Jun 2017 03:32:25 -0700 (PDT) Received: from localhost ([::1]:37414 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIBme-0007NM-V4 for importer@patchew.org; Tue, 06 Jun 2017 06:32:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58324) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIBlK-0006hA-Di for qemu-devel@nongnu.org; Tue, 06 Jun 2017 06:30:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dIBlI-00061f-SR for qemu-devel@nongnu.org; Tue, 06 Jun 2017 06:30:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57256) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dIBlI-00061Y-JR for qemu-devel@nongnu.org; Tue, 06 Jun 2017 06:30:56 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A06B180B56 for ; Tue, 6 Jun 2017 10:30:55 +0000 (UTC) Received: from pxdev.xzpeter.org.com (ovpn-12-100.pek2.redhat.com [10.72.12.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3CD2958824; Tue, 6 Jun 2017 10:30:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A06B180B56 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=peterx@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com A06B180B56 From: Peter Xu To: qemu-devel@nongnu.org Date: Tue, 6 Jun 2017 18:30:37 +0800 Message-Id: <1496745042-2379-2-git-send-email-peterx@redhat.com> In-Reply-To: <1496745042-2379-1-git-send-email-peterx@redhat.com> References: <1496745042-2379-1-git-send-email-peterx@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 06 Jun 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 1/6] migration: let MigrationState be a qdev 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: Laurent Vivier , peterx@redhat.com, Markus Armbruster , "Dr . David Alan Gilbert" , Juan Quintela 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" Let the old man "MigrationState" join the object family. Direct benefit is that we can start to use all the property features derived from current QDev, like: HW_COMPAT_* bits, command line setup for migration parameters (so will never need to set them up each time using HMP/QMP, this is really, really attractive for test writters), etc. I see no reason to disallow this happen yet. So let's start from this one, to see whether it would be anything good. No functional change at all. Signed-off-by: Peter Xu Reviewed-by: Juan Quintela --- include/migration/migration.h | 19 +++++++++++++++ migration/migration.c | 57 +++++++++++++++++++++++++++++----------= ---- 2 files changed, 58 insertions(+), 18 deletions(-) diff --git a/include/migration/migration.h b/include/migration/migration.h index 79b5484..bd0186c 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -21,6 +21,7 @@ #include "qapi-types.h" #include "exec/cpu-common.h" #include "qemu/coroutine_int.h" +#include "hw/qdev.h" =20 #define QEMU_VM_FILE_MAGIC 0x5145564d #define QEMU_VM_FILE_VERSION_COMPAT 0x00000002 @@ -49,6 +50,8 @@ enum mig_rp_message_type { MIG_RP_MSG_MAX }; =20 +#define TYPE_MIGRATION "migration" + /* State for the incoming migration */ struct MigrationIncomingState { QEMUFile *from_src_file; @@ -91,8 +94,24 @@ struct MigrationIncomingState { MigrationIncomingState *migration_incoming_get_current(void); void migration_incoming_state_destroy(void); =20 +#define MIGRATION_CLASS(klass) \ + OBJECT_CLASS_CHECK(MigrationClass, (klass), TYPE_MIGRATION) +#define MIGRATION_OBJ(obj) \ + OBJECT_CHECK(MigrationState, (obj), TYPE_MIGRATION) +#define MIGRATION_GET_CLASS(obj) \ + OBJECT_GET_CLASS(MigrationClass, (obj), TYPE_MIGRATION) + +typedef struct MigrationClass { + /*< private >*/ + DeviceClass parent_class; +} MigrationClass; + struct MigrationState { + /*< private >*/ + DeviceState parent_obj; + + /*< public >*/ size_t bytes_xfer; size_t xfer_limit; QemuThread thread; diff --git a/migration/migration.c b/migration/migration.c index 48c94c9..483b027 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -94,28 +94,14 @@ static bool deferred_incoming; MigrationState *migrate_get_current(void) { static bool once; - static MigrationState current_migration =3D { - .state =3D MIGRATION_STATUS_NONE, - .xbzrle_cache_size =3D DEFAULT_MIGRATE_CACHE_SIZE, - .mbps =3D -1, - .parameters =3D { - .compress_level =3D DEFAULT_MIGRATE_COMPRESS_LEVEL, - .compress_threads =3D DEFAULT_MIGRATE_COMPRESS_THREAD_COUNT, - .decompress_threads =3D DEFAULT_MIGRATE_DECOMPRESS_THREAD_COUN= T, - .cpu_throttle_initial =3D DEFAULT_MIGRATE_CPU_THROTTLE_INITIAL, - .cpu_throttle_increment =3D DEFAULT_MIGRATE_CPU_THROTTLE_INCRE= MENT, - .max_bandwidth =3D MAX_THROTTLE, - .downtime_limit =3D DEFAULT_MIGRATE_SET_DOWNTIME, - .x_checkpoint_delay =3D DEFAULT_MIGRATE_X_CHECKPOINT_DELAY, - }, - }; + static MigrationState *current_migration; =20 if (!once) { - current_migration.parameters.tls_creds =3D g_strdup(""); - current_migration.parameters.tls_hostname =3D g_strdup(""); + current_migration =3D MIGRATION_OBJ(object_new(TYPE_MIGRATION)); once =3D true; } - return ¤t_migration; + + return current_migration; } =20 MigrationIncomingState *migration_incoming_get_current(void) @@ -2123,3 +2109,38 @@ void migrate_fd_connect(MigrationState *s) s->migration_thread_running =3D true; } =20 +static void migration_instance_init(Object *obj) +{ + MigrationState *ms =3D MIGRATION_OBJ(obj); + + ms->state =3D MIGRATION_STATUS_NONE; + ms->xbzrle_cache_size =3D DEFAULT_MIGRATE_CACHE_SIZE; + ms->mbps =3D -1; + ms->parameters =3D (MigrationParameters) { + .compress_level =3D DEFAULT_MIGRATE_COMPRESS_LEVEL, + .compress_threads =3D DEFAULT_MIGRATE_COMPRESS_THREAD_COUNT, + .decompress_threads =3D DEFAULT_MIGRATE_DECOMPRESS_THREAD_COUNT, + .cpu_throttle_initial =3D DEFAULT_MIGRATE_CPU_THROTTLE_INITIAL, + .cpu_throttle_increment =3D DEFAULT_MIGRATE_CPU_THROTTLE_INCREMENT, + .max_bandwidth =3D MAX_THROTTLE, + .downtime_limit =3D DEFAULT_MIGRATE_SET_DOWNTIME, + .x_checkpoint_delay =3D DEFAULT_MIGRATE_X_CHECKPOINT_DELAY, + }; + ms->parameters.tls_creds =3D g_strdup(""); + ms->parameters.tls_hostname =3D g_strdup(""); +} + +static const TypeInfo migration_type =3D { + .name =3D TYPE_MIGRATION, + .parent =3D TYPE_DEVICE, + .class_size =3D sizeof(MigrationClass), + .instance_size =3D sizeof(MigrationState), + .instance_init =3D migration_instance_init, +}; + +static void register_migration_types(void) +{ + type_register_static(&migration_type); +} + +type_init(register_migration_types); --=20 2.7.4 From nobody Wed Nov 5 15:51:27 2025 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 1496745359327445.3003818241971; Tue, 6 Jun 2017 03:35:59 -0700 (PDT) Received: from localhost ([::1]:37434 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIBq8-0001zR-Qa for importer@patchew.org; Tue, 06 Jun 2017 06:35:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58342) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIBlN-0006hO-2G for qemu-devel@nongnu.org; Tue, 06 Jun 2017 06:31:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dIBlM-00062e-5b for qemu-devel@nongnu.org; Tue, 06 Jun 2017 06:31:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60546) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dIBlL-00062P-Lm for qemu-devel@nongnu.org; Tue, 06 Jun 2017 06:30:59 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 99BC3368E5 for ; Tue, 6 Jun 2017 10:30:58 +0000 (UTC) Received: from pxdev.xzpeter.org.com (ovpn-12-100.pek2.redhat.com [10.72.12.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 35FDB5C888; Tue, 6 Jun 2017 10:30:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 99BC3368E5 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=peterx@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 99BC3368E5 From: Peter Xu To: qemu-devel@nongnu.org Date: Tue, 6 Jun 2017 18:30:38 +0800 Message-Id: <1496745042-2379-3-git-send-email-peterx@redhat.com> In-Reply-To: <1496745042-2379-1-git-send-email-peterx@redhat.com> References: <1496745042-2379-1-git-send-email-peterx@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 06 Jun 2017 10:30:58 +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/6] migration: move global_state.optional out 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: Laurent Vivier , peterx@redhat.com, Markus Armbruster , "Dr . David Alan Gilbert" , Juan Quintela 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" Put it into MigrationState then we can use the properties to specify whether to enable storing global state. Signed-off-by: Peter Xu --- include/migration/migration.h | 6 ++++++ migration/migration.c | 21 +++++++++++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/include/migration/migration.h b/include/migration/migration.h index bd0186c..8aa1ea6 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -162,6 +162,12 @@ struct MigrationState /* Do we have to clean up -b/-i from old migrate parameters */ /* This feature is deprecated and will be removed */ bool must_remove_block_options; + + /* + * Global switch on whether we need to store the global state + * during migration. + */ + bool store_global_state; }; =20 void migrate_set_state(int *state, int old_state, int new_state); diff --git a/migration/migration.c b/migration/migration.c index 483b027..0653f49 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -140,13 +140,13 @@ void migration_incoming_state_destroy(void) =20 =20 typedef struct { - bool optional; uint32_t size; uint8_t runstate[100]; RunState state; bool received; } GlobalState; =20 +/* This is only used if MigrationState.store_global_state is set. */ static GlobalState global_state; =20 int global_state_store(void) @@ -179,7 +179,7 @@ static RunState global_state_get_runstate(void) =20 void global_state_set_optional(void) { - global_state.optional =3D true; + migrate_get_current()->store_global_state =3D false; } =20 static bool global_state_needed(void *opaque) @@ -188,8 +188,7 @@ static bool global_state_needed(void *opaque) char *runstate =3D (char *)s->runstate; =20 /* If it is not optional, it is mandatory */ - - if (s->optional =3D=3D false) { + if (migrate_get_current()->store_global_state) { return true; } =20 @@ -2109,6 +2108,19 @@ void migrate_fd_connect(MigrationState *s) s->migration_thread_running =3D true; } =20 +static Property migration_properties[] =3D { + DEFINE_PROP_BOOL("store-global-state", MigrationState, + store_global_state, true), + DEFINE_PROP_END_OF_LIST(), +}; + +static void migration_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc =3D DEVICE_CLASS(klass); + + dc->props =3D migration_properties; +} + static void migration_instance_init(Object *obj) { MigrationState *ms =3D MIGRATION_OBJ(obj); @@ -2133,6 +2145,7 @@ static void migration_instance_init(Object *obj) static const TypeInfo migration_type =3D { .name =3D TYPE_MIGRATION, .parent =3D TYPE_DEVICE, + .class_init =3D migration_class_init, .class_size =3D sizeof(MigrationClass), .instance_size =3D sizeof(MigrationState), .instance_init =3D migration_instance_init, --=20 2.7.4 From nobody Wed Nov 5 15:51:27 2025 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 1496745162685585.3138013390235; Tue, 6 Jun 2017 03:32:42 -0700 (PDT) Received: from localhost ([::1]:37415 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIBmw-0007b5-6b for importer@patchew.org; Tue, 06 Jun 2017 06:32:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58357) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIBlP-0006j4-ER for qemu-devel@nongnu.org; Tue, 06 Jun 2017 06:31:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dIBlO-00063S-Hb for qemu-devel@nongnu.org; Tue, 06 Jun 2017 06:31:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57494) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dIBlO-00063D-Bq for qemu-devel@nongnu.org; Tue, 06 Jun 2017 06:31:02 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5F30E80F6C for ; Tue, 6 Jun 2017 10:31:01 +0000 (UTC) Received: from pxdev.xzpeter.org.com (ovpn-12-100.pek2.redhat.com [10.72.12.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 20E3E5C3FB; Tue, 6 Jun 2017 10:30:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 5F30E80F6C 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=peterx@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 5F30E80F6C From: Peter Xu To: qemu-devel@nongnu.org Date: Tue, 6 Jun 2017 18:30:39 +0800 Message-Id: <1496745042-2379-4-git-send-email-peterx@redhat.com> In-Reply-To: <1496745042-2379-1-git-send-email-peterx@redhat.com> References: <1496745042-2379-1-git-send-email-peterx@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 06 Jun 2017 10:31:01 +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/6] migration: use compat bit for global_state 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: Laurent Vivier , peterx@redhat.com, Markus Armbruster , "Dr . David Alan Gilbert" , Juan Quintela 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" Removing two callers of global_state_set_optional() since now we can use HW_COMPAT_2_3. However there is still one more caller (xen_init), so we still need to keep the function until it disappears. Signed-off-by: Peter Xu Reviewed-by: Juan Quintela --- hw/i386/pc_piix.c | 1 - hw/ppc/spapr.c | 1 - include/hw/compat.h | 4 ++++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 2234bd0..c83cec5 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -317,7 +317,6 @@ static void pc_compat_2_3(MachineState *machine) if (kvm_enabled()) { pcms->smm =3D ON_OFF_AUTO_OFF; } - global_state_set_optional(); savevm_skip_configuration(); } =20 diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index ab3aab1..3e78bb9 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -3593,7 +3593,6 @@ static void spapr_machine_2_3_instance_options(Machin= eState *machine) { spapr_machine_2_4_instance_options(machine); savevm_skip_section_footers(); - global_state_set_optional(); savevm_skip_configuration(); } =20 diff --git a/include/hw/compat.h b/include/hw/compat.h index 400c64b..5b5c8de 100644 --- a/include/hw/compat.h +++ b/include/hw/compat.h @@ -177,6 +177,10 @@ .driver =3D TYPE_PCI_DEVICE,\ .property =3D "x-pcie-lnksta-dllla",\ .value =3D "off",\ + },{\ + .driver =3D "migration",\ + .property =3D "store-global-state",\ + .value =3D "off",\ }, =20 #define HW_COMPAT_2_2 \ --=20 2.7.4 From nobody Wed Nov 5 15:51:27 2025 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 1496745273799964.9216177111509; Tue, 6 Jun 2017 03:34:33 -0700 (PDT) Received: from localhost ([::1]:37421 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIBom-0000zS-EE for importer@patchew.org; Tue, 06 Jun 2017 06:34:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58400) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIBlZ-0006of-HF for qemu-devel@nongnu.org; Tue, 06 Jun 2017 06:31:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dIBlT-000651-My for qemu-devel@nongnu.org; Tue, 06 Jun 2017 06:31:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57314) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dIBlT-00064m-Er for qemu-devel@nongnu.org; Tue, 06 Jun 2017 06:31:07 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 83ADC80460 for ; Tue, 6 Jun 2017 10:31:06 +0000 (UTC) Received: from pxdev.xzpeter.org.com (ovpn-12-100.pek2.redhat.com [10.72.12.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id E0BE15C3FB; Tue, 6 Jun 2017 10:31:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 83ADC80460 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=peterx@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 83ADC80460 From: Peter Xu To: qemu-devel@nongnu.org Date: Tue, 6 Jun 2017 18:30:40 +0800 Message-Id: <1496745042-2379-5-git-send-email-peterx@redhat.com> In-Reply-To: <1496745042-2379-1-git-send-email-peterx@redhat.com> References: <1496745042-2379-1-git-send-email-peterx@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 06 Jun 2017 10:31:06 +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 4/6] migration: move only_migratable to MigrationState 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: Laurent Vivier , peterx@redhat.com, Markus Armbruster , "Dr . David Alan Gilbert" , Juan Quintela 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" One less global variable, and it does only matter with migration. We keep the old "--only-migratable" option, but also now we support: -global migration.only-migratable=3Dtrue Currently still keep the old interface. Signed-off-by: Peter Xu --- include/migration/migration.h | 3 +++ include/sysemu/sysemu.h | 1 - migration/migration.c | 3 ++- migration/savevm.c | 2 +- vl.c | 9 +++++++-- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/include/migration/migration.h b/include/migration/migration.h index 8aa1ea6..e7d8e32 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -168,6 +168,9 @@ struct MigrationState * during migration. */ bool store_global_state; + + /* Whether the VM is only allowing for migratable devices */ + bool only_migratable; }; =20 void migrate_set_state(int *state, int old_state, int new_state); diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 9841a52..b213696 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -15,7 +15,6 @@ /* vl.c */ =20 extern const char *bios_name; -extern int only_migratable; extern const char *qemu_name; extern QemuUUID qemu_uuid; extern bool qemu_uuid_set; diff --git a/migration/migration.c b/migration/migration.c index 0653f49..3492365 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1120,7 +1120,7 @@ static GSList *migration_blockers; =20 int migrate_add_blocker(Error *reason, Error **errp) { - if (only_migratable) { + if (migrate_get_current()->only_migratable) { error_propagate(errp, error_copy(reason)); error_prepend(errp, "disallowing migration blocker " "(--only_migratable) for: "); @@ -2111,6 +2111,7 @@ void migrate_fd_connect(MigrationState *s) static Property migration_properties[] =3D { DEFINE_PROP_BOOL("store-global-state", MigrationState, store_global_state, true), + DEFINE_PROP_BOOL("only-migratable", MigrationState, only_migratable, f= alse), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/migration/savevm.c b/migration/savevm.c index 9c320f5..f073027 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -2321,7 +2321,7 @@ void vmstate_register_ram_global(MemoryRegion *mr) bool vmstate_check_only_migratable(const VMStateDescription *vmsd) { /* check needed if --only-migratable is specified */ - if (!only_migratable) { + if (!migrate_get_current()->only_migratable) { return true; } =20 diff --git a/vl.c b/vl.c index be4dcf2..e842eef 100644 --- a/vl.c +++ b/vl.c @@ -188,7 +188,6 @@ bool boot_strict; uint8_t *boot_splash_filedata; size_t boot_splash_filedata_size; uint8_t qemu_extra_params_fw[2]; -int only_migratable; /* turn it off unless user states otherwise */ =20 int icount_align_option; =20 @@ -3937,7 +3936,13 @@ int main(int argc, char **argv, char **envp) incoming =3D optarg; break; case QEMU_OPTION_only_migratable: - only_migratable =3D 1; + /* + * TODO: we can remove this option one day, and we + * should all use: + * + * "-global migration.only-migratable=3Dtrue" + */ + migrate_get_current()->only_migratable =3D true; break; case QEMU_OPTION_nodefaults: has_defaults =3D 0; --=20 2.7.4 From nobody Wed Nov 5 15:51:27 2025 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 1496745442122968.0805308723022; Tue, 6 Jun 2017 03:37:22 -0700 (PDT) Received: from localhost ([::1]:37441 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIBrS-0002pe-Mg for importer@patchew.org; Tue, 06 Jun 2017 06:37:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58418) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIBlc-0006qb-Qs for qemu-devel@nongnu.org; Tue, 06 Jun 2017 06:31:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dIBlZ-00066T-HX for qemu-devel@nongnu.org; Tue, 06 Jun 2017 06:31:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50442) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dIBlZ-00066F-9E for qemu-devel@nongnu.org; Tue, 06 Jun 2017 06:31:13 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 54539142A6F for ; Tue, 6 Jun 2017 10:31:12 +0000 (UTC) Received: from pxdev.xzpeter.org.com (ovpn-12-100.pek2.redhat.com [10.72.12.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0B92D5C888; Tue, 6 Jun 2017 10:31:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 54539142A6F 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=peterx@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 54539142A6F From: Peter Xu To: qemu-devel@nongnu.org Date: Tue, 6 Jun 2017 18:30:41 +0800 Message-Id: <1496745042-2379-6-git-send-email-peterx@redhat.com> In-Reply-To: <1496745042-2379-1-git-send-email-peterx@redhat.com> References: <1496745042-2379-1-git-send-email-peterx@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 06 Jun 2017 10:31:12 +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 5/6] migration: move skip_configuration out 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: Laurent Vivier , peterx@redhat.com, Markus Armbruster , "Dr . David Alan Gilbert" , Juan Quintela 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" It was in SaveState but now moved to MigrationState altogether. Again, using HW_COMPAT_2_3 for old PC/SPAPR machines but still we'll have to keep savevm_skip_configuration() since used by xen_init(). Signed-off-by: Peter Xu Reviewed-by: Juan Quintela --- hw/i386/pc_piix.c | 1 - hw/ppc/spapr.c | 1 - include/hw/compat.h | 4 ++++ include/migration/migration.h | 3 +++ migration/migration.c | 2 ++ migration/savevm.c | 12 +++++------- 6 files changed, 14 insertions(+), 9 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index c83cec5..529018d 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -317,7 +317,6 @@ static void pc_compat_2_3(MachineState *machine) if (kvm_enabled()) { pcms->smm =3D ON_OFF_AUTO_OFF; } - savevm_skip_configuration(); } =20 static void pc_compat_2_2(MachineState *machine) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 3e78bb9..227b03b 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -3593,7 +3593,6 @@ static void spapr_machine_2_3_instance_options(Machin= eState *machine) { spapr_machine_2_4_instance_options(machine); savevm_skip_section_footers(); - savevm_skip_configuration(); } =20 static void spapr_machine_2_3_class_options(MachineClass *mc) diff --git a/include/hw/compat.h b/include/hw/compat.h index 5b5c8de..4ed2ae7 100644 --- a/include/hw/compat.h +++ b/include/hw/compat.h @@ -179,6 +179,10 @@ .value =3D "off",\ },{\ .driver =3D "migration",\ + .property =3D "skip-configuration",\ + .value =3D "on",\ + },{\ + .driver =3D "migration",\ .property =3D "store-global-state",\ .value =3D "off",\ }, diff --git a/include/migration/migration.h b/include/migration/migration.h index e7d8e32..2d8c9f5 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -171,6 +171,9 @@ struct MigrationState =20 /* Whether the VM is only allowing for migratable devices */ bool only_migratable; + + /* Whether we skip QEMU_VM_CONFIGURATION for migration */ + bool skip_configuration; }; =20 void migrate_set_state(int *state, int old_state, int new_state); diff --git a/migration/migration.c b/migration/migration.c index 3492365..5d93d06 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2112,6 +2112,8 @@ static Property migration_properties[] =3D { DEFINE_PROP_BOOL("store-global-state", MigrationState, store_global_state, true), DEFINE_PROP_BOOL("only-migratable", MigrationState, only_migratable, f= alse), + DEFINE_PROP_BOOL("skip-configuration", MigrationState, + skip_configuration, false), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/migration/savevm.c b/migration/savevm.c index f073027..e7c18a4 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -290,7 +290,6 @@ typedef struct SaveStateEntry { typedef struct SaveState { QTAILQ_HEAD(, SaveStateEntry) handlers; int global_section_id; - bool skip_configuration; uint32_t len; const char *name; uint32_t target_page_bits; @@ -299,15 +298,13 @@ typedef struct SaveState { static SaveState savevm_state =3D { .handlers =3D QTAILQ_HEAD_INITIALIZER(savevm_state.handlers), .global_section_id =3D 0, - .skip_configuration =3D false, }; =20 void savevm_skip_configuration(void) { - savevm_state.skip_configuration =3D true; + migrate_get_current()->skip_configuration =3D true; } =20 - static void configuration_pre_save(void *opaque) { SaveState *state =3D opaque; @@ -989,11 +986,11 @@ void qemu_savevm_state_header(QEMUFile *f) qemu_put_be32(f, QEMU_VM_FILE_MAGIC); qemu_put_be32(f, QEMU_VM_FILE_VERSION); =20 - if (!savevm_state.skip_configuration || enforce_config_section()) { + if (!migrate_get_current()->skip_configuration || + enforce_config_section()) { qemu_put_byte(f, QEMU_VM_CONFIGURATION); vmstate_save_state(f, &vmstate_configuration, &savevm_state, 0); } - } =20 void qemu_savevm_state_begin(QEMUFile *f) @@ -2003,7 +2000,8 @@ int qemu_loadvm_state(QEMUFile *f) return -ENOTSUP; } =20 - if (!savevm_state.skip_configuration || enforce_config_section()) { + if (!migrate_get_current()->skip_configuration || + enforce_config_section()) { if (qemu_get_byte(f) !=3D QEMU_VM_CONFIGURATION) { error_report("Configuration section missing"); return -EINVAL; --=20 2.7.4 From nobody Wed Nov 5 15:51:27 2025 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 1496745175304586.4328102626823; Tue, 6 Jun 2017 03:32:55 -0700 (PDT) Received: from localhost ([::1]:37416 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIBnA-0007ka-Lg for importer@patchew.org; Tue, 06 Jun 2017 06:32:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58427) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIBld-0006r8-HJ for qemu-devel@nongnu.org; Tue, 06 Jun 2017 06:31:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dIBlc-00067D-H6 for qemu-devel@nongnu.org; Tue, 06 Jun 2017 06:31:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38190) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dIBlc-000673-9U for qemu-devel@nongnu.org; Tue, 06 Jun 2017 06:31:16 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 57FA24E4D0 for ; Tue, 6 Jun 2017 10:31:15 +0000 (UTC) Received: from pxdev.xzpeter.org.com (ovpn-12-100.pek2.redhat.com [10.72.12.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id DE58958824; Tue, 6 Jun 2017 10:31:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 57FA24E4D0 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=peterx@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 57FA24E4D0 From: Peter Xu To: qemu-devel@nongnu.org Date: Tue, 6 Jun 2017 18:30:42 +0800 Message-Id: <1496745042-2379-7-git-send-email-peterx@redhat.com> In-Reply-To: <1496745042-2379-1-git-send-email-peterx@redhat.com> References: <1496745042-2379-1-git-send-email-peterx@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 06 Jun 2017 10:31:15 +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 6/6] migration: move skip_section_footers 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: Laurent Vivier , peterx@redhat.com, Markus Armbruster , "Dr . David Alan Gilbert" , Juan Quintela 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" Move it into MigrationState, with a property binded to it. Same trick played with HW_COMPAT_2_3. Signed-off-by: Peter Xu Reviewed-by: Juan Quintela --- hw/i386/pc_piix.c | 1 - hw/ppc/spapr.c | 1 - include/hw/compat.h | 4 ++++ include/migration/migration.h | 2 ++ migration/migration.c | 2 ++ migration/savevm.c | 8 +++----- 6 files changed, 11 insertions(+), 7 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 529018d..1be23e2 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -313,7 +313,6 @@ static void pc_init1(MachineState *machine, static void pc_compat_2_3(MachineState *machine) { PCMachineState *pcms =3D PC_MACHINE(machine); - savevm_skip_section_footers(); if (kvm_enabled()) { pcms->smm =3D ON_OFF_AUTO_OFF; } diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 227b03b..944f829 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -3592,7 +3592,6 @@ DEFINE_SPAPR_MACHINE(2_4, "2.4", false); static void spapr_machine_2_3_instance_options(MachineState *machine) { spapr_machine_2_4_instance_options(machine); - savevm_skip_section_footers(); } =20 static void spapr_machine_2_3_class_options(MachineClass *mc) diff --git a/include/hw/compat.h b/include/hw/compat.h index 4ed2ae7..ef5fbc7 100644 --- a/include/hw/compat.h +++ b/include/hw/compat.h @@ -183,6 +183,10 @@ .value =3D "on",\ },{\ .driver =3D "migration",\ + .property =3D "skip-section-footer",\ + .value =3D "on",\ + },{\ + .driver =3D "migration",\ .property =3D "store-global-state",\ .value =3D "off",\ }, diff --git a/include/migration/migration.h b/include/migration/migration.h index 2d8c9f5..6bdaa97 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -174,6 +174,8 @@ struct MigrationState =20 /* Whether we skip QEMU_VM_CONFIGURATION for migration */ bool skip_configuration; + /* Whether we skip section footer */ + bool skip_section_footer; }; =20 void migrate_set_state(int *state, int old_state, int new_state); diff --git a/migration/migration.c b/migration/migration.c index 5d93d06..e0e0970 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2114,6 +2114,8 @@ static Property migration_properties[] =3D { DEFINE_PROP_BOOL("only-migratable", MigrationState, only_migratable, f= alse), DEFINE_PROP_BOOL("skip-configuration", MigrationState, skip_configuration, false), + DEFINE_PROP_BOOL("skip-section-footer", MigrationState, + skip_section_footer, false), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/migration/savevm.c b/migration/savevm.c index e7c18a4..9f56d03 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -65,8 +65,6 @@ =20 const unsigned int postcopy_ram_discard_version =3D 0; =20 -static bool skip_section_footers; - /* Subcommands for QEMU_VM_COMMAND */ enum qemu_vm_cmd { MIG_CMD_INVALID =3D 0, /* Must be 0 */ @@ -787,7 +785,7 @@ static void vmstate_save(QEMUFile *f, SaveStateEntry *s= e, QJSON *vmdesc) =20 void savevm_skip_section_footers(void) { - skip_section_footers =3D true; + migrate_get_current()->skip_section_footer =3D true; } =20 /* @@ -817,7 +815,7 @@ static void save_section_header(QEMUFile *f, SaveStateE= ntry *se, */ static void save_section_footer(QEMUFile *f, SaveStateEntry *se) { - if (!skip_section_footers) { + if (!migrate_get_current()->skip_section_footer) { qemu_put_byte(f, QEMU_VM_SECTION_FOOTER); qemu_put_be32(f, se->section_id); } @@ -1815,7 +1813,7 @@ static bool check_section_footer(QEMUFile *f, SaveSta= teEntry *se) uint8_t read_mark; uint32_t read_section_id; =20 - if (skip_section_footers) { + if (migrate_get_current()->skip_section_footer) { /* No footer to check */ return true; } --=20 2.7.4