qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v3 0/2] Fix migration of old pseries
@ 2016-02-18 11:32 Greg Kurz
  2016-02-18 11:32 ` [Qemu-devel] [PATCH v3 1/2] spapr: skip configuration section during migration of older machines Greg Kurz
                   ` (4 more replies)
  0 siblings, 5 replies; 20+ messages in thread
From: Greg Kurz @ 2016-02-18 11:32 UTC (permalink / raw)
  To: Juan Quintela
  Cc: Laurent Vivier, qemu-devel, Dr. David Alan Gilbert, qemu-ppc,
	Amit Shah, David Gibson

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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Qemu-devel] [PATCH v3 1/2] spapr: skip configuration section during migration of older machines
  2016-02-18 11:32 [Qemu-devel] [PATCH v3 0/2] Fix migration of old pseries Greg Kurz
@ 2016-02-18 11:32 ` Greg Kurz
  2016-02-18 19:57   ` Laurent Vivier
  2016-02-23  8:23   ` Juan Quintela
  2016-02-18 11:32 ` [Qemu-devel] [PATCH v3 2/2] migration: allow machine to enforce configuration section migration Greg Kurz
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 20+ messages in thread
From: Greg Kurz @ 2016-02-18 11:32 UTC (permalink / raw)
  To: Juan Quintela
  Cc: Laurent Vivier, qemu-devel, Dr. David Alan Gilbert, qemu-ppc,
	Amit Shah, David Gibson

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
Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
---
 hw/ppc/spapr.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 5bd8fd3ef842..bca7cb8a5d27 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -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)

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [Qemu-devel] [PATCH v3 2/2] migration: allow machine to enforce configuration section migration
  2016-02-18 11:32 [Qemu-devel] [PATCH v3 0/2] Fix migration of old pseries Greg Kurz
  2016-02-18 11:32 ` [Qemu-devel] [PATCH v3 1/2] spapr: skip configuration section during migration of older machines Greg Kurz
@ 2016-02-18 11:32 ` Greg Kurz
  2016-02-18 19:57   ` Laurent Vivier
  2016-02-23  8:24   ` Juan Quintela
  2016-02-18 20:00 ` [Qemu-devel] [PATCH v3 0/2] Fix migration of old pseries Laurent Vivier
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 20+ messages in thread
From: Greg Kurz @ 2016-02-18 11:32 UTC (permalink / raw)
  To: Juan Quintela
  Cc: Laurent Vivier, qemu-devel, Dr. David Alan Gilbert, qemu-ppc,
	Amit Shah, David Gibson

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.

Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
---
 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(-)

diff --git a/hw/core/machine.c b/hw/core/machine.c
index 6d1a0d8eebc4..a8c4680b0c47 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -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;
diff --git a/include/hw/boards.h b/include/hw/boards.h
index 0f30959e2e3b..cfdf8d10cfcd 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -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;
diff --git a/migration/savevm.c b/migration/savevm.c
index 94f2894243ce..2fc57363674f 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -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;
diff --git a/qemu-options.hx b/qemu-options.hx
index 2f0465eeb1d1..8d81e310f2bf 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -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}[,...]]

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] [PATCH v3 1/2] spapr: skip configuration section during migration of older machines
  2016-02-18 11:32 ` [Qemu-devel] [PATCH v3 1/2] spapr: skip configuration section during migration of older machines Greg Kurz
@ 2016-02-18 19:57   ` Laurent Vivier
  2016-02-23  8:23   ` Juan Quintela
  1 sibling, 0 replies; 20+ messages in thread
From: Laurent Vivier @ 2016-02-18 19:57 UTC (permalink / raw)
  To: Greg Kurz, Juan Quintela
  Cc: Amit Shah, David Gibson, qemu-ppc, qemu-devel, Dr. David Alan Gilbert



On 18/02/2016 12:32, Greg Kurz wrote:
> 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
> Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>

Reviewed-by: Laurent Vivier <lvivier@redhat.com>

> ---
>  hw/ppc/spapr.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 5bd8fd3ef842..bca7cb8a5d27 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -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)
> 

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] [PATCH v3 2/2] migration: allow machine to enforce configuration section migration
  2016-02-18 11:32 ` [Qemu-devel] [PATCH v3 2/2] migration: allow machine to enforce configuration section migration Greg Kurz
@ 2016-02-18 19:57   ` Laurent Vivier
  2016-02-23  8:24   ` Juan Quintela
  1 sibling, 0 replies; 20+ messages in thread
From: Laurent Vivier @ 2016-02-18 19:57 UTC (permalink / raw)
  To: Greg Kurz, Juan Quintela
  Cc: Amit Shah, David Gibson, qemu-ppc, qemu-devel, Dr. David Alan Gilbert



On 18/02/2016 12:32, Greg Kurz wrote:
> 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.
> 
> Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>

Reviewed-by: Laurent Vivier <lvivier@redhat.com>

> ---
>  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(-)
> 
> diff --git a/hw/core/machine.c b/hw/core/machine.c
> index 6d1a0d8eebc4..a8c4680b0c47 100644
> --- a/hw/core/machine.c
> +++ b/hw/core/machine.c
> @@ -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;
> diff --git a/include/hw/boards.h b/include/hw/boards.h
> index 0f30959e2e3b..cfdf8d10cfcd 100644
> --- a/include/hw/boards.h
> +++ b/include/hw/boards.h
> @@ -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;
> diff --git a/migration/savevm.c b/migration/savevm.c
> index 94f2894243ce..2fc57363674f 100644
> --- a/migration/savevm.c
> +++ b/migration/savevm.c
> @@ -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;
> diff --git a/qemu-options.hx b/qemu-options.hx
> index 2f0465eeb1d1..8d81e310f2bf 100644
> --- a/qemu-options.hx
> +++ b/qemu-options.hx
> @@ -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}[,...]]
> 

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] [PATCH v3 0/2] Fix migration of old pseries
  2016-02-18 11:32 [Qemu-devel] [PATCH v3 0/2] Fix migration of old pseries Greg Kurz
  2016-02-18 11:32 ` [Qemu-devel] [PATCH v3 1/2] spapr: skip configuration section during migration of older machines Greg Kurz
  2016-02-18 11:32 ` [Qemu-devel] [PATCH v3 2/2] migration: allow machine to enforce configuration section migration Greg Kurz
@ 2016-02-18 20:00 ` Laurent Vivier
  2016-02-19  6:42   ` Greg Kurz
  2016-02-19  0:11 ` David Gibson
  2016-02-19 14:41 ` Laurent Vivier
  4 siblings, 1 reply; 20+ messages in thread
From: Laurent Vivier @ 2016-02-18 20:00 UTC (permalink / raw)
  To: Greg Kurz, Juan Quintela
  Cc: Amit Shah, David Gibson, qemu-ppc, qemu-devel, Dr. David Alan Gilbert



On 18/02/2016 12:32, Greg Kurz wrote:
> 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(-)

For the series
Tested-by: Laurent Vivier <lvivier@redhat.com>

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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] [PATCH v3 0/2] Fix migration of old pseries
  2016-02-18 11:32 [Qemu-devel] [PATCH v3 0/2] Fix migration of old pseries Greg Kurz
                   ` (2 preceding siblings ...)
  2016-02-18 20:00 ` [Qemu-devel] [PATCH v3 0/2] Fix migration of old pseries Laurent Vivier
@ 2016-02-19  0:11 ` David Gibson
  2016-02-19  7:59   ` Greg Kurz
  2016-02-19 14:41 ` Laurent Vivier
  4 siblings, 1 reply; 20+ messages in thread
From: David Gibson @ 2016-02-19  0:11 UTC (permalink / raw)
  To: Greg Kurz
  Cc: Laurent Vivier, Juan Quintela, qemu-devel,
	Dr. David Alan Gilbert, qemu-ppc, Amit Shah

[-- Attachment #1: Type: text/plain, Size: 1429 bytes --]

On Thu, Feb 18, 2016 at 12:32:11PM +0100, Greg Kurz wrote:
> 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?

> ---
> 
> 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(-)
> 

-- 
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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] [PATCH v3 0/2] Fix migration of old pseries
  2016-02-18 20:00 ` [Qemu-devel] [PATCH v3 0/2] Fix migration of old pseries Laurent Vivier
@ 2016-02-19  6:42   ` Greg Kurz
  0 siblings, 0 replies; 20+ messages in thread
From: Greg Kurz @ 2016-02-19  6:42 UTC (permalink / raw)
  To: Laurent Vivier
  Cc: Juan Quintela, qemu-devel, Dr. David Alan Gilbert, qemu-ppc,
	Amit Shah, David Gibson

On Thu, 18 Feb 2016 21:00:38 +0100
Laurent Vivier <lvivier@redhat.com> wrote:

> On 18/02/2016 12:32, Greg Kurz wrote:
> > 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(-)  
> 
> For the series
> Tested-by: Laurent Vivier <lvivier@redhat.com>
> 
> 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
> 

Thanks for the reviewing and testing !

Cheers.

--
Greg

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] [PATCH v3 0/2] Fix migration of old pseries
  2016-02-19  0:11 ` David Gibson
@ 2016-02-19  7:59   ` Greg Kurz
  2016-02-22  1:09     ` David Gibson
  2016-02-23  8:31     ` [Qemu-devel] " Juan Quintela
  0 siblings, 2 replies; 20+ messages in thread
From: Greg Kurz @ 2016-02-19  7:59 UTC (permalink / raw)
  To: David Gibson
  Cc: Laurent Vivier, Juan Quintela, qemu-devel,
	Dr. David Alan Gilbert, qemu-ppc, Amit Shah

On Fri, 19 Feb 2016 11:11:47 +1100
David Gibson <david@gibson.dropbear.id.au> wrote:

> On Thu, Feb 18, 2016 at 12:32:11PM +0100, Greg Kurz wrote:
> > 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?
> 

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

> > ---
> > 
> > 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(-)
> >   
> 

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] [PATCH v3 0/2] Fix migration of old pseries
  2016-02-18 11:32 [Qemu-devel] [PATCH v3 0/2] Fix migration of old pseries Greg Kurz
                   ` (3 preceding siblings ...)
  2016-02-19  0:11 ` David Gibson
@ 2016-02-19 14:41 ` Laurent Vivier
  2016-02-19 16:27   ` Greg Kurz
  4 siblings, 1 reply; 20+ messages in thread
From: Laurent Vivier @ 2016-02-19 14:41 UTC (permalink / raw)
  To: Greg Kurz, Juan Quintela
  Cc: Amit Shah, David Gibson, qemu-ppc, qemu-devel, Dr. David Alan Gilbert



On 18/02/2016 12:32, Greg Kurz wrote:
> 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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] [PATCH v3 0/2] Fix migration of old pseries
  2016-02-19 14:41 ` Laurent Vivier
@ 2016-02-19 16:27   ` Greg Kurz
  2016-02-23 15:04     ` Greg Kurz
  0 siblings, 1 reply; 20+ messages in thread
From: Greg Kurz @ 2016-02-19 16:27 UTC (permalink / raw)
  To: Laurent Vivier
  Cc: Juan Quintela, qemu-devel, Dr. David Alan Gilbert, qemu-ppc,
	Amit Shah, David Gibson

On Fri, 19 Feb 2016 15:41:10 +0100
Laurent Vivier <lvivier@redhat.com> wrote:

> On 18/02/2016 12:32, Greg Kurz wrote:
> > 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
> 

Excellent ! Thanks for setting this up.

> - 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.

> - 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
> 

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] [PATCH v3 0/2] Fix migration of old pseries
  2016-02-19  7:59   ` Greg Kurz
@ 2016-02-22  1:09     ` David Gibson
  2016-02-26 10:49       ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
  2016-02-23  8:31     ` [Qemu-devel] " Juan Quintela
  1 sibling, 1 reply; 20+ messages in thread
From: David Gibson @ 2016-02-22  1:09 UTC (permalink / raw)
  To: Greg Kurz
  Cc: Laurent Vivier, Juan Quintela, qemu-devel,
	Dr. David Alan Gilbert, qemu-ppc, Amit Shah

[-- Attachment #1: Type: text/plain, Size: 1996 bytes --]

On Fri, Feb 19, 2016 at 08:59:44AM +0100, Greg Kurz wrote:
> On Fri, 19 Feb 2016 11:11:47 +1100
> David Gibson <david@gibson.dropbear.id.au> wrote:
> 
> > On Thu, Feb 18, 2016 at 12:32:11PM +0100, Greg Kurz wrote:
> > > 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?
> > 
> 
> This v3 series applies instead of the v2 that peeks for the config section.

Ok, thanks for the clarification.

> 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 ?

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

-- 
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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] [PATCH v3 1/2] spapr: skip configuration section during migration of older machines
  2016-02-18 11:32 ` [Qemu-devel] [PATCH v3 1/2] spapr: skip configuration section during migration of older machines Greg Kurz
  2016-02-18 19:57   ` Laurent Vivier
@ 2016-02-23  8:23   ` Juan Quintela
  1 sibling, 0 replies; 20+ messages in thread
From: Juan Quintela @ 2016-02-23  8:23 UTC (permalink / raw)
  To: Greg Kurz
  Cc: Laurent Vivier, qemu-devel, Dr. David Alan Gilbert, qemu-ppc,
	Amit Shah, David Gibson

Greg Kurz <gkurz@linux.vnet.ibm.com> wrote:
> 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
> Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>

Reviewed-by: Juan Quintela <quintela@redhat.com>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] [PATCH v3 2/2] migration: allow machine to enforce configuration section migration
  2016-02-18 11:32 ` [Qemu-devel] [PATCH v3 2/2] migration: allow machine to enforce configuration section migration Greg Kurz
  2016-02-18 19:57   ` Laurent Vivier
@ 2016-02-23  8:24   ` Juan Quintela
  1 sibling, 0 replies; 20+ messages in thread
From: Juan Quintela @ 2016-02-23  8:24 UTC (permalink / raw)
  To: Greg Kurz
  Cc: Laurent Vivier, qemu-devel, Dr. David Alan Gilbert, qemu-ppc,
	Amit Shah, David Gibson

Greg Kurz <gkurz@linux.vnet.ibm.com> wrote:
> 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.
>
> Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>

Reviewed-by: Juan Quintela <quintela@redhat.com>

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 :-()

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] [PATCH v3 0/2] Fix migration of old pseries
  2016-02-19  7:59   ` Greg Kurz
  2016-02-22  1:09     ` David Gibson
@ 2016-02-23  8:31     ` Juan Quintela
  2016-02-23 10:01       ` Greg Kurz
  1 sibling, 1 reply; 20+ messages in thread
From: Juan Quintela @ 2016-02-23  8:31 UTC (permalink / raw)
  To: Greg Kurz
  Cc: Laurent Vivier, qemu-devel, Dr. David Alan Gilbert, qemu-ppc,
	Amit Shah, David Gibson

Greg Kurz <gkurz@linux.vnet.ibm.com> wrote:
> On Fri, 19 Feb 2016 11:11:47 +1100
> David Gibson <david@gibson.dropbear.id.au> wrote:
>
>> On Thu, Feb 18, 2016 at 12:32:11PM +0100, Greg Kurz wrote:
>> > 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?
>> 
>
> 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 ?

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.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] [PATCH v3 0/2] Fix migration of old pseries
  2016-02-23  8:31     ` [Qemu-devel] " Juan Quintela
@ 2016-02-23 10:01       ` Greg Kurz
  2016-02-23 12:27         ` Greg Kurz
  0 siblings, 1 reply; 20+ messages in thread
From: Greg Kurz @ 2016-02-23 10:01 UTC (permalink / raw)
  To: Juan Quintela
  Cc: Laurent Vivier, qemu-devel, Dr. David Alan Gilbert, qemu-ppc,
	Amit Shah, David Gibson

On Tue, 23 Feb 2016 09:31:10 +0100
Juan Quintela <quintela@redhat.com> wrote:
> Greg Kurz <gkurz@linux.vnet.ibm.com> wrote:
> > On Fri, 19 Feb 2016 11:11:47 +1100
> > David Gibson <david@gibson.dropbear.id.au> wrote:
> >  
> >> On Thu, Feb 18, 2016 at 12:32:11PM +0100, Greg Kurz wrote:  
> >> > 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?
> >>   
> >
> > 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 ?  
> 
> 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();
> }
> 

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.

> 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.

> Later, Juan.
> 

Thanks !

--
Greg

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] [PATCH v3 0/2] Fix migration of old pseries
  2016-02-23 10:01       ` Greg Kurz
@ 2016-02-23 12:27         ` Greg Kurz
  0 siblings, 0 replies; 20+ messages in thread
From: Greg Kurz @ 2016-02-23 12:27 UTC (permalink / raw)
  To: Juan Quintela
  Cc: Laurent Vivier, qemu-devel, Dr. David Alan Gilbert, qemu-ppc,
	Amit Shah, David Gibson

On Tue, 23 Feb 2016 11:01:00 +0100
Greg Kurz <gkurz@linux.vnet.ibm.com> wrote:

> On Tue, 23 Feb 2016 09:31:10 +0100
> Juan Quintela <quintela@redhat.com> wrote:
> > Greg Kurz <gkurz@linux.vnet.ibm.com> wrote:  
> > > On Fri, 19 Feb 2016 11:11:47 +1100
> > > David Gibson <david@gibson.dropbear.id.au> wrote:
> > >    
> > >> On Thu, Feb 18, 2016 at 12:32:11PM +0100, Greg Kurz wrote:    
> > >> > 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?
> > >>     
> > >
> > > 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 ?    
> > 
> > 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();
> > }
> >   
> 
> 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.
> 
> > 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.
> 

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

commit 798595075bf51c7e3125d260a19d860b9aa63e69
Author: Eduardo Habkost <ehabkost@redhat.com>
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.

> > Later, Juan.
> >   
> 
> Thanks !
> 
> --
> Greg
> 
> 

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] [PATCH v3 0/2] Fix migration of old pseries
  2016-02-19 16:27   ` Greg Kurz
@ 2016-02-23 15:04     ` Greg Kurz
  0 siblings, 0 replies; 20+ messages in thread
From: Greg Kurz @ 2016-02-23 15:04 UTC (permalink / raw)
  To: Laurent Vivier
  Cc: Juan Quintela, qemu-devel, Dr. David Alan Gilbert, qemu-ppc,
	Amit Shah, David Gibson

On Fri, 19 Feb 2016 17:27:33 +0100
Greg Kurz <gkurz@linux.vnet.ibm.com> wrote:

> On Fri, 19 Feb 2016 15:41:10 +0100
> Laurent Vivier <lvivier@redhat.com> wrote:
> 
> > On 18/02/2016 12:32, Greg Kurz wrote:  
> > > 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
> >   
> 
> Excellent ! Thanks for setting this up.
> 
> > - 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 <clg@fr.ibm.com>
Date:   Mon Nov 3 16:14:50 2014 +0100

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

> but my command line is different from yours.
> 
> > - 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
> >   
> 
> 

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] [Qemu-ppc] [PATCH v3 0/2] Fix migration of old pseries
  2016-02-22  1:09     ` David Gibson
@ 2016-02-26 10:49       ` Greg Kurz
  2016-02-26 11:03         ` David Gibson
  0 siblings, 1 reply; 20+ messages in thread
From: Greg Kurz @ 2016-02-26 10:49 UTC (permalink / raw)
  To: David Gibson
  Cc: Laurent Vivier, Juan Quintela, qemu-devel,
	Dr. David Alan Gilbert, qemu-ppc, Amit Shah

On Mon, 22 Feb 2016 12:09:12 +1100
David Gibson <david@gibson.dropbear.id.au> wrote:

> On Fri, Feb 19, 2016 at 08:59:44AM +0100, Greg Kurz wrote:
> > On Fri, 19 Feb 2016 11:11:47 +1100
> > David Gibson <david@gibson.dropbear.id.au> wrote:
> >   
> > > On Thu, Feb 18, 2016 at 12:32:11PM +0100, Greg Kurz wrote:  
> > > > 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?
> > >   
> > 
> > This v3 series applies instead of the v2 that peeks for the config section.  
> 
> Ok, thanks for the clarification.
> 
> > 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 ?  
> 
> 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 ! :)

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Qemu-devel] [Qemu-ppc] [PATCH v3 0/2] Fix migration of old pseries
  2016-02-26 10:49       ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
@ 2016-02-26 11:03         ` David Gibson
  0 siblings, 0 replies; 20+ messages in thread
From: David Gibson @ 2016-02-26 11:03 UTC (permalink / raw)
  To: Greg Kurz
  Cc: Laurent Vivier, Juan Quintela, qemu-devel,
	Dr. David Alan Gilbert, qemu-ppc, Amit Shah

[-- Attachment #1: Type: text/plain, Size: 2450 bytes --]

On Fri, Feb 26, 2016 at 11:49:56AM +0100, Greg Kurz wrote:
> On Mon, 22 Feb 2016 12:09:12 +1100
> David Gibson <david@gibson.dropbear.id.au> wrote:
> 
> > On Fri, Feb 19, 2016 at 08:59:44AM +0100, Greg Kurz wrote:
> > > On Fri, 19 Feb 2016 11:11:47 +1100
> > > David Gibson <david@gibson.dropbear.id.au> wrote:
> > >   
> > > > On Thu, Feb 18, 2016 at 12:32:11PM +0100, Greg Kurz wrote:  
> > > > > 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?
> > > >   
> > > 
> > > This v3 series applies instead of the v2 that peeks for the config section.  
> > 
> > Ok, thanks for the clarification.
> > 
> > > 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 ?  
> > 
> > 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.

-- 
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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2016-02-26 11:31 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-18 11:32 [Qemu-devel] [PATCH v3 0/2] Fix migration of old pseries Greg Kurz
2016-02-18 11:32 ` [Qemu-devel] [PATCH v3 1/2] spapr: skip configuration section during migration of older machines Greg Kurz
2016-02-18 19:57   ` Laurent Vivier
2016-02-23  8:23   ` Juan Quintela
2016-02-18 11:32 ` [Qemu-devel] [PATCH v3 2/2] migration: allow machine to enforce configuration section migration Greg Kurz
2016-02-18 19:57   ` Laurent Vivier
2016-02-23  8:24   ` Juan Quintela
2016-02-18 20:00 ` [Qemu-devel] [PATCH v3 0/2] Fix migration of old pseries Laurent Vivier
2016-02-19  6:42   ` Greg Kurz
2016-02-19  0:11 ` David Gibson
2016-02-19  7:59   ` Greg Kurz
2016-02-22  1:09     ` David Gibson
2016-02-26 10:49       ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2016-02-26 11:03         ` David Gibson
2016-02-23  8:31     ` [Qemu-devel] " Juan Quintela
2016-02-23 10:01       ` Greg Kurz
2016-02-23 12:27         ` Greg Kurz
2016-02-19 14:41 ` Laurent Vivier
2016-02-19 16:27   ` Greg Kurz
2016-02-23 15:04     ` Greg Kurz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).