From nobody Wed Nov 5 06:44:48 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.zohomail.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 14997068567931014.3623829527871; Mon, 10 Jul 2017 10:14:16 -0700 (PDT) Received: from localhost ([::1]:42182 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUcGF-0007bQ-Eo for importer@patchew.org; Mon, 10 Jul 2017 13:14:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35567) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUcCv-0004oN-Uo for qemu-devel@nongnu.org; Mon, 10 Jul 2017 13:10:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dUcCt-0008GT-CE for qemu-devel@nongnu.org; Mon, 10 Jul 2017 13:10:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41486) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dUcCt-0008GA-5r for qemu-devel@nongnu.org; Mon, 10 Jul 2017 13:10:47 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 235F915D9 for ; Mon, 10 Jul 2017 17:10:46 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-116-231.ams2.redhat.com [10.36.116.231]) by smtp.corp.redhat.com (Postfix) with ESMTP id CFEF517174; Mon, 10 Jul 2017 17:10:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 235F915D9 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dgilbert@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 235F915D9 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org Date: Mon, 10 Jul 2017 18:10:32 +0100 Message-Id: <20170710171040.21021-2-dgilbert@redhat.com> In-Reply-To: <20170710171040.21021-1-dgilbert@redhat.com> References: <20170710171040.21021-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 10 Jul 2017 17:10:46 +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] [PULL 1/9] migration: fix handling for --only-migratable 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, peterx@redhat.com, quintela@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" From: Peter Xu MigrateState object is not ready at that time, so we'll get an assertion. Use qemu_global_option() instead. Reported-by: Eduardo Habkost Suggested-by: Eduardo Habkost Reviewed-by: Eduardo Habkost Reviewed-by: Juan Quintela Fixes: 3df663e ("migration: move only_migratable to MigrationState") Signed-off-by: Peter Xu Message-Id: <1499242883-2184-2-git-send-email-peterx@redhat.com> Signed-off-by: Dr. David Alan Gilbert --- include/migration/misc.h | 1 - migration/migration.c | 5 ----- vl.c | 2 +- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/include/migration/misc.h b/include/migration/misc.h index 22551216bb..c079b7771b 100644 --- a/include/migration/misc.h +++ b/include/migration/misc.h @@ -53,7 +53,6 @@ bool migration_has_finished(MigrationState *); bool migration_has_failed(MigrationState *); /* ...and after the device transmission */ bool migration_in_postcopy_after_devices(MigrationState *); -void migration_only_migratable_set(void); void migration_global_dump(Monitor *mon); =20 #endif diff --git a/migration/migration.c b/migration/migration.c index 51ccd1a4c5..dbdc121838 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -128,11 +128,6 @@ MigrationState *migrate_get_current(void) return current_migration; } =20 -void migration_only_migratable_set(void) -{ - migrate_get_current()->only_migratable =3D true; -} - MigrationIncomingState *migration_incoming_get_current(void) { static bool once; diff --git a/vl.c b/vl.c index d17c863409..7a015eccc6 100644 --- a/vl.c +++ b/vl.c @@ -3962,7 +3962,7 @@ int main(int argc, char **argv, char **envp) * * "-global migration.only-migratable=3Dtrue" */ - migration_only_migratable_set(); + qemu_global_option("migration.only-migratable=3Dtrue"); break; case QEMU_OPTION_nodefaults: has_defaults =3D 0; --=20 2.13.0 From nobody Wed Nov 5 06:44:48 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.zohomail.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 149970675800364.7712492909269; Mon, 10 Jul 2017 10:12:38 -0700 (PDT) Received: from localhost ([::1]:42173 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUcEZ-0005xc-FR for importer@patchew.org; Mon, 10 Jul 2017 13:12:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35577) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUcCw-0004oY-79 for qemu-devel@nongnu.org; Mon, 10 Jul 2017 13:10:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dUcCu-0008Hs-QK for qemu-devel@nongnu.org; Mon, 10 Jul 2017 13:10:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40924) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dUcCu-0008Gy-KZ for qemu-devel@nongnu.org; Mon, 10 Jul 2017 13:10:48 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AA4373D944 for ; Mon, 10 Jul 2017 17:10:47 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-116-231.ams2.redhat.com [10.36.116.231]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5DB5217B70; Mon, 10 Jul 2017 17:10:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com AA4373D944 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=dgilbert@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com AA4373D944 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org Date: Mon, 10 Jul 2017 18:10:33 +0100 Message-Id: <20170710171040.21021-3-dgilbert@redhat.com> In-Reply-To: <20170710171040.21021-1-dgilbert@redhat.com> References: <20170710171040.21021-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 10 Jul 2017 17:10:47 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL 2/9] vl: move global property, migrate init earlier 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, peterx@redhat.com, quintela@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Peter Xu Currently drive_init_func() may call migrate_get_current() while the migrate object is still not ready yet at that time. Move the migration object init earlier, along with the global properties, right after acceleration init. This fixes a breakage for iotest 055, which caused an assertion failure. Reported-by: Max Reitz Reported-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Eduardo Habkost Tested-by: QingFeng Hao Fixes: 3df663 ("migration: move only_migratable to MigrationState") Signed-off-by: Peter Xu Message-Id: <1499242883-2184-3-git-send-email-peterx@redhat.com> Signed-off-by: Dr. David Alan Gilbert --- vl.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/vl.c b/vl.c index 7a015eccc6..f7560de622 100644 --- a/vl.c +++ b/vl.c @@ -4418,6 +4418,18 @@ int main(int argc, char **argv, char **envp) =20 configure_accelerator(current_machine); =20 + /* + * Register all the global properties, including accel properties, + * machine properties, and user-specified ones. + */ + register_global_properties(current_machine); + + /* + * Migration object can only be created after global properties + * are applied correctly. + */ + migration_object_init(); + if (qtest_chrdev) { qtest_init(qtest_chrdev, qtest_log, &error_fatal); } @@ -4601,18 +4613,6 @@ int main(int argc, char **argv, char **envp) exit (i =3D=3D 1 ? 1 : 0); } =20 - /* - * Register all the global properties, including accel properties, - * machine properties, and user-specified ones. - */ - register_global_properties(current_machine); - - /* - * Migration object can only be created after global properties - * are applied correctly. - */ - migration_object_init(); - /* This checkpoint is required by replay to separate prior clock reading from the other reads, because timer polling functions query clock values from the log. */ --=20 2.13.0 From nobody Wed Nov 5 06:44:48 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.zohomail.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 1499706902219548.0521492365579; Mon, 10 Jul 2017 10:15:02 -0700 (PDT) Received: from localhost ([::1]:42185 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUcGx-0008TQ-TT for importer@patchew.org; Mon, 10 Jul 2017 13:14:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35598) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUcCx-0004p8-6B for qemu-devel@nongnu.org; Mon, 10 Jul 2017 13:10:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dUcCw-0008KK-7l for qemu-devel@nongnu.org; Mon, 10 Jul 2017 13:10:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:65143) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dUcCw-0008JF-1i for qemu-devel@nongnu.org; Mon, 10 Jul 2017 13:10:50 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1ED0A7F40C for ; Mon, 10 Jul 2017 17:10:49 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-116-231.ams2.redhat.com [10.36.116.231]) by smtp.corp.redhat.com (Postfix) with ESMTP id F3FFF1834A; Mon, 10 Jul 2017 17:10:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1ED0A7F40C Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dgilbert@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 1ED0A7F40C From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org Date: Mon, 10 Jul 2017 18:10:34 +0100 Message-Id: <20170710171040.21021-4-dgilbert@redhat.com> In-Reply-To: <20170710171040.21021-1-dgilbert@redhat.com> References: <20170710171040.21021-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 10 Jul 2017 17:10:49 +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] [PULL 3/9] doc: add item for "-M enforce-config-section" 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, peterx@redhat.com, quintela@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" From: Peter Xu It's never documented, and now we have one more parameter for it (which obsoletes this one). Document it properly. Suggested-by: Eduardo Habkost Signed-off-by: Peter Xu Message-Id: <1499396048-21657-1-git-send-email-peterx@redhat.com> Reviewed-by: Greg Kurz Reviewed-by: Eduardo Habkost Signed-off-by: Dr. David Alan Gilbert Removed 'Although now' commit message as per Eduardo's review --- qemu-options.hx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/qemu-options.hx b/qemu-options.hx index ddab656eb3..76b1c67737 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -85,6 +85,12 @@ Enables or disables NVDIMM support. The default is off. @item s390-squash-mcss=3Don|off Enables or disables squashing subchannels into the default css. The default is off. +@item enforce-config-section=3Don|off +If @option{enforce-config-section} is set to @var{on}, force migration +code to send configuration section even if the machine-type sets the +@option{migration.send-configuration} property to @var{off}. +NOTE: this parameter is deprecated. Please use @option{-global} +@option{migration.send-configuration}=3D@var{on|off} instead. @end table ETEXI =20 --=20 2.13.0 From nobody Wed Nov 5 06:44:48 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.zohomail.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 1499706899434421.1630022798204; Mon, 10 Jul 2017 10:14:59 -0700 (PDT) Received: from localhost ([::1]:42184 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUcGv-0008Mi-5D for importer@patchew.org; Mon, 10 Jul 2017 13:14:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35613) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUcCy-0004py-AP for qemu-devel@nongnu.org; Mon, 10 Jul 2017 13:10:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dUcCx-0008Kn-Fv for qemu-devel@nongnu.org; Mon, 10 Jul 2017 13:10:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57694) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dUcCx-0008KV-9s for qemu-devel@nongnu.org; Mon, 10 Jul 2017 13:10:51 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 621D37F3EB for ; Mon, 10 Jul 2017 17:10:50 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-116-231.ams2.redhat.com [10.36.116.231]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4F41062930; Mon, 10 Jul 2017 17:10:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 621D37F3EB Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dgilbert@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 621D37F3EB From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org Date: Mon, 10 Jul 2017 18:10:35 +0100 Message-Id: <20170710171040.21021-5-dgilbert@redhat.com> In-Reply-To: <20170710171040.21021-1-dgilbert@redhat.com> References: <20170710171040.21021-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 10 Jul 2017 17:10:50 +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] [PULL 4/9] doc: update TYPE_MIGRATION documents 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, peterx@redhat.com, quintela@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" From: Peter Xu [Peter collected Eduardo's patch comment and formatted into patch] Suggested-by: Eduardo Habkost Signed-off-by: Peter Xu Message-Id: <1499242883-2184-5-git-send-email-peterx@redhat.com> Reviewed-by: Eduardo Habkost Signed-off-by: Dr. David Alan Gilbert --- migration/migration.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index dbdc121838..31d46d1343 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2052,12 +2052,12 @@ static void migration_instance_init(Object *obj) static const TypeInfo migration_type =3D { .name =3D TYPE_MIGRATION, /* - * NOTE: "migration" itself is not really a device. We used - * TYPE_DEVICE here only to leverage some existing QDev features - * like "-global" properties, and HW_COMPAT_* fields (which are - * finally applied as global properties as well). If one day the - * global property feature can be migrated from QDev to QObject in - * general, then we can switch to QObject as well. + * NOTE: TYPE_MIGRATION is not really a device, as the object is + * not created using qdev_create(), it is not attached to the qdev + * device tree, and it is never realized. + * + * TODO: Make this TYPE_OBJECT once QOM provides something like + * TYPE_DEVICE's "-global" properties. */ .parent =3D TYPE_DEVICE, .class_init =3D migration_class_init, --=20 2.13.0 From nobody Wed Nov 5 06:44:48 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.zohomail.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 1499707029845322.42028885704053; Mon, 10 Jul 2017 10:17:09 -0700 (PDT) Received: from localhost ([::1]:42202 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUcJ1-0001ka-EM for importer@patchew.org; Mon, 10 Jul 2017 13:17:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35644) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUcD0-0004rb-8s for qemu-devel@nongnu.org; Mon, 10 Jul 2017 13:10:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dUcCy-0008Le-U6 for qemu-devel@nongnu.org; Mon, 10 Jul 2017 13:10:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51072) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dUcCy-0008L5-K9 for qemu-devel@nongnu.org; Mon, 10 Jul 2017 13:10:52 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AE53C8A003 for ; Mon, 10 Jul 2017 17:10:51 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-116-231.ams2.redhat.com [10.36.116.231]) by smtp.corp.redhat.com (Postfix) with ESMTP id A098E5D6A6; Mon, 10 Jul 2017 17:10:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com AE53C8A003 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dgilbert@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com AE53C8A003 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org Date: Mon, 10 Jul 2017 18:10:36 +0100 Message-Id: <20170710171040.21021-6-dgilbert@redhat.com> In-Reply-To: <20170710171040.21021-1-dgilbert@redhat.com> References: <20170710171040.21021-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 10 Jul 2017 17:10:51 +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] [PULL 5/9] migration: Rename save_live_setup() to save_setup() 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, peterx@redhat.com, quintela@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" From: Juan Quintela We are going to use it now for more than save live regions. Once there rename qemu_savevm_state_begin() to qemu_savevm_state_setup(). Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Message-Id: <20170628095228.4661-2-quintela@redhat.com> Signed-off-by: Dr. David Alan Gilbert --- hw/ppc/spapr.c | 2 +- include/migration/register.h | 2 +- migration/block.c | 2 +- migration/colo.c | 2 +- migration/migration.c | 2 +- migration/ram.c | 2 +- migration/savevm.c | 12 ++++++------ migration/savevm.h | 2 +- migration/trace-events | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 0ee9fac50b..ba87be5d48 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1953,7 +1953,7 @@ static void htab_cleanup(void *opaque) } =20 static SaveVMHandlers savevm_htab_handlers =3D { - .save_live_setup =3D htab_save_setup, + .save_setup =3D htab_save_setup, .save_live_iterate =3D htab_save_iterate, .save_live_complete_precopy =3D htab_save_complete, .cleanup =3D htab_cleanup, diff --git a/include/migration/register.h b/include/migration/register.h index d9498d95eb..f607769e83 100644 --- a/include/migration/register.h +++ b/include/migration/register.h @@ -33,7 +33,7 @@ typedef struct SaveVMHandlers { int (*save_live_iterate)(QEMUFile *f, void *opaque); =20 /* This runs outside the iothread lock! */ - int (*save_live_setup)(QEMUFile *f, void *opaque); + int (*save_setup)(QEMUFile *f, void *opaque); void (*save_live_pending)(QEMUFile *f, void *opaque, uint64_t threshold_size, uint64_t *non_postcopiable_pending, diff --git a/migration/block.c b/migration/block.c index 86c0b96cd1..7a7e83a268 100644 --- a/migration/block.c +++ b/migration/block.c @@ -1008,7 +1008,7 @@ static bool block_is_active(void *opaque) } =20 static SaveVMHandlers savevm_block_handlers =3D { - .save_live_setup =3D block_save_setup, + .save_setup =3D block_save_setup, .save_live_iterate =3D block_save_iterate, .save_live_complete_precopy =3D block_save_complete, .save_live_pending =3D block_save_pending, diff --git a/migration/colo.c b/migration/colo.c index c4ba4c328b..ef35f00c9a 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -350,7 +350,7 @@ static int colo_do_checkpoint_transaction(MigrationStat= e *s, /* Disable block migration */ migrate_set_block_enabled(false, &local_err); qemu_savevm_state_header(fb); - qemu_savevm_state_begin(fb); + qemu_savevm_state_setup(fb); qemu_mutex_lock_iothread(); qemu_savevm_state_complete_precopy(fb, false, false); qemu_mutex_unlock_iothread(); diff --git a/migration/migration.c b/migration/migration.c index 31d46d1343..beea01ce63 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1835,7 +1835,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); + qemu_savevm_state_setup(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/ram.c b/migration/ram.c index 0baa1e0d56..480248a00f 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -2623,7 +2623,7 @@ static int ram_load(QEMUFile *f, void *opaque, int ve= rsion_id) } =20 static SaveVMHandlers savevm_ram_handlers =3D { - .save_live_setup =3D ram_save_setup, + .save_setup =3D ram_save_setup, .save_live_iterate =3D ram_save_iterate, .save_live_complete_postcopy =3D ram_save_complete, .save_live_complete_precopy =3D ram_save_complete, diff --git a/migration/savevm.c b/migration/savevm.c index be3f885119..66f816040e 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -596,7 +596,7 @@ int register_savevm_live(DeviceState *dev, se->opaque =3D opaque; se->vmsd =3D NULL; /* if this is a live_savem then set is_ram */ - if (ops->save_live_setup !=3D NULL) { + if (ops->save_setup !=3D NULL) { se->is_ram =3D 1; } =20 @@ -955,14 +955,14 @@ void qemu_savevm_state_header(QEMUFile *f) } } =20 -void qemu_savevm_state_begin(QEMUFile *f) +void qemu_savevm_state_setup(QEMUFile *f) { SaveStateEntry *se; int ret; =20 - trace_savevm_state_begin(); + trace_savevm_state_setup(); QTAILQ_FOREACH(se, &savevm_state.handlers, entry) { - if (!se->ops || !se->ops->save_live_setup) { + if (!se->ops || !se->ops->save_setup) { continue; } if (se->ops && se->ops->is_active) { @@ -972,7 +972,7 @@ void qemu_savevm_state_begin(QEMUFile *f) } save_section_header(f, se, QEMU_VM_SECTION_START); =20 - ret =3D se->ops->save_live_setup(f, se->opaque); + ret =3D se->ops->save_setup(f, se->opaque); save_section_footer(f, se); if (ret < 0) { qemu_file_set_error(f, ret); @@ -1241,7 +1241,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); + qemu_savevm_state_setup(f); qemu_mutex_lock_iothread(); =20 while (qemu_file_get_error(f) =3D=3D 0) { diff --git a/migration/savevm.h b/migration/savevm.h index 5a2ed1161d..6babc6221a 100644 --- a/migration/savevm.h +++ b/migration/savevm.h @@ -30,7 +30,7 @@ #define QEMU_VM_SECTION_FOOTER 0x7e =20 bool qemu_savevm_state_blocked(Error **errp); -void qemu_savevm_state_begin(QEMUFile *f); +void qemu_savevm_state_setup(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/trace-events b/migration/trace-events index 38345be9c3..9669e94ddc 100644 --- a/migration/trace-events +++ b/migration/trace-events @@ -32,7 +32,7 @@ savevm_send_open_return_path(void) "" savevm_send_ping(uint32_t val) "%x" savevm_send_postcopy_listen(void) "" savevm_send_postcopy_run(void) "" -savevm_state_begin(void) "" +savevm_state_setup(void) "" savevm_state_header(void) "" savevm_state_iterate(void) "" savevm_state_cleanup(void) "" --=20 2.13.0 From nobody Wed Nov 5 06:44:48 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.zohomail.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 1499706762765845.5486633920286; Mon, 10 Jul 2017 10:12:42 -0700 (PDT) Received: from localhost ([::1]:42174 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUcEi-00064l-Dp for importer@patchew.org; Mon, 10 Jul 2017 13:12:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35668) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUcD1-0004su-Rq for qemu-devel@nongnu.org; Mon, 10 Jul 2017 13:10:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dUcD0-0008Ni-M8 for qemu-devel@nongnu.org; Mon, 10 Jul 2017 13:10:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56018) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dUcD0-0008MC-DP for qemu-devel@nongnu.org; Mon, 10 Jul 2017 13:10:54 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 61AA6624A4 for ; Mon, 10 Jul 2017 17:10:53 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-116-231.ams2.redhat.com [10.36.116.231]) by smtp.corp.redhat.com (Postfix) with ESMTP id F05E8627DF; Mon, 10 Jul 2017 17:10:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 61AA6624A4 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=dgilbert@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 61AA6624A4 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org Date: Mon, 10 Jul 2017 18:10:37 +0100 Message-Id: <20170710171040.21021-7-dgilbert@redhat.com> In-Reply-To: <20170710171040.21021-1-dgilbert@redhat.com> References: <20170710171040.21021-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 10 Jul 2017 17:10:53 +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] [PULL 6/9] migration: Rename cleanup() to save_cleanup() 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, peterx@redhat.com, quintela@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" From: Juan Quintela We need a cleanup for loads, so we rename here to be consistent. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert -- Rename htab_cleanup to htap_save_cleanup as dave suggestion Message-Id: <20170628095228.4661-3-quintela@redhat.com> Signed-off-by: Dr. David Alan Gilbert --- hw/ppc/spapr.c | 4 ++-- include/migration/register.h | 2 +- migration/block.c | 2 +- migration/ram.c | 2 +- migration/savevm.c | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index ba87be5d48..990772b633 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1945,7 +1945,7 @@ static int htab_load(QEMUFile *f, void *opaque, int v= ersion_id) return 0; } =20 -static void htab_cleanup(void *opaque) +static void htab_save_cleanup(void *opaque) { sPAPRMachineState *spapr =3D opaque; =20 @@ -1956,7 +1956,7 @@ static SaveVMHandlers savevm_htab_handlers =3D { .save_setup =3D htab_save_setup, .save_live_iterate =3D htab_save_iterate, .save_live_complete_precopy =3D htab_save_complete, - .cleanup =3D htab_cleanup, + .save_cleanup =3D htab_save_cleanup, .load_state =3D htab_load, }; =20 diff --git a/include/migration/register.h b/include/migration/register.h index f607769e83..938ea2bc3d 100644 --- a/include/migration/register.h +++ b/include/migration/register.h @@ -18,7 +18,7 @@ typedef struct SaveVMHandlers { /* This runs inside the iothread lock. */ SaveStateHandler *save_state; =20 - void (*cleanup)(void *opaque); + void (*save_cleanup)(void *opaque); int (*save_live_complete_postcopy)(QEMUFile *f, void *opaque); int (*save_live_complete_precopy)(QEMUFile *f, void *opaque); =20 diff --git a/migration/block.c b/migration/block.c index 7a7e83a268..9171f60028 100644 --- a/migration/block.c +++ b/migration/block.c @@ -1013,7 +1013,7 @@ static SaveVMHandlers savevm_block_handlers =3D { .save_live_complete_precopy =3D block_save_complete, .save_live_pending =3D block_save_pending, .load_state =3D block_load, - .cleanup =3D block_migration_cleanup, + .save_cleanup =3D block_migration_cleanup, .is_active =3D block_is_active, }; =20 diff --git a/migration/ram.c b/migration/ram.c index 480248a00f..649f76cb52 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -2629,7 +2629,7 @@ static SaveVMHandlers savevm_ram_handlers =3D { .save_live_complete_precopy =3D ram_save_complete, .save_live_pending =3D ram_save_pending, .load_state =3D ram_load, - .cleanup =3D ram_migration_cleanup, + .save_cleanup =3D ram_migration_cleanup, }; =20 void ram_mig_init(void) diff --git a/migration/savevm.c b/migration/savevm.c index 66f816040e..fee11c5d28 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1215,8 +1215,8 @@ void qemu_savevm_state_cleanup(void) =20 trace_savevm_state_cleanup(); QTAILQ_FOREACH(se, &savevm_state.handlers, entry) { - if (se->ops && se->ops->cleanup) { - se->ops->cleanup(se->opaque); + if (se->ops && se->ops->save_cleanup) { + se->ops->save_cleanup(se->opaque); } } } --=20 2.13.0 From nobody Wed Nov 5 06:44:48 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.zohomail.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 1499706912354855.8805845450472; Mon, 10 Jul 2017 10:15:12 -0700 (PDT) Received: from localhost ([::1]:42187 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUcH7-0000AQ-3y for importer@patchew.org; Mon, 10 Jul 2017 13:15:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35707) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUcD6-0004wS-0g for qemu-devel@nongnu.org; Mon, 10 Jul 2017 13:11:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dUcD2-0008R8-F7 for qemu-devel@nongnu.org; Mon, 10 Jul 2017 13:10:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37302) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dUcD2-0008PD-5Q for qemu-devel@nongnu.org; Mon, 10 Jul 2017 13:10:56 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E046D80F96 for ; Mon, 10 Jul 2017 17:10:54 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-116-231.ams2.redhat.com [10.36.116.231]) by smtp.corp.redhat.com (Postfix) with ESMTP id A6C416292F; Mon, 10 Jul 2017 17:10:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E046D80F96 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=dgilbert@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com E046D80F96 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org Date: Mon, 10 Jul 2017 18:10:38 +0100 Message-Id: <20170710171040.21021-8-dgilbert@redhat.com> In-Reply-To: <20170710171040.21021-1-dgilbert@redhat.com> References: <20170710171040.21021-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 10 Jul 2017 17:10: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] [PULL 7/9] migration: Create load_setup()/cleanup() methods 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, peterx@redhat.com, quintela@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" From: Juan Quintela We need to do things at load time and at cleanup time. Signed-off-by: Juan Quintela -- Move the printing of the error message so we can print the device giving the error. Add call to postcopy stuff Message-Id: <20170628095228.4661-4-quintela@redhat.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- include/migration/register.h | 2 ++ migration/savevm.c | 45 ++++++++++++++++++++++++++++++++++++++++= +++- migration/savevm.h | 1 + migration/trace-events | 2 ++ 4 files changed, 49 insertions(+), 1 deletion(-) diff --git a/include/migration/register.h b/include/migration/register.h index 938ea2bc3d..a0f1edd8c7 100644 --- a/include/migration/register.h +++ b/include/migration/register.h @@ -39,6 +39,8 @@ typedef struct SaveVMHandlers { uint64_t *non_postcopiable_pending, uint64_t *postcopiable_pending); LoadStateHandler *load_state; + int (*load_setup)(QEMUFile *f, void *opaque); + int (*load_cleanup)(void *opaque); } SaveVMHandlers; =20 int register_savevm_live(DeviceState *dev, diff --git a/migration/savevm.c b/migration/savevm.c index fee11c5d28..fdd15fa0a7 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1541,7 +1541,7 @@ static void *postcopy_ram_listen_thread(void *opaque) * got a bad migration state). */ migration_incoming_state_destroy(); - + qemu_loadvm_state_cleanup(); =20 return NULL; } @@ -1901,6 +1901,44 @@ qemu_loadvm_section_part_end(QEMUFile *f, MigrationI= ncomingState *mis) return 0; } =20 +static int qemu_loadvm_state_setup(QEMUFile *f) +{ + SaveStateEntry *se; + int ret; + + trace_loadvm_state_setup(); + QTAILQ_FOREACH(se, &savevm_state.handlers, entry) { + if (!se->ops || !se->ops->load_setup) { + continue; + } + if (se->ops && se->ops->is_active) { + if (!se->ops->is_active(se->opaque)) { + continue; + } + } + + ret =3D se->ops->load_setup(f, se->opaque); + if (ret < 0) { + qemu_file_set_error(f, ret); + error_report("Load state of device %s failed", se->idstr); + return ret; + } + } + return 0; +} + +void qemu_loadvm_state_cleanup(void) +{ + SaveStateEntry *se; + + trace_loadvm_state_cleanup(); + QTAILQ_FOREACH(se, &savevm_state.handlers, entry) { + if (se->ops && se->ops->load_cleanup) { + se->ops->load_cleanup(se->opaque); + } + } +} + static int qemu_loadvm_state_main(QEMUFile *f, MigrationIncomingState *mis) { uint8_t section_type; @@ -1973,6 +2011,10 @@ int qemu_loadvm_state(QEMUFile *f) return -ENOTSUP; } =20 + if (qemu_loadvm_state_setup(f) !=3D 0) { + return -EINVAL; + } + if (migrate_get_current()->send_configuration) { if (qemu_get_byte(f) !=3D QEMU_VM_CONFIGURATION) { error_report("Configuration section missing"); @@ -2036,6 +2078,7 @@ int qemu_loadvm_state(QEMUFile *f) } } =20 + qemu_loadvm_state_cleanup(); cpu_synchronize_all_post_init(); =20 return ret; diff --git a/migration/savevm.h b/migration/savevm.h index 6babc6221a..295c4a1f2c 100644 --- a/migration/savevm.h +++ b/migration/savevm.h @@ -53,5 +53,6 @@ void qemu_savevm_send_postcopy_ram_discard(QEMUFile *f, c= onst char *name, uint64_t *length_list); =20 int qemu_loadvm_state(QEMUFile *f); +void qemu_loadvm_state_cleanup(void); =20 #endif diff --git a/migration/trace-events b/migration/trace-events index 9669e94ddc..cb2c4b5b40 100644 --- a/migration/trace-events +++ b/migration/trace-events @@ -7,6 +7,8 @@ qemu_loadvm_state_section_partend(uint32_t section_id) "%u" qemu_loadvm_state_post_main(int ret) "%d" qemu_loadvm_state_section_startfull(uint32_t section_id, const char *idstr= , uint32_t instance_id, uint32_t version_id) "%u(%s) %u %u" qemu_savevm_send_packaged(void) "" +loadvm_state_setup(void) "" +loadvm_state_cleanup(void) "" loadvm_handle_cmd_packaged(unsigned int length) "%u" loadvm_handle_cmd_packaged_main(int ret) "%d" loadvm_handle_cmd_packaged_received(int ret) "%d" --=20 2.13.0 From nobody Wed Nov 5 06:44:48 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.zohomail.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 1499707046440890.4062738638969; Mon, 10 Jul 2017 10:17:26 -0700 (PDT) Received: from localhost ([::1]:42205 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUcJJ-0001uY-7M for importer@patchew.org; Mon, 10 Jul 2017 13:17:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35708) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUcD6-0004wT-0j for qemu-devel@nongnu.org; Mon, 10 Jul 2017 13:11:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dUcD3-0008TS-Ch for qemu-devel@nongnu.org; Mon, 10 Jul 2017 13:10:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33606) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dUcD3-0008RG-3R for qemu-devel@nongnu.org; Mon, 10 Jul 2017 13:10:57 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 27CFD49003 for ; Mon, 10 Jul 2017 17:10:56 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-116-231.ams2.redhat.com [10.36.116.231]) by smtp.corp.redhat.com (Postfix) with ESMTP id 14FC317114; Mon, 10 Jul 2017 17:10:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 27CFD49003 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=dgilbert@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 27CFD49003 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org Date: Mon, 10 Jul 2017 18:10:39 +0100 Message-Id: <20170710171040.21021-9-dgilbert@redhat.com> In-Reply-To: <20170710171040.21021-1-dgilbert@redhat.com> References: <20170710171040.21021-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 10 Jul 2017 17:10:56 +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] [PULL 8/9] migration: Convert ram to use new load_setup()/load_cleanup() 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, peterx@redhat.com, quintela@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" From: Juan Quintela Once there, I rename ram_migration_cleanup() to ram_save_cleanup(). Notice that this is the first pass, and I only passed XBZRLE to the new scheme. Moved decoded_buf to inside XBZRLE struct. As a bonus, I don't have to export xbzrle functions from ram.c. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert -- loaded_data pointer was needed because called can change it (dave) spell loaded correctly in comment (dave) Message-Id: <20170628095228.4661-5-quintela@redhat.com> Signed-off-by: Dr. David Alan Gilbert --- migration/migration.c | 3 --- migration/ram.c | 49 ++++++++++++++++++++++++++++++++++++-----------= -- migration/ram.h | 1 - 3 files changed, 36 insertions(+), 17 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index beea01ce63..7e5dbd9b92 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -352,9 +352,6 @@ static void process_incoming_migration_co(void *opaque) migrate_decompress_threads_join(); exit(EXIT_FAILURE); } - - free_xbzrle_decoded_buf(); - mis->bh =3D qemu_bh_new(process_incoming_migration_bh, mis); qemu_bh_schedule(mis->bh); } diff --git a/migration/ram.c b/migration/ram.c index 649f76cb52..73aec34161 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -85,11 +85,10 @@ static struct { QemuMutex lock; /* it will store a page full of zeros */ uint8_t *zero_target_page; + /* buffer used for XBZRLE decoding */ + uint8_t *decoded_buf; } XBZRLE; =20 -/* buffer used for XBZRLE decoding */ -static uint8_t *xbzrle_decoded_buf; - static void XBZRLE_cache_lock(void) { if (migrate_use_xbzrle()) @@ -1350,13 +1349,18 @@ uint64_t ram_bytes_total(void) return total; } =20 -void free_xbzrle_decoded_buf(void) +static void xbzrle_load_setup(void) { - g_free(xbzrle_decoded_buf); - xbzrle_decoded_buf =3D NULL; + XBZRLE.decoded_buf =3D g_malloc(TARGET_PAGE_SIZE); } =20 -static void ram_migration_cleanup(void *opaque) +static void xbzrle_load_cleanup(void) +{ + g_free(XBZRLE.decoded_buf); + XBZRLE.decoded_buf =3D NULL; +} + +static void ram_save_cleanup(void *opaque) { RAMState **rsp =3D opaque; RAMBlock *block; @@ -2078,11 +2082,6 @@ static int load_xbzrle(QEMUFile *f, ram_addr_t addr,= void *host) int xh_flags; uint8_t *loaded_data; =20 - if (!xbzrle_decoded_buf) { - xbzrle_decoded_buf =3D g_malloc(TARGET_PAGE_SIZE); - } - loaded_data =3D xbzrle_decoded_buf; - /* extract RLE header */ xh_flags =3D qemu_get_byte(f); xh_len =3D qemu_get_be16(f); @@ -2096,7 +2095,9 @@ static int load_xbzrle(QEMUFile *f, ram_addr_t addr, = void *host) error_report("Failed to load XBZRLE page - len overflow!"); return -1; } + loaded_data =3D XBZRLE.decoded_buf; /* load data and decode */ + /* it can change loaded_data to point to an internal buffer */ qemu_get_buffer_in_place(f, &loaded_data, xh_len); =20 /* decode RLE */ @@ -2310,6 +2311,26 @@ static void decompress_data_with_multi_threads(QEMUF= ile *f, } =20 /** + * ram_load_setup: Setup RAM for migration incoming side + * + * Returns zero to indicate success and negative for error + * + * @f: QEMUFile where to receive the data + * @opaque: RAMState pointer + */ +static int ram_load_setup(QEMUFile *f, void *opaque) +{ + xbzrle_load_setup(); + return 0; +} + +static int ram_load_cleanup(void *opaque) +{ + xbzrle_load_cleanup(); + return 0; +} + +/** * ram_postcopy_incoming_init: allocate postcopy data structures * * Returns 0 for success and negative if there was one error @@ -2629,7 +2650,9 @@ static SaveVMHandlers savevm_ram_handlers =3D { .save_live_complete_precopy =3D ram_save_complete, .save_live_pending =3D ram_save_pending, .load_state =3D ram_load, - .save_cleanup =3D ram_migration_cleanup, + .save_cleanup =3D ram_save_cleanup, + .load_setup =3D ram_load_setup, + .load_cleanup =3D ram_load_cleanup, }; =20 void ram_mig_init(void) diff --git a/migration/ram.h b/migration/ram.h index 6272eb0007..a8b79a4d4c 100644 --- a/migration/ram.h +++ b/migration/ram.h @@ -47,7 +47,6 @@ void migrate_decompress_threads_join(void); uint64_t ram_pagesize_summary(void); int ram_save_queue_pages(const char *rbname, ram_addr_t start, ram_addr_t = len); void acct_update_position(QEMUFile *f, size_t size, bool zero); -void free_xbzrle_decoded_buf(void); void ram_debug_dump_bitmap(unsigned long *todump, bool expected, unsigned long pages); void ram_postcopy_migrated_memory_release(MigrationState *ms); --=20 2.13.0 From nobody Wed Nov 5 06:44:49 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.zohomail.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 1499707135609795.5979933593849; Mon, 10 Jul 2017 10:18:55 -0700 (PDT) Received: from localhost ([::1]:42221 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUcKj-000357-7I for importer@patchew.org; Mon, 10 Jul 2017 13:18:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35728) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUcD6-0004x9-O6 for qemu-devel@nongnu.org; Mon, 10 Jul 2017 13:11:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dUcD5-0008Vs-Fq for qemu-devel@nongnu.org; Mon, 10 Jul 2017 13:11:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40841) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dUcD5-0008UC-65 for qemu-devel@nongnu.org; Mon, 10 Jul 2017 13:10:59 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 471BA7F6A6 for ; Mon, 10 Jul 2017 17:10:58 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-116-231.ams2.redhat.com [10.36.116.231]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7BBEC5D6A6; Mon, 10 Jul 2017 17:10:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 471BA7F6A6 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dgilbert@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 471BA7F6A6 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org Date: Mon, 10 Jul 2017 18:10:40 +0100 Message-Id: <20170710171040.21021-10-dgilbert@redhat.com> In-Reply-To: <20170710171040.21021-1-dgilbert@redhat.com> References: <20170710171040.21021-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 10 Jul 2017 17:10: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] [PULL 9/9] migration: Make compression_threads use save/load_setup/cleanup() 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, peterx@redhat.com, quintela@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" From: Juan Quintela Once there, be consistent and use compress_thread_{save,load}_{setup,cleanup}. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Message-Id: <20170628095228.4661-6-quintela@redhat.com> Signed-off-by: Dr. David Alan Gilbert --- migration/migration.c | 5 ----- migration/ram.c | 12 ++++++++---- migration/ram.h | 5 ----- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 7e5dbd9b92..a0db40d364 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -286,7 +286,6 @@ static void process_incoming_migration_bh(void *opaque) } else { runstate_set(global_state_get_runstate()); } - migrate_decompress_threads_join(); /* * This must happen after any state changes since as soon as an extern= al * observer sees this event they might start to prod at the VM assuming @@ -349,7 +348,6 @@ static void process_incoming_migration_co(void *opaque) migrate_set_state(&mis->state, MIGRATION_STATUS_ACTIVE, MIGRATION_STATUS_FAILED); error_report("load of migration failed: %s", strerror(-ret)); - migrate_decompress_threads_join(); exit(EXIT_FAILURE); } mis->bh =3D qemu_bh_new(process_incoming_migration_bh, mis); @@ -360,7 +358,6 @@ void migration_fd_process_incoming(QEMUFile *f) { Coroutine *co =3D qemu_coroutine_create(process_incoming_migration_co,= f); =20 - migrate_decompress_threads_create(); qemu_file_set_blocking(f, false); qemu_coroutine_enter(co); } @@ -827,7 +824,6 @@ static void migrate_fd_cleanup(void *opaque) } qemu_mutex_lock_iothread(); =20 - migrate_compress_threads_join(); qemu_fclose(s->to_dst_file); s->to_dst_file =3D NULL; } @@ -1990,7 +1986,6 @@ void migrate_fd_connect(MigrationState *s) } } =20 - migrate_compress_threads_create(); qemu_thread_create(&s->thread, "live_migration", migration_thread, s, QEMU_THREAD_JOINABLE); s->migration_thread_running =3D true; diff --git a/migration/ram.c b/migration/ram.c index 73aec34161..1b08296d1b 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -306,7 +306,7 @@ static inline void terminate_compression_threads(void) } } =20 -void migrate_compress_threads_join(void) +static void compress_threads_save_cleanup(void) { int i, thread_count; =20 @@ -329,7 +329,7 @@ void migrate_compress_threads_join(void) comp_param =3D NULL; } =20 -void migrate_compress_threads_create(void) +static void compress_threads_save_setup(void) { int i, thread_count; =20 @@ -1390,6 +1390,7 @@ static void ram_save_cleanup(void *opaque) } XBZRLE_cache_unlock(); migration_page_queue_free(*rsp); + compress_threads_save_cleanup(); g_free(*rsp); *rsp =3D NULL; } @@ -1923,6 +1924,7 @@ static int ram_save_setup(QEMUFile *f, void *opaque) } =20 rcu_read_unlock(); + compress_threads_save_setup(); =20 ram_control_before_iterate(f, RAM_CONTROL_SETUP); ram_control_after_iterate(f, RAM_CONTROL_SETUP); @@ -2231,7 +2233,7 @@ static void wait_for_decompress_done(void) qemu_mutex_unlock(&decomp_done_lock); } =20 -void migrate_decompress_threads_create(void) +static void compress_threads_load_setup(void) { int i, thread_count; =20 @@ -2255,7 +2257,7 @@ void migrate_decompress_threads_create(void) } } =20 -void migrate_decompress_threads_join(void) +static void compress_threads_load_cleanup(void) { int i, thread_count; =20 @@ -2321,12 +2323,14 @@ static void decompress_data_with_multi_threads(QEMU= File *f, static int ram_load_setup(QEMUFile *f, void *opaque) { xbzrle_load_setup(); + compress_threads_load_setup(); return 0; } =20 static int ram_load_cleanup(void *opaque) { xbzrle_load_cleanup(); + compress_threads_load_cleanup(); return 0; } =20 diff --git a/migration/ram.h b/migration/ram.h index a8b79a4d4c..c081fde86c 100644 --- a/migration/ram.h +++ b/migration/ram.h @@ -39,11 +39,6 @@ int64_t xbzrle_cache_resize(int64_t new_size); uint64_t ram_bytes_remaining(void); uint64_t ram_bytes_total(void); =20 -void migrate_compress_threads_create(void); -void migrate_compress_threads_join(void); -void migrate_decompress_threads_create(void); -void migrate_decompress_threads_join(void); - uint64_t ram_pagesize_summary(void); int ram_save_queue_pages(const char *rbname, ram_addr_t start, ram_addr_t = len); void acct_update_position(QEMUFile *f, size_t size, bool zero); --=20 2.13.0