migration: fix iotest 055, only-migratable break
v2 cover migration: fix iotest 055, only-migratable break
v2:
- patch 1: add r-b for Eduardo/Juan
- patch 2: add r-b for Eduardo (Markus's suggestion is a todo), and t-b for Qingfeng
- patch 3: rewrite the doc up, merging both Eduardo/Markus's suggestion [Eduardo, Markus]
- patch 4: added a TODO [Markus]
Two breakage introduced during the migration objectify series: one for --only-migratable, another one for iotest 055.
First two patches fixes the breakages. Latter two are documentation updates suggested by Eduardo. Please review. Thanks.
Peter Xu (4):
migration: fix handling for --only-migratable
vl: move global property, migrate init earlier
doc: add item for "-M enforce-config-section"
doc: update TYPE_MIGRATION documents
include/migration/misc.h | 1 - migration/migration.c | 17 ++++++----------- qemu-options.hx | 11 +++++++++++ vl.c | 26 +++++++++++++------------- 4 files changed, 30 insertions(+), 25 deletions(-)
Signature · 1 line
2.7.4
PATCH v2 1/4 migration: fix handling for --only-migratable
MigrateState object is not ready at that time, so we'll get an assertion. Use qemu_global_option() instead.
--- include/migration/misc.h | 1 - migration/migration.c | 5 ----- vl.c | 2 +- 3 files changed, 1 insertion(+), 7 deletions(-)
include/migration/misc.h +0 -1
@@ -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);#endif
migration/migration.c +0 -5
@@ -128,11 +128,6 @@ MigrationState *migrate_get_current(void)return current_migration; } -void migration_only_migratable_set (void ) -{ -migrate_get_current ()->only_migratable = true; -} -MigrationIncomingState *migration_incoming_get_current (void ) {static bool once;
vl.c +1 -1
@@ -3958,7 +3958,7 @@ int main(int argc, char **argv, char **envp)* * "-global migration.only-migratable=true" */ -migration_only_migratable_set (); +qemu_global_option ("migration.only-migratable=true" );break ;case QEMU_OPTION_nodefaults: has_defaults =0 ;
Signature · 1 line
2.7.4
PATCH v2 2/4 vl: move global property, migrate init earlier
In reply to Peter XuCurrently 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.
--- vl.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
vl.c +12 -12
@@ -4414,6 +4414,18 @@ int main(int argc, char **argv, char **envp)configure_accelerator (current_machine); +/* +* 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 ==1 ?1 :0 ); } -/* -* 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. */
Signature · 1 line
2.7.4
PATCH v2 3/4 doc: add item for "-M enforce-config-section"
In reply to Peter XuIt'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.
--- qemu-options.hx | 11 +++++++++++ 1 file changed, 11 insertions(+)
qemu-options.hx +11 -0
@@ -85,6 +85,17 @@ Enables or disables NVDIMM support. The default is off. @item s390-squash-mcss=on|off Enables or disables squashing subchannels into the default css. The default is off. +@item enforce-config-section=on|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}=@var{on|off} instead. @end table ETEXI
Signature · 1 line
2.7.4
PATCH v2 3/4 doc: add item for "-M enforce-config-section"
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.
---
v2.1:
- remove the "undefined behavior" sentence [Markus]
qemu-options.hx | 8 ++++++++ 1 file changed, 8 insertions(+)
qemu-options.hx +8 -0
@@ -85,6 +85,14 @@ Enables or disables NVDIMM support. The default is off. @item s390-squash-mcss=on|off Enables or disables squashing subchannels into the default css. The default is off. +@item enforce-config-section=on|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}=@var{on|off} instead. +@option{enforce-config-section} cannot be used together with +@option{-global} @option{migration.send-configuration}. @end table ETEXI
Signature · 1 line
2.7.4
Re: [Qemu-devel] [PATCH v2.1 3/4] doc: add item for "-M enforce-config-section"
Quoted 22 lines · On Thu, 6 Jul 2017 10:08:41 +0800 Peter Xu <[email protected]> wrote:
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 <[email protected]>Signed-off-by Peter Xu <[email protected]>---
v2.1:
- remove the "undefined behavior" sentence [Markus]qemu-options.hx | 8 ++++++++ 1 file changed, 8 insertions(+)qemu-options.hx +0
-0@@ -85,6 +85,14 @@ Enables or disables NVDIMM support. The default is off. @item s390-squash-mcss=on|off
qemu-options.hx Enables or disables NVDIMM support. The default is off. · line 95
Quoted 10 lines
qemu-options.hx +8
-0Enables or disables squashing subchannels into the default css. The default is off. +@item enforce-config-section=on|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}=@var{on|off} instead. +@option{enforce-config-section} cannot be used together with +@option{-global} @option{migration.send-configuration}.
Is this last sentence correct ?
My understanding is that "enforce-config-section" overrides "migration.send-configuration"...
Quoted 3 lines
qemu-options.hx +0
-0@end table ETEXI
Re: [Qemu-devel] [PATCH v2.1 3/4] doc: add item for "-M enforce-config-section"
Quoted 38 lines · Greg Kurz
Quoted 22 lines · On Thu, 6 Jul 2017 10:08:41 +0800 Peter Xu <[email protected]> wrote:
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 <[email protected]>Signed-off-by Peter Xu <[email protected]>---
v2.1:
- remove the "undefined behavior" sentence [Markus]qemu-options.hx | 8 ++++++++ 1 file changed, 8 insertions(+)qemu-options.hx +0
-0@@ -85,6 +85,14 @@ Enables or disables NVDIMM support. The default is off. @item s390-squash-mcss=on|offqemu-options.hx Enables or disables NVDIMM support. The default is off. · line 95
Quoted 10 lines
qemu-options.hx +8
-0Enables or disables squashing subchannels into the default css. The default is off. +@item enforce-config-section=on|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}=@var{on|off} instead. +@option{enforce-config-section} cannot be used together with +@option{-global} @option{migration.send-configuration}.Is this last sentence correct ?
Quoted 2 lines
My understanding is that "enforce-config-section" overrides "migration.send-configuration"...
Yes, in the codes it is.
But as mentioned in the commit message, this rule is actually not really necessary, so it does not really conflict when we declare in the document that it is not allowed to happen (the code just did something extra). After all, we want to finally remove enforce-config-section one day, so before that I would like to avoid taking more responsibility on this old parameter.
Also, I hope people (especially who read this document) don't use these two parameters at the same time, or better, use the new one, rather than still using "enforce-config-section" after he knows that "anyway, it'll override the global parameter, so this old one is still better"...
Thanks,
Signature · 1 line
Peter Xu
Re: [Qemu-devel] [PATCH v2.1 3/4] doc: add item for "-M enforce-config-section"
In reply to Peter XuQuoted 23 lines · Peter Xu
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 <[email protected]>Signed-off-by Peter Xu <[email protected]>---
v2.1:
- remove the "undefined behavior" sentence [Markus]qemu-options.hx | 8 ++++++++ 1 file changed, 8 insertions(+)qemu-options.hx +0
-0@@ -85,6 +85,14 @@ Enables or disables NVDIMM support. The default is off. @item s390-squash-mcss=on|off Enables or disables squashing subchannels into the default css.
qemu-options.hx Enables or disables NVDIMM support. The default is off. · line 96
Quoted 10 lines
qemu-options.hx +8
-0The default is off. +@item enforce-config-section=on|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}=@var{on|off} instead. +@option{enforce-config-section} cannot be used together with +@option{-global} @option{migration.send-configuration}. @end table
I'm not sure if "cannot be used together" is much better than "behavior is undefined when they are used together". I prefer Markus' suggestion to simply leave it unspecified. (In other words, just removing the last 2 lines)
Signature · 1 line
Eduardo
PATCH v2 3/4 doc: add item for "-M enforce-config-section"
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.
---
v2.1 -> v2.2
- remove the last two lines of document [Eduardo]
qemu-options.hx | 6 ++++++ 1 file changed, 6 insertions(+)
qemu-options.hx +6 -0
@@ -85,6 +85,12 @@ Enables or disables NVDIMM support. The default is off. @item s390-squash-mcss=on|off Enables or disables squashing subchannels into the default css. The default is off. +@item enforce-config-section=on|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}=@var{on|off} instead. @end table ETEXI
Signature · 1 line
2.7.4
Re: [Qemu-devel] [PATCH v2.2 3/4] doc: add item for "-M enforce-config-section"
Quoted 9 lines · On Fri, 7 Jul 2017 10:54:08 +0800 Peter Xu <[email protected]> wrote:
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 <[email protected]>Signed-off-by Peter Xu <[email protected]>
Quoted 24 lines
---
v2.1 -> v2.2
- remove the last two lines of document [Eduardo]qemu-options.hx | 6 ++++++ 1 file changed, 6 insertions(+)qemu-options.hx +6
-0@@ -85,6 +85,12 @@ Enables or disables NVDIMM support. The default is off. @item s390-squash-mcss=on|off Enables or disables squashing subchannels into the default css. The default is off. +@item enforce-config-section=on|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}=@var{on|off} instead. @end table ETEXI
Re: [Qemu-devel] [PATCH v2.2 3/4] doc: add item for "-M enforce-config-section"
In reply to Peter XuQuoted 6 lines · Peter Xu
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.
This paragraph looks obsolete now, as now the documentation doesn't explicitly forbid mixing the two options. If it gets removed:
Juan, will you queue it through your tree?
Thanks!
Quoted 24 lines
Suggested-by Eduardo Habkost <[email protected]>Signed-off-by Peter Xu <[email protected]>---
v2.1 -> v2.2
- remove the last two lines of document [Eduardo]qemu-options.hx | 6 ++++++ 1 file changed, 6 insertions(+)qemu-options.hx +6
-0@@ -85,6 +85,12 @@ Enables or disables NVDIMM support. The default is off. @item s390-squash-mcss=on|off Enables or disables squashing subchannels into the default css. The default is off. +@item enforce-config-section=on|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}=@var{on|off} instead.
Signature · 1 line
Eduardo
Re: [Qemu-devel] [PATCH v2.2 3/4] doc: add item for "-M enforce-config-section"
Quoted 8 lines · * Eduardo Habkost ([email protected]) wrote:
Quoted 6 lines · Peter Xu
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.
Quoted 7 lines
This paragraph looks obsolete now, as now the documentation doesn't explicitly forbid mixing the two options. If it gets removed:
Reviewed-by Eduardo Habkost <[email protected]>Juan, will you queue it through your tree?
Juan's on PTO, I'll take it.
Dave
Quoted 12 lines
Thanks!
Quoted 10 lines
Suggested-by Eduardo Habkost <[email protected]>Signed-off-by Peter Xu <[email protected]>---
v2.1 -> v2.2
- remove the last two lines of document [Eduardo]qemu-options.hx | 6 ++++++ 1 file changed, 6 insertions(+)
Quoted 17 lines
Quoted 14 lines
qemu-options.hx +6
-0@@ -85,6 +85,12 @@ Enables or disables NVDIMM support. The default is off. @item s390-squash-mcss=on|off Enables or disables squashing subchannels into the default css. The default is off. +@item enforce-config-section=on|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}=@var{on|off} instead.Signature · 1 line
Eduardo
--
Dr. David Alan Gilbert / [email protected] / Manchester, UK
Greg Kurz
Reviewed-byRe: [Qemu-devel] [PATCH v2.2 3/4] doc: add item for "-M enforce-config-section"
In reply to Eduardo HabkostQuoted 4 lines · On Fri, 7 Jul 2017 09:12:14 -0300 Eduardo Habkost <[email protected]> wrote:
Quoted 3 lines · Peter Xu
It's never documented, and now we have one more parameter for it (which obsoletes this one). Document it properly.
Quoted 8 lines
Quoted 3 lines
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.
This paragraph looks obsolete now, as now the documentation doesn't explicitly forbid mixing the two options. If it gets removed:
Same for me.
Quoted 2 lines
Reviewed-by Eduardo Habkost <[email protected]>
Quoted 29 lines
Juan, will you queue it through your tree?
Thanks!
Quoted 24 lines
Suggested-by Eduardo Habkost <[email protected]>Signed-off-by Peter Xu <[email protected]>---
v2.1 -> v2.2
- remove the last two lines of document [Eduardo]qemu-options.hx | 6 ++++++ 1 file changed, 6 insertions(+)qemu-options.hx +6
-0@@ -85,6 +85,12 @@ Enables or disables NVDIMM support. The default is off. @item s390-squash-mcss=on|off Enables or disables squashing subchannels into the default css. The default is off. +@item enforce-config-section=on|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}=@var{on|off} instead.
Re: [Qemu-devel] [PATCH v2.2 3/4] doc: add item for "-M enforce-config-section"
Quoted 16 lines · Greg Kurz
Quoted 4 lines · On Fri, 7 Jul 2017 09:12:14 -0300 Eduardo Habkost <[email protected]> wrote:
Quoted 3 lines · Peter Xu
It's never documented, and now we have one more parameter for it (which obsoletes this one). Document it properly.
Quoted 8 lines
Quoted 3 lines
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.
This paragraph looks obsolete now, as now the documentation doesn't explicitly forbid mixing the two options. If it gets removed:
Quoted 6 lines
Same for me.
Quoted 2 lines
Reviewed-by Eduardo Habkost <[email protected]>Reviewed-by Greg Kurz <[email protected]>
Thanks all for reviewing the patches!
Signature · 1 line
Peter Xu
PATCH v2 4/4 doc: update TYPE_MIGRATION documents
In reply to Peter Xu[Peter collected Eduardo's patch comment and formatted into patch]
--- migration/migration.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
migration/migration.c +6 -6
@@ -2052,12 +2052,12 @@ static void migration_instance_init(Object *obj)static const TypeInfo migration_type = { .name =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 =TYPE_DEVICE , .class_init = migration_class_init,
Signature · 1 line
2.7.4
Re: [Qemu-devel] [PATCH v2 4/4] doc: update TYPE_MIGRATION documents
Quoted 4 lines · Peter Xu
[Peter collected Eduardo's patch comment and formatted into patch]
Suggested-by Eduardo Habkost <[email protected]>Signed-off-by Peter Xu <[email protected]>
In case it was not merged yet:
Signature · 1 line
Eduardo
Quoted 8 lines · * Peter Xu ([email protected]) wrote:
v2:
- patch 1: add r-b for Eduardo/Juan
- patch 2: add r-b for Eduardo (Markus's suggestion is a todo), and t-b for Qingfeng
- patch 3: rewrite the doc up, merging both Eduardo/Markus's suggestion [Eduardo, Markus]
- patch 4: added a TODO [Markus]
Quoted 5 lines
Two breakage introduced during the migration objectify series: one for --only-migratable, another one for iotest 055.
First two patches fixes the breakages. Latter two are documentation updates suggested by Eduardo. Please review. Thanks.
Queued (with commit message tweak from Eduardo in 3)
Dave
Quoted 6 lines
Peter Xu (4):
migration: fix handling for --only-migratable
vl: move global property, migrate init earlier
doc: add item for "-M enforce-config-section"
doc: updateTYPE_MIGRATIONdocuments
Quoted 10 lines
include/migration/misc.h | 1 - migration/migration.c | 17 ++++++----------- qemu-options.hx | 11 +++++++++++ vl.c | 26 +++++++++++++------------- 4 files changed, 30 insertions(+), 25 deletions(-)Signature · 1 line
2.7.4
--
Dr. David Alan Gilbert / [email protected] / Manchester, UK