Skip to contentSkip to conversation

Fix migration of old pseries

PATCH In review Greg Kurz 4 participants 20 messages Feb 18, 2016 – Feb 26, 2016

lore
Share & tools
lore

Greg Kurz

author
#0 lore raw

v3 cover Fix migration of old pseries

QEMU 2.4 broke the migration of old pseries machine with the addition of configuration sections, which are sent unconditionally.

We assume that QEMU 2.3 is more deployed than any newer release (based on the versions currently shipped by most distros). This v3 series hence reverses the logic from v2: it now fully fixes migration of old pseries from/to QEMU 2.3 and provides a manual workaround for the QEMU 2.4/2.4.1/2.5 case.

With this series, I could migrate the same pseries-2.3 instance in a full 2.3->2.6->2.5->2.6->2.4->2.6->2.3 cycle.

---

Greg Kurz (2):
spapr: skip configuration section during migration of older machines
migration: allow machine to enforce configuration section migration

 hw/core/machine.c   |   21 +++++++++++++++++++++
 hw/ppc/spapr.c      |    1 +
 include/hw/boards.h |    1 +
 migration/savevm.c  |   10 ++++++++--
 qemu-options.hx     |    3 ++-
 5 files changed, 33 insertions(+), 3 deletions(-)

--
Greg

author
#1 lore raw

PATCH v3 1/2 spapr: skip configuration section during migration of older machines

Since QEMU 2.4, we have a configuration section in the migration stream. This must be skipped for older machines, like it is already done for x86.

This patch fixes the migration of pseries-2.3 from/to QEMU 2.3, but it breaks migration of the same machine from/to QEMU 2.4/2.4.1/2.5. We do that anyway because QEMU 2.3 is likely to be more widely deployed than newer QEMU versions.

Fixes 61964c23e5ddd5a33f15699e45ce126f879e3e33
---
 hw/ppc/spapr.c |    1 +
 1 file changed, 1 insertion(+)
hw/ppc/spapr.c +1 -0
index 5bd8fd3ef842..bca7cb8a5d27 100644
@@ -2446,6 +2446,7 @@ static void spapr_machine_2_3_instance_options(MachineState *machine)
     spapr_machine_2_4_instance_options(machine);
     savevm_skip_section_footers();
     global_state_set_optional();
+    savevm_skip_configuration();
 }
 
 static void spapr_machine_2_3_class_options(MachineClass *mc)
Reviewed-by on v3 1/2
#2 lore raw

Re: [Qemu-devel] [PATCH v3 1/2] spapr: skip configuration section during migration of older machines

Quoted 10 lines · Greg Kurz

Since QEMU 2.4, we have a configuration section in the migration stream. This must be skipped for older machines, like it is already done for x86.

This patch fixes the migration of pseries-2.3 from/to QEMU 2.3, but it breaks migration of the same machine from/to QEMU 2.4/2.4.1/2.5. We do that anyway because QEMU 2.3 is likely to be more widely deployed than newer QEMU versions.

Fixes 61964c23e5ddd5a33f15699e45ce126f879e3e33
Quoted 17 lines
---
 hw/ppc/spapr.c |    1 +
 1 file changed, 1 insertion(+)
hw/ppc/spapr.c +1 -0
index 5bd8fd3ef842..bca7cb8a5d27 100644
@@ -2446,6 +2446,7 @@ static void spapr_machine_2_3_instance_options(MachineState *machine)
     spapr_machine_2_4_instance_options(machine);
     savevm_skip_section_footers();
     global_state_set_optional();
+    savevm_skip_configuration();
 }
 
 static void spapr_machine_2_3_class_options(MachineClass *mc)
Reviewed-by on v3 1/2
#3 lore raw

Re: [Qemu-devel] [PATCH v3 1/2] spapr: skip configuration section during migration of older machines

In reply to Greg Kurz
Quoted 10 lines · Greg Kurz

Since QEMU 2.4, we have a configuration section in the migration stream. This must be skipped for older machines, like it is already done for x86.

This patch fixes the migration of pseries-2.3 from/to QEMU 2.3, but it breaks migration of the same machine from/to QEMU 2.4/2.4.1/2.5. We do that anyway because QEMU 2.3 is likely to be more widely deployed than newer QEMU versions.

Fixes 61964c23e5ddd5a33f15699e45ce126f879e3e33
author
#4 lore raw

PATCH v3 2/2 migration: allow machine to enforce configuration section migration

In reply to Greg Kurz

Migration of pseries-2.3 doesn't have configuration section. Unfortunately, QEMU 2.4/2.4.1/2.5 are buggy and always stream and expect the configuration section, and break migration both ways.

This patch introduces a property which allows to enforce a configuration section for machines who don't have one.

It can be set at startup:

-machine enforce-config-section=on

or later from the QEMU monitor:

qom-set /machine enforce-config-section on

It is up to the tooling to set or unset this property according to the version of the QEMU at the other end of the pipe.

---
 hw/core/machine.c   |   21 +++++++++++++++++++++
 include/hw/boards.h |    1 +
 migration/savevm.c  |   10 ++++++++--
 qemu-options.hx     |    3 ++-
 4 files changed, 32 insertions(+), 3 deletions(-)
hw/core/machine.c +21 -0
index 6d1a0d8eebc4..a8c4680b0c47 100644
@@ -312,6 +312,21 @@ static bool machine_get_suppress_vmdesc(Object *obj, Error **errp)
     return ms->suppress_vmdesc;
 }
 
+static void machine_set_enforce_config_section(Object *obj, bool value,
+                                             Error **errp)
+{
+    MachineState *ms = MACHINE(obj);
+
+    ms->enforce_config_section = value;
+}
+
+static bool machine_get_enforce_config_section(Object *obj, Error **errp)
+{
+    MachineState *ms = MACHINE(obj);
+
+    return ms->enforce_config_section;
+}
+
 static int error_on_sysbus_device(SysBusDevice *sbdev, void *opaque)
 {
     error_report("Option '-device %s' cannot be handled by this machine",
@@ -467,6 +482,12 @@ static void machine_initfn(Object *obj)
     object_property_set_description(obj, "suppress-vmdesc",
                                     "Set on to disable self-describing migration",
                                     NULL);
+    object_property_add_bool(obj, "enforce-config-section",
+                             machine_get_enforce_config_section,
+                             machine_set_enforce_config_section, NULL);
+    object_property_set_description(obj, "enforce-config-section",
+                                    "Set on to enforce configuration section migration",
+                                    NULL);
 
     /* Register notifier when init is done for sysbus sanity checks */
     ms->sysbus_notifier.notify = machine_init_notify;
include/hw/boards.h +1 -0
index 0f30959e2e3b..cfdf8d10cfcd 100644
@@ -128,6 +128,7 @@ struct MachineState {
     char *firmware;
     bool iommu;
     bool suppress_vmdesc;
+    bool enforce_config_section;
 
     ram_addr_t ram_size;
     ram_addr_t maxram_size;
migration/savevm.c +8 -2
index 94f2894243ce..2fc57363674f 100644
@@ -878,13 +878,19 @@ bool qemu_savevm_state_blocked(Error **errp)
     return false;
 }
 
+static bool enforce_config_section(void)
+{
+    MachineState *machine = MACHINE(qdev_get_machine());
+    return machine->enforce_config_section;
+}
+
 void qemu_savevm_state_header(QEMUFile *f)
 {
     trace_savevm_state_header();
     qemu_put_be32(f, QEMU_VM_FILE_MAGIC);
     qemu_put_be32(f, QEMU_VM_FILE_VERSION);
 
-    if (!savevm_state.skip_configuration) {
+    if (!savevm_state.skip_configuration || enforce_config_section()) {
         qemu_put_byte(f, QEMU_VM_CONFIGURATION);
         vmstate_save_state(f, &vmstate_configuration, &savevm_state, 0);
     }
@@ -1875,7 +1881,7 @@ int qemu_loadvm_state(QEMUFile *f)
         return -ENOTSUP;
     }
 
-    if (!savevm_state.skip_configuration) {
+    if (!savevm_state.skip_configuration || enforce_config_section()) {
         if (qemu_get_byte(f) != QEMU_VM_CONFIGURATION) {
             error_report("Configuration section missing");
             return -EINVAL;
qemu-options.hx +2 -1
index 2f0465eeb1d1..8d81e310f2bf 100644
@@ -43,7 +43,8 @@ DEF("machine", HAS_ARG, QEMU_OPTION_machine, \
     "                aes-key-wrap=on|off controls support for AES key wrapping (default=on)\n"
     "                dea-key-wrap=on|off controls support for DEA key wrapping (default=on)\n"
     "                suppress-vmdesc=on|off disables self-describing migration (default=off)\n"
-    "                nvdimm=on|off controls NVDIMM support (default=off)\n",
+    "                nvdimm=on|off controls NVDIMM support (default=off)\n"
+    "                enforce-config-section=on|off enforce configuration section migration (default=off)\n",
     QEMU_ARCH_ALL)
 STEXI
 @item -machine [type=]@var{name}[,prop=@var{value}[,...]]
Reviewed-by on v3 2/2
#5 lore raw

Re: [Qemu-devel] [PATCH v3 2/2] migration: allow machine to enforce configuration section migration

Quoted 11 lines · Greg Kurz

Migration of pseries-2.3 doesn't have configuration section. Unfortunately, QEMU 2.4/2.4.1/2.5 are buggy and always stream and expect the configuration section, and break migration both ways.

This patch introduces a property which allows to enforce a configuration section for machines who don't have one.

It can be set at startup:

-machine enforce-config-section=on

Quoted 8 lines

or later from the QEMU monitor:

qom-set /machine enforce-config-section on

It is up to the tooling to set or unset this property according to the version of the QEMU at the other end of the pipe.

Quoted 107 lines
---
 hw/core/machine.c   |   21 +++++++++++++++++++++
 include/hw/boards.h |    1 +
 migration/savevm.c  |   10 ++++++++--
 qemu-options.hx     |    3 ++-
 4 files changed, 32 insertions(+), 3 deletions(-)
hw/core/machine.c +21 -0
index 6d1a0d8eebc4..a8c4680b0c47 100644
@@ -312,6 +312,21 @@ static bool machine_get_suppress_vmdesc(Object *obj, Error **errp)
     return ms->suppress_vmdesc;
 }
 
+static void machine_set_enforce_config_section(Object *obj, bool value,
+                                             Error **errp)
+{
+    MachineState *ms = MACHINE(obj);
+
+    ms->enforce_config_section = value;
+}
+
+static bool machine_get_enforce_config_section(Object *obj, Error **errp)
+{
+    MachineState *ms = MACHINE(obj);
+
+    return ms->enforce_config_section;
+}
+
 static int error_on_sysbus_device(SysBusDevice *sbdev, void *opaque)
 {
     error_report("Option '-device %s' cannot be handled by this machine",
@@ -467,6 +482,12 @@ static void machine_initfn(Object *obj)
     object_property_set_description(obj, "suppress-vmdesc",
                                     "Set on to disable self-describing migration",
                                     NULL);
+    object_property_add_bool(obj, "enforce-config-section",
+                             machine_get_enforce_config_section,
+                             machine_set_enforce_config_section, NULL);
+    object_property_set_description(obj, "enforce-config-section",
+                                    "Set on to enforce configuration section migration",
+                                    NULL);
 
     /* Register notifier when init is done for sysbus sanity checks */
     ms->sysbus_notifier.notify = machine_init_notify;
include/hw/boards.h +1 -0
index 0f30959e2e3b..cfdf8d10cfcd 100644
@@ -128,6 +128,7 @@ struct MachineState {
     char *firmware;
     bool iommu;
     bool suppress_vmdesc;
+    bool enforce_config_section;
 
     ram_addr_t ram_size;
     ram_addr_t maxram_size;
migration/savevm.c +8 -2
index 94f2894243ce..2fc57363674f 100644
@@ -878,13 +878,19 @@ bool qemu_savevm_state_blocked(Error **errp)
     return false;
 }
 
+static bool enforce_config_section(void)
+{
+    MachineState *machine = MACHINE(qdev_get_machine());
+    return machine->enforce_config_section;
+}
+
 void qemu_savevm_state_header(QEMUFile *f)
 {
     trace_savevm_state_header();
     qemu_put_be32(f, QEMU_VM_FILE_MAGIC);
     qemu_put_be32(f, QEMU_VM_FILE_VERSION);
 
-    if (!savevm_state.skip_configuration) {
+    if (!savevm_state.skip_configuration || enforce_config_section()) {
         qemu_put_byte(f, QEMU_VM_CONFIGURATION);
         vmstate_save_state(f, &vmstate_configuration, &savevm_state, 0);
     }
@@ -1875,7 +1881,7 @@ int qemu_loadvm_state(QEMUFile *f)
         return -ENOTSUP;
     }
 
-    if (!savevm_state.skip_configuration) {
+    if (!savevm_state.skip_configuration || enforce_config_section()) {
         if (qemu_get_byte(f) != QEMU_VM_CONFIGURATION) {
             error_report("Configuration section missing");
             return -EINVAL;
qemu-options.hx +2 -1
index 2f0465eeb1d1..8d81e310f2bf 100644
@@ -43,7 +43,8 @@ DEF("machine", HAS_ARG, QEMU_OPTION_machine, \
     "                aes-key-wrap=on|off controls support for AES key wrapping (default=on)\n"
     "                dea-key-wrap=on|off controls support for DEA key wrapping (default=on)\n"
     "                suppress-vmdesc=on|off disables self-describing migration (default=off)\n"
-    "                nvdimm=on|off controls NVDIMM support (default=off)\n",
+    "                nvdimm=on|off controls NVDIMM support (default=off)\n"
+    "                enforce-config-section=on|off enforce configuration section migration (default=off)\n",
     QEMU_ARCH_ALL)
 STEXI
 @item -machine [type=]@var{name}[,prop=@var{value}[,...]]
Reviewed-by on v3 2/2
#6 lore raw

Re: [Qemu-devel] [PATCH v3 2/2] migration: allow machine to enforce configuration section migration

In reply to Greg Kurz
Quoted 11 lines · Greg Kurz

Migration of pseries-2.3 doesn't have configuration section. Unfortunately, QEMU 2.4/2.4.1/2.5 are buggy and always stream and expect the configuration section, and break migration both ways.

This patch introduces a property which allows to enforce a configuration section for machines who don't have one.

It can be set at startup:

-machine enforce-config-section=on

Quoted 8 lines

or later from the QEMU monitor:

qom-set /machine enforce-config-section on

It is up to the tooling to set or unset this property according to the version of the QEMU at the other end of the pipe.

As said elsewere, we should have catch this one on 2.4. Once we are here, I can't see a better way to fix the mess :-()

Tested-by on the v3 series
#7 lore raw
In reply to Greg Kurz
Quoted 19 lines · Greg Kurz

QEMU 2.4 broke the migration of old pseries machine with the addition of configuration sections, which are sent unconditionally.

We assume that QEMU 2.3 is more deployed than any newer release (based on the versions currently shipped by most distros). This v3 series hence reverses the logic from v2: it now fully fixes migration of old pseries from/to QEMU 2.3 and provides a manual workaround for the QEMU 2.4/2.4.1/2.5 case.

With this series, I could migrate the same pseries-2.3 instance in a full 2.3->2.6->2.5->2.6->2.4->2.6->2.3 cycle.

---

Greg Kurz (2):
spapr: skip configuration section during migration of older machines
migration: allow machine to enforce configuration section migration

Quoted 6 lines
 hw/core/machine.c   |   21 +++++++++++++++++++++
 hw/ppc/spapr.c      |    1 +
 include/hw/boards.h |    1 +
 migration/savevm.c  |   10 ++++++++--
 qemu-options.hx     |    3 ++-
 5 files changed, 33 insertions(+), 3 deletions(-)

For the series

Results of tests:

pseries-2.3

    qemu-2.3.0 -> qemu-master: OK
    qemu-2.3.1 -> qemu-master: OK
    qemu-2.4.0 -> qemu-master: OK with qom-set
    qemu-2.4.1 -> qemu-master: OK with qom-set
    qemu-2.5.0 -> qemu-master: OK with qom-set
    qemu-master -> qemu-2.3.0: OK
    qemu-master -> qemu-2.3.1: OK
    qemu-master -> qemu-2.4.0: OK with qom-set
    qemu-master -> qemu-2.4.1: OK with qom-set
    qemu-master -> qemu-2.5.0: OK with qom-set
    qemu-master -> qemu-master: OK

pseries-2.4, pseries-2.5 and pseries-2.6 works well with the patch applied too.

master is "b527c9b qcow2: Write full header on image creation" + this series

Laurent

author
#8 lore raw
Quoted 46 lines · On Thu, 18 Feb 2016 21:00:38 +0100 Laurent Vivier <[email protected]> wrote:
Quoted 19 lines · Greg Kurz

QEMU 2.4 broke the migration of old pseries machine with the addition of configuration sections, which are sent unconditionally.

We assume that QEMU 2.3 is more deployed than any newer release (based on the versions currently shipped by most distros). This v3 series hence reverses the logic from v2: it now fully fixes migration of old pseries from/to QEMU 2.3 and provides a manual workaround for the QEMU 2.4/2.4.1/2.5 case.

With this series, I could migrate the same pseries-2.3 instance in a full 2.3->2.6->2.5->2.6->2.4->2.6->2.3 cycle.

---

Greg Kurz (2):
spapr: skip configuration section during migration of older machines
migration: allow machine to enforce configuration section migration

Quoted 6 lines
 hw/core/machine.c   |   21 +++++++++++++++++++++
 hw/ppc/spapr.c      |    1 +
 include/hw/boards.h |    1 +
 migration/savevm.c  |   10 ++++++++--
 qemu-options.hx     |    3 ++-
 5 files changed, 33 insertions(+), 3 deletions(-)  

For the series

Results of tests:

pseries-2.3

    qemu-2.3.0 -> qemu-master: OK
    qemu-2.3.1 -> qemu-master: OK
    qemu-2.4.0 -> qemu-master: OK with qom-set
    qemu-2.4.1 -> qemu-master: OK with qom-set
    qemu-2.5.0 -> qemu-master: OK with qom-set
    qemu-master -> qemu-2.3.0: OK
    qemu-master -> qemu-2.3.1: OK
    qemu-master -> qemu-2.4.0: OK with qom-set
    qemu-master -> qemu-2.4.1: OK with qom-set
    qemu-master -> qemu-2.5.0: OK with qom-set
    qemu-master -> qemu-master: OK
Quoted 7 lines

pseries-2.4, pseries-2.5 and pseries-2.6 works well with the patch applied too.

master is "b527c9b qcow2: Write full header on image creation" + this series

Laurent

Thanks for the reviewing and testing !

Cheers.

--
Greg

#9 lore raw
In reply to Greg Kurz
Quoted 11 lines · Greg Kurz

QEMU 2.4 broke the migration of old pseries machine with the addition of configuration sections, which are sent unconditionally.

We assume that QEMU 2.3 is more deployed than any newer release (based on the versions currently shipped by most distros). This v3 series hence reverses the logic from v2: it now fully fixes migration of old pseries from/to QEMU 2.3 and provides a manual workaround for the QEMU 2.4/2.4.1/2.5 case.

With this series, I could migrate the same pseries-2.3 instance in a full 2.3->2.6->2.5->2.6->2.4->2.6->2.3 cycle.

Sorry, I've lost track slightly here. Does this series apply on top of, or instead of your earlier series that peeks for the config section?

Quoted 14 lines

---

Greg Kurz (2):
spapr: skip configuration section during migration of older machines
migration: allow machine to enforce configuration section migration

 hw/core/machine.c   |   21 +++++++++++++++++++++
 hw/ppc/spapr.c      |    1 +
 include/hw/boards.h |    1 +
 migration/savevm.c  |   10 ++++++++--
 qemu-options.hx     |    3 ++-
 5 files changed, 33 insertions(+), 3 deletions(-)
Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
author
#10 lore raw
Quoted 10 lines · On Fri, 19 Feb 2016 11:11:47 +1100 David Gibson <[email protected]>…
Quoted 9 lines · Greg Kurz

QEMU 2.4 broke the migration of old pseries machine with the addition of configuration sections, which are sent unconditionally.

We assume that QEMU 2.3 is more deployed than any newer release (based on the versions currently shipped by most distros). This v3 series hence reverses the logic from v2: it now fully fixes migration of old pseries from/to QEMU 2.3 and provides a manual workaround for the QEMU 2.4/2.4.1/2.5 case.

Quoted 7 lines
Quoted 2 lines

With this series, I could migrate the same pseries-2.3 instance in a full 2.3->2.6->2.5->2.6->2.4->2.6->2.3 cycle.

Sorry, I've lost track slightly here. Does this series apply on top of, or instead of your earlier series that peeks for the config section?

This v3 series applies instead of the v2 that peeks for the config section.

It was suggested by Laurent during review, and motivated by your decision to favor fixing 2.3 over 2.4.

As shown in Laurent's detailed test report, migration from/to 2.3.x now works out of the box and 2.4.x/2.5 requires qom-set.

I was also feeling a bit uncomfortable with all these machine properties to disable the configuration section, which was explicitly coded to be non-optional according to the changelog of commit 61964c23. The logic inversion in v3 seem to be friendlier with the configuration section design.

Juan, could you share your thoughts ?

Thanks.

--
Greg

Quoted 15 lines
Quoted 14 lines

---

Greg Kurz (2):
spapr: skip configuration section during migration of older machines
migration: allow machine to enforce configuration section migration

 hw/core/machine.c   |   21 +++++++++++++++++++++
 hw/ppc/spapr.c      |    1 +
 include/hw/boards.h |    1 +
 migration/savevm.c  |   10 ++++++++--
 qemu-options.hx     |    3 ++-
 5 files changed, 33 insertions(+), 3 deletions(-)
#11 lore raw
Quoted 16 lines · Greg Kurz
Quoted 13 lines · On Fri, 19 Feb 2016 11:11:47 +1100 David Gibson <[email protected]>…
Quoted 11 lines · Greg Kurz

QEMU 2.4 broke the migration of old pseries machine with the addition of configuration sections, which are sent unconditionally.

We assume that QEMU 2.3 is more deployed than any newer release (based on the versions currently shipped by most distros). This v3 series hence reverses the logic from v2: it now fully fixes migration of old pseries from/to QEMU 2.3 and provides a manual workaround for the QEMU 2.4/2.4.1/2.5 case.

With this series, I could migrate the same pseries-2.3 instance in a full 2.3->2.6->2.5->2.6->2.4->2.6->2.3 cycle.

Quoted 6 lines
Quoted 4 lines

Sorry, I've lost track slightly here. Does this series apply on top of, or instead of your earlier series that peeks for the config section?

This v3 series applies instead of the v2 that peeks for the config section.

Ok, thanks for the clarification.

Quoted 6 lines

It was suggested by Laurent during review, and motivated by your decision to favor fixing 2.3 over 2.4.

As shown in Laurent's detailed test report, migration from/to 2.3.x now works out of the box and 2.4.x/2.5 requires qom-set.

Quoted 6 lines

I was also feeling a bit uncomfortable with all these machine properties to disable the configuration section, which was explicitly coded to be non-optional according to the changelog of commit 61964c23. The logic inversion in v3 seem to be friendlier with the configuration section design.

Juan, could you share your thoughts ?

With an ack from Juan I'll be happy to merge this to ppc-for-2.6.

Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
author
#12 lore raw
Quoted 32 lines · On Mon, 22 Feb 2016 12:09:12 +1100 David Gibson <[email protected]>…
Quoted 16 lines · Greg Kurz
Quoted 13 lines · On Fri, 19 Feb 2016 11:11:47 +1100 David Gibson <[email protected]>…
Quoted 11 lines · Greg Kurz

QEMU 2.4 broke the migration of old pseries machine with the addition of configuration sections, which are sent unconditionally.

We assume that QEMU 2.3 is more deployed than any newer release (based on the versions currently shipped by most distros). This v3 series hence reverses the logic from v2: it now fully fixes migration of old pseries from/to QEMU 2.3 and provides a manual workaround for the QEMU 2.4/2.4.1/2.5 case.

With this series, I could migrate the same pseries-2.3 instance in a full 2.3->2.6->2.5->2.6->2.4->2.6->2.3 cycle.

Quoted 6 lines
Quoted 4 lines

Sorry, I've lost track slightly here. Does this series apply on top of, or instead of your earlier series that peeks for the config section?

This v3 series applies instead of the v2 that peeks for the config section.

Ok, thanks for the clarification.

Quoted 6 lines

It was suggested by Laurent during review, and motivated by your decision to favor fixing 2.3 over 2.4.

As shown in Laurent's detailed test report, migration from/to 2.3.x now works out of the box and 2.4.x/2.5 requires qom-set.

Quoted 9 lines
Quoted 6 lines

I was also feeling a bit uncomfortable with all these machine properties to disable the configuration section, which was explicitly coded to be non-optional according to the changelog of commit 61964c23. The logic inversion in v3 seem to be friendlier with the configuration section design.

Juan, could you share your thoughts ?

With an ack from Juan I'll be happy to merge this to ppc-for-2.6.

And the patches even got reviewed by Juan ! Please merge ! :)

#13 lore raw
Quoted 40 lines · Greg Kurz
Quoted 37 lines · On Mon, 22 Feb 2016 12:09:12 +1100 David Gibson <[email protected]>…
Quoted 16 lines · Greg Kurz
Quoted 13 lines · On Fri, 19 Feb 2016 11:11:47 +1100 David Gibson <[email protected]>…
Quoted 11 lines · Greg Kurz

QEMU 2.4 broke the migration of old pseries machine with the addition of configuration sections, which are sent unconditionally.

We assume that QEMU 2.3 is more deployed than any newer release (based on the versions currently shipped by most distros). This v3 series hence reverses the logic from v2: it now fully fixes migration of old pseries from/to QEMU 2.3 and provides a manual workaround for the QEMU 2.4/2.4.1/2.5 case.

With this series, I could migrate the same pseries-2.3 instance in a full 2.3->2.6->2.5->2.6->2.4->2.6->2.3 cycle.

Quoted 6 lines
Quoted 4 lines

Sorry, I've lost track slightly here. Does this series apply on top of, or instead of your earlier series that peeks for the config section?

This v3 series applies instead of the v2 that peeks for the config section.

Ok, thanks for the clarification.

Quoted 11 lines

It was suggested by Laurent during review, and motivated by your decision to favor fixing 2.3 over 2.4.

As shown in Laurent's detailed test report, migration from/to 2.3.x now works out of the box and 2.4.x/2.5 requires qom-set.

I was also feeling a bit uncomfortable with all these machine properties to disable the configuration section, which was explicitly coded to be non-optional according to the changelog of commit 61964c23. The logic inversion in v3 seem to be friendlier with the configuration section design.

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

Juan, could you share your thoughts ?

With an ack from Juan I'll be happy to merge this to ppc-for-2.6.

And the patches even got reviewed by Juan ! Please merge ! :)

Ugh, sorry. Thought I already had. Merged now.

Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
#14 lore raw
In reply to Greg Kurz
Quoted 29 lines · Greg Kurz
Quoted 10 lines · On Fri, 19 Feb 2016 11:11:47 +1100 David Gibson <[email protected]>…
Quoted 9 lines · Greg Kurz

QEMU 2.4 broke the migration of old pseries machine with the addition of configuration sections, which are sent unconditionally.

We assume that QEMU 2.3 is more deployed than any newer release (based on the versions currently shipped by most distros). This v3 series hence reverses the logic from v2: it now fully fixes migration of old pseries from/to QEMU 2.3 and provides a manual workaround for the QEMU 2.4/2.4.1/2.5 case.

Quoted 7 lines
Quoted 2 lines

With this series, I could migrate the same pseries-2.3 instance in a full 2.3->2.6->2.5->2.6->2.4->2.6->2.3 cycle.

Sorry, I've lost track slightly here. Does this series apply on top of, or instead of your earlier series that peeks for the config section?

This v3 series applies instead of the v2 that peeks for the config section.

It was suggested by Laurent during review, and motivated by your decision to favor fixing 2.3 over 2.4.

As shown in Laurent's detailed test report, migration from/to 2.3.x now works out of the box and 2.4.x/2.5 requires qom-set.

Quoted 6 lines

I was also feeling a bit uncomfortable with all these machine properties to disable the configuration section, which was explicitly coded to be non-optional according to the changelog of commit 61964c23. The logic inversion in v3 seem to be friendlier with the configuration section design.

Juan, could you share your thoughts ?

As said previously, we don't have any better fix. We could try to make the "enforce" thing only for some machine types, but I guess that it would make the mess even bigger :-(

And on an unrelated topic, I guess we need to "agree" in a way to add new features to migration for all machine types. Right now we have:
- two x86 boards
- now s390
- and now ppc
- and I guess arm is on the way

So, I guess we would need something like of what we have on hw/i386/pc_piix.c

static void pc_compat_2_3(MachineState *machine)

{
    PCMachineState *pcms = PC_MACHINE(machine);
    savevm_skip_section_footers();
    if (kvm_enabled()) {
        pcms->smm = ON_OFF_AUTO_OFF;
    }
    global_state_set_optional();
    savevm_skip_configuration();
}

Really, we need something like this

static void migration_compat_2_3(MachineState *machine)

{
    savevm_skip_section_footers();
    global_state_set_optional();
    savevm_skip_configuration();
}

to be included in every machine that cares about migration. Is there ane easy way/place where to do this globaly?

Later, Juan.

author
#15 lore raw
Quoted 64 lines · On Tue, 23 Feb 2016 09:31:10 +0100 Juan Quintela <[email protected]> wrote:
Quoted 29 lines · Greg Kurz
Quoted 10 lines · On Fri, 19 Feb 2016 11:11:47 +1100 David Gibson <[email protected]>…
Quoted 9 lines · Greg Kurz

QEMU 2.4 broke the migration of old pseries machine with the addition of configuration sections, which are sent unconditionally.

We assume that QEMU 2.3 is more deployed than any newer release (based on the versions currently shipped by most distros). This v3 series hence reverses the logic from v2: it now fully fixes migration of old pseries from/to QEMU 2.3 and provides a manual workaround for the QEMU 2.4/2.4.1/2.5 case.

Quoted 7 lines
Quoted 2 lines

With this series, I could migrate the same pseries-2.3 instance in a full 2.3->2.6->2.5->2.6->2.4->2.6->2.3 cycle.

Sorry, I've lost track slightly here. Does this series apply on top of, or instead of your earlier series that peeks for the config section?

This v3 series applies instead of the v2 that peeks for the config section.

It was suggested by Laurent during review, and motivated by your decision to favor fixing 2.3 over 2.4.

As shown in Laurent's detailed test report, migration from/to 2.3.x now works out of the box and 2.4.x/2.5 requires qom-set.

Quoted 6 lines

I was also feeling a bit uncomfortable with all these machine properties to disable the configuration section, which was explicitly coded to be non-optional according to the changelog of commit 61964c23. The logic inversion in v3 seem to be friendlier with the configuration section design.

Juan, could you share your thoughts ?

As said previously, we don't have any better fix. We could try to make the "enforce" thing only for some machine types, but I guess that it would make the mess even bigger :-(

And on an unrelated topic, I guess we need to "agree" in a way to add new features to migration for all machine types. Right now we have:
- two x86 boards
- now s390
- and now ppc
- and I guess arm is on the way

So, I guess we would need something like of what we have on hw/i386/pc_piix.c

static void pc_compat_2_3(MachineState *machine)

{
    PCMachineState *pcms = PC_MACHINE(machine);
    savevm_skip_section_footers();
    if (kvm_enabled()) {
        pcms->smm = ON_OFF_AUTO_OFF;
    }
    global_state_set_optional();
    savevm_skip_configuration();
}
Quoted 9 lines

Really, we need something like this

static void migration_compat_2_3(MachineState *machine)

{
    savevm_skip_section_footers();
    global_state_set_optional();
    savevm_skip_configuration();
}

Indeed, there is code duplication here... and it is not the first time:
pseries is also missing a compat property for the vmdesc section. In fact, people change migration and often fix x86 only in a followup patch.

Quoted 3 lines

to be included in every machine that cares about migration. Is there ane easy way/place where to do this globaly?

There has been a first round of compat stuff refactoring with commit 68a27b208a, which introduced include/hw/compat.h.

Maybe we can declare the migration_compat_* helpers in this header and put the code in a new hw/core/compat.c file ? Or add this to hw/core/machine.c ?

I'll give a try and send a series.

Quoted 2 lines

Later, Juan.

Thanks !

--
Greg

author
#16 lore raw
Quoted 84 lines · On Tue, 23 Feb 2016 11:01:00 +0100 Greg Kurz <[email protected]> wrote:
Quoted 64 lines · On Tue, 23 Feb 2016 09:31:10 +0100 Juan Quintela <[email protected]> wrote:
Quoted 29 lines · Greg Kurz
Quoted 10 lines · On Fri, 19 Feb 2016 11:11:47 +1100 David Gibson <[email protected]>…
Quoted 9 lines · Greg Kurz

QEMU 2.4 broke the migration of old pseries machine with the addition of configuration sections, which are sent unconditionally.

We assume that QEMU 2.3 is more deployed than any newer release (based on the versions currently shipped by most distros). This v3 series hence reverses the logic from v2: it now fully fixes migration of old pseries from/to QEMU 2.3 and provides a manual workaround for the QEMU 2.4/2.4.1/2.5 case.

Quoted 7 lines
Quoted 2 lines

With this series, I could migrate the same pseries-2.3 instance in a full 2.3->2.6->2.5->2.6->2.4->2.6->2.3 cycle.

Sorry, I've lost track slightly here. Does this series apply on top of, or instead of your earlier series that peeks for the config section?

This v3 series applies instead of the v2 that peeks for the config section.

It was suggested by Laurent during review, and motivated by your decision to favor fixing 2.3 over 2.4.

As shown in Laurent's detailed test report, migration from/to 2.3.x now works out of the box and 2.4.x/2.5 requires qom-set.

Quoted 6 lines

I was also feeling a bit uncomfortable with all these machine properties to disable the configuration section, which was explicitly coded to be non-optional according to the changelog of commit 61964c23. The logic inversion in v3 seem to be friendlier with the configuration section design.

Juan, could you share your thoughts ?

As said previously, we don't have any better fix. We could try to make the "enforce" thing only for some machine types, but I guess that it would make the mess even bigger :-(

And on an unrelated topic, I guess we need to "agree" in a way to add new features to migration for all machine types. Right now we have:
- two x86 boards
- now s390
- and now ppc
- and I guess arm is on the way

So, I guess we would need something like of what we have on hw/i386/pc_piix.c

static void pc_compat_2_3(MachineState *machine)

{
    PCMachineState *pcms = PC_MACHINE(machine);
    savevm_skip_section_footers();
    if (kvm_enabled()) {
        pcms->smm = ON_OFF_AUTO_OFF;
    }
    global_state_set_optional();
    savevm_skip_configuration();
}
Quoted 9 lines

Really, we need something like this

static void migration_compat_2_3(MachineState *machine)

{
    savevm_skip_section_footers();
    global_state_set_optional();
    savevm_skip_configuration();
}

Indeed, there is code duplication here... and it is not the first time:
pseries is also missing a compat property for the vmdesc section. In fact, people change migration and often fix x86 only in a followup patch.

Quoted 3 lines

to be included in every machine that cares about migration. Is there ane easy way/place where to do this globaly?

Quoted 9 lines

There has been a first round of compat stuff refactoring with commit 68a27b208a, which introduced include/hw/compat.h.

Maybe we can declare the migration_compat_* helpers in this header and put the code in a new hw/core/compat.c file ? Or add this to hw/core/machine.c ?

I'll give a try and send a series.

Hmm... looking at the pc code, I've stumbled accross this commit:

commit 798595075bf51c7e3125d260a19d860b9aa63e69

Author: Eduardo Habkost <[email protected]>
Date:   Mon Sep 28 15:07:21 2015 -0300

pc: Add a comment explaining why pc_compat_2_4() doesn't exist

which explains that these compat helpers are deprecated for new pc machine types... but I assume (maybe wrongly?) that it goes the same for all machine types. And indeed, I could not find recent pc, pseries or s390-ccw machine using this construct.

In the end, I'm not sure it is worth refactoring the code for older machines if new machines are expected to handle compat issues differently.

Quoted 9 lines
Quoted 2 lines

Later, Juan.

Thanks !

--
Greg

#17 lore raw
In reply to Greg Kurz
Quoted 11 lines · Greg Kurz

QEMU 2.4 broke the migration of old pseries machine with the addition of configuration sections, which are sent unconditionally.

We assume that QEMU 2.3 is more deployed than any newer release (based on the versions currently shipped by most distros). This v3 series hence reverses the logic from v2: it now fully fixes migration of old pseries from/to QEMU 2.3 and provides a manual workaround for the QEMU 2.4/2.4.1/2.5 case.

With this series, I could migrate the same pseries-2.3 instance in a full 2.3->2.6->2.5->2.6->2.4->2.6->2.3 cycle.

I've tested all possible combinations, with and without these patches. The result is here:

http://wiki.qemu.org/Migration/Compatibility/pseries

- Migration is totally broken in qemu-2.2
- without these patches, migration cannot be done from/to qemu-2.3
- with these patches, qemu-2.3 can migrate to/from qemu-2.6
- 1st patch breaks pseries-2.2, pseries-2.3 migration from/to qemu-2.4/2.5 but 2nd patch allows to fix this manually.

Feel free to update the page.

Laurent

author
#18 lore raw
Quoted 10 lines · On Fri, 19 Feb 2016 15:41:10 +0100 Laurent Vivier <[email protected]> wrote:
Quoted 9 lines · Greg Kurz

QEMU 2.4 broke the migration of old pseries machine with the addition of configuration sections, which are sent unconditionally.

We assume that QEMU 2.3 is more deployed than any newer release (based on the versions currently shipped by most distros). This v3 series hence reverses the logic from v2: it now fully fixes migration of old pseries from/to QEMU 2.3 and provides a manual workaround for the QEMU 2.4/2.4.1/2.5 case.

Quoted 8 lines
Quoted 2 lines

With this series, I could migrate the same pseries-2.3 instance in a full 2.3->2.6->2.5->2.6->2.4->2.6->2.3 cycle.

I've tested all possible combinations, with and without these patches. The result is here:

http://wiki.qemu.org/Migration/Compatibility/pseries

Excellent ! Thanks for setting this up.

Quoted 1 line

- Migration is totally broken in qemu-2.2

Hmm... I get another error with qemu-2.2:

htab_load() bad index -65536 (0+8454 entries) in htab stream (htab_shift=26)
qemu: warning: error while loading state section id 20
qemu-system-ppc64: load of migration failed: Invalid argument

but my command line is different from yours.

Quoted 9 lines

- without these patches, migration cannot be done from/to qemu-2.3
- with these patches, qemu-2.3 can migrate to/from qemu-2.6
- 1st patch breaks pseries-2.2, pseries-2.3 migration from/to qemu-2.4/2.5 but 2nd patch allows to fix this manually.

Feel free to update the page.

Laurent

author
#19 lore raw
Quoted 24 lines · On Fri, 19 Feb 2016 17:27:33 +0100 Greg Kurz <[email protected]> wrote:
Quoted 10 lines · On Fri, 19 Feb 2016 15:41:10 +0100 Laurent Vivier <[email protected]> wrote:
Quoted 9 lines · Greg Kurz

QEMU 2.4 broke the migration of old pseries machine with the addition of configuration sections, which are sent unconditionally.

We assume that QEMU 2.3 is more deployed than any newer release (based on the versions currently shipped by most distros). This v3 series hence reverses the logic from v2: it now fully fixes migration of old pseries from/to QEMU 2.3 and provides a manual workaround for the QEMU 2.4/2.4.1/2.5 case.

Quoted 8 lines
Quoted 2 lines

With this series, I could migrate the same pseries-2.3 instance in a full 2.3->2.6->2.5->2.6->2.4->2.6->2.3 cycle.

I've tested all possible combinations, with and without these patches. The result is here:

http://wiki.qemu.org/Migration/Compatibility/pseries

Excellent ! Thanks for setting this up.

Quoted 8 lines
Quoted 1 line

- Migration is totally broken in qemu-2.2

Hmm... I get another error with qemu-2.2:

htab_load() bad index -65536 (0+8454 entries) in htab stream (htab_shift=26)
qemu: warning: error while loading state section id 20
qemu-system-ppc64: load of migration failed: Invalid argument

and this happens on my ppc64le host because QEMU 2.2 doesn't have:

commit e094c4c12f33a1c965f5af02f33968a337348739

Author: Cédric Le Goater <[email protected]>
Date:   Mon Nov 3 16:14:50 2014 +0100

target-ppc: explicitly save page table headers in big endian

Quoted 13 lines

but my command line is different from yours.

Quoted 9 lines

- without these patches, migration cannot be done from/to qemu-2.3
- with these patches, qemu-2.3 can migrate to/from qemu-2.6
- 1st patch breaks pseries-2.2, pseries-2.3 migration from/to qemu-2.4/2.5 but 2nd patch allows to fix this manually.

Feel free to update the page.

Laurent