From nobody Sun Apr 28 21:58:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.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 1499243003659174.896648435943; Wed, 5 Jul 2017 01:23:23 -0700 (PDT) Received: from localhost ([::1]:44789 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSfai-0006px-Qi for importer@patchew.org; Wed, 05 Jul 2017 04:23:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36310) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSfZ6-0005rd-Ny for qemu-devel@nongnu.org; Wed, 05 Jul 2017 04:21:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSfZ5-0000Su-BM for qemu-devel@nongnu.org; Wed, 05 Jul 2017 04:21:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58936) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dSfZ5-0000Sh-52 for qemu-devel@nongnu.org; Wed, 05 Jul 2017 04:21:39 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 278293345B7; Wed, 5 Jul 2017 08:21:38 +0000 (UTC) Received: from pxdev.xzpeter.org.com (ovpn-12-17.pek2.redhat.com [10.72.12.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id B71AF5D741; Wed, 5 Jul 2017 08:21:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 278293345B7 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=peterx@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 278293345B7 From: Peter Xu To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 16:21:20 +0800 Message-Id: <1499242883-2184-2-git-send-email-peterx@redhat.com> In-Reply-To: <1499242883-2184-1-git-send-email-peterx@redhat.com> References: <1499242883-2184-1-git-send-email-peterx@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 05 Jul 2017 08:21:38 +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 v2 1/4] 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: Laurent Vivier , Eduardo Habkost , Juan Quintela , Markus Armbruster , peterx@redhat.com, "Dr . David Alan Gilbert" , haoqf@linux.vnet.ibm.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" 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 --- 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 2255121..c079b77 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 51ccd1a..dbdc121 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 36ff3f4..0c497a3 100644 --- a/vl.c +++ b/vl.c @@ -3958,7 +3958,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.7.4 From nobody Sun Apr 28 21:58:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.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 1499243017936940.4510908744211; Wed, 5 Jul 2017 01:23:37 -0700 (PDT) Received: from localhost ([::1]:44791 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSfau-0006zI-B5 for importer@patchew.org; Wed, 05 Jul 2017 04:23:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36327) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSfZ9-0005sY-BK for qemu-devel@nongnu.org; Wed, 05 Jul 2017 04:21:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSfZ8-0000Tk-Bh for qemu-devel@nongnu.org; Wed, 05 Jul 2017 04:21:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47650) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dSfZ8-0000Ta-5e for qemu-devel@nongnu.org; Wed, 05 Jul 2017 04:21:42 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2DA014E4D1; Wed, 5 Jul 2017 08:21:41 +0000 (UTC) Received: from pxdev.xzpeter.org.com (ovpn-12-17.pek2.redhat.com [10.72.12.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 962925D741; Wed, 5 Jul 2017 08:21:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2DA014E4D1 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 2DA014E4D1 From: Peter Xu To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 16:21:21 +0800 Message-Id: <1499242883-2184-3-git-send-email-peterx@redhat.com> In-Reply-To: <1499242883-2184-1-git-send-email-peterx@redhat.com> References: <1499242883-2184-1-git-send-email-peterx@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 05 Jul 2017 08:21:41 +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] [PATCH v2 2/4] 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: Laurent Vivier , Eduardo Habkost , Juan Quintela , Markus Armbruster , peterx@redhat.com, "Dr . David Alan Gilbert" , haoqf@linux.vnet.ibm.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" 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 --- vl.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/vl.c b/vl.c index 0c497a3..2ae4313 100644 --- a/vl.c +++ b/vl.c @@ -4414,6 +4414,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); } @@ -4595,18 +4607,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.7.4 From nobody Sun Apr 28 21:58:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.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 1499243019194166.55653652038222; Wed, 5 Jul 2017 01:23:39 -0700 (PDT) Received: from localhost ([::1]:44792 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSfaz-000743-QP for importer@patchew.org; Wed, 05 Jul 2017 04:23:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36339) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSfZC-0005ux-CP for qemu-devel@nongnu.org; Wed, 05 Jul 2017 04:21:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSfZB-0000UX-Ft for qemu-devel@nongnu.org; Wed, 05 Jul 2017 04:21:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50400) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dSfZB-0000UK-5Y for qemu-devel@nongnu.org; Wed, 05 Jul 2017 04:21:45 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 18D6A624C0; Wed, 5 Jul 2017 08:21:44 +0000 (UTC) Received: from pxdev.xzpeter.org.com (ovpn-12-17.pek2.redhat.com [10.72.12.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 910AA5D741; Wed, 5 Jul 2017 08:21:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 18D6A624C0 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 18D6A624C0 From: Peter Xu To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 16:21:22 +0800 Message-Id: <1499242883-2184-4-git-send-email-peterx@redhat.com> In-Reply-To: <1499242883-2184-1-git-send-email-peterx@redhat.com> References: <1499242883-2184-1-git-send-email-peterx@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 05 Jul 2017 08:21:44 +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 v2 3/4] 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: Laurent Vivier , Eduardo Habkost , Juan Quintela , Markus Armbruster , peterx@redhat.com, "Dr . David Alan Gilbert" , haoqf@linux.vnet.ibm.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" It's never documented, and now we have one more parameter for it (which obsoletes this one). Document it properly. Although now when enforce-config-section is set, it'll override the other "-global" parameter, that is not necessarily a rule. Forbid that usage in the document. Suggested-by: Eduardo Habkost Signed-off-by: Peter Xu --- qemu-options.hx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/qemu-options.hx b/qemu-options.hx index 297bd8a..2c1116e 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -85,6 +85,17 @@ 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}. +@option{enforce-config-section} cannot be used together with +@option{-global} @option{migration.send-configuration}. Behavior is +undefined if @option{enforce-config-section} and @option{-global} +@option{migration.send-configuration} are used together. + +NOTE: this parameter is deprecated. Please use @option{-global} +@option{migration.send-configuration}=3D@var{on|off} instead. @end table ETEXI =20 --=20 2.7.4 From nobody Sun Apr 28 21:58:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.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 1499243021752590.6700083023678; Wed, 5 Jul 2017 01:23:41 -0700 (PDT) Received: from localhost ([::1]:44793 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSfb2-00076d-BK for importer@patchew.org; Wed, 05 Jul 2017 04:23:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36350) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSfZF-0005xB-Kh for qemu-devel@nongnu.org; Wed, 05 Jul 2017 04:21:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSfZE-0000VH-85 for qemu-devel@nongnu.org; Wed, 05 Jul 2017 04:21:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47778) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dSfZE-0000V3-2F for qemu-devel@nongnu.org; Wed, 05 Jul 2017 04:21:48 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1855F4E4CA; Wed, 5 Jul 2017 08:21:47 +0000 (UTC) Received: from pxdev.xzpeter.org.com (ovpn-12-17.pek2.redhat.com [10.72.12.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 892D05D968; Wed, 5 Jul 2017 08:21:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1855F4E4CA 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 1855F4E4CA From: Peter Xu To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 16:21:23 +0800 Message-Id: <1499242883-2184-5-git-send-email-peterx@redhat.com> In-Reply-To: <1499242883-2184-1-git-send-email-peterx@redhat.com> References: <1499242883-2184-1-git-send-email-peterx@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 05 Jul 2017 08:21:47 +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 v2 4/4] 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: Laurent Vivier , Eduardo Habkost , Juan Quintela , Markus Armbruster , peterx@redhat.com, "Dr . David Alan Gilbert" , haoqf@linux.vnet.ibm.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" [Peter collected Eduardo's patch comment and formatted into patch] Suggested-by: Eduardo Habkost Signed-off-by: Peter Xu Reviewed-by: Eduardo Habkost --- migration/migration.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index dbdc121..31d46d1 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.7.4