From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60391) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWEew-0003Jv-Hj for qemu-devel@nongnu.org; Wed, 17 Feb 2016 21:49:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aWEet-0007s6-95 for qemu-devel@nongnu.org; Wed, 17 Feb 2016 21:49:38 -0500 Date: Thu, 18 Feb 2016 13:50:25 +1100 From: David Gibson Message-ID: <20160218025025.GE15224@voom.fritz.box> References: <20160217160344.840.69108.stgit@bahia.huguette.org> <20160217160628.840.96784.stgit@bahia.huguette.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="mR8QP4gmHujQHb1c" Content-Disposition: inline In-Reply-To: <20160217160628.840.96784.stgit@bahia.huguette.org> Subject: Re: [Qemu-devel] [PATCH v2 3/3] migration: allow to suppress configuration section submission List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Greg Kurz Cc: Laurent Vivier , Juan Quintela , qemu-devel@nongnu.org, "Dr. David Alan Gilbert" , qemu-ppc@nongnu.org, Amit Shah --mR8QP4gmHujQHb1c Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 17, 2016 at 05:06:43PM +0100, Greg Kurz wrote: > Since the addition of the configuration section in QEMU 2.4, it is imposs= ible > to migrate a pseries-2.3 machine back to QEMU 2.3. >=20 > This patch makes it possible thanks to a new machine property which allow= s to > disable configuration section submission. >=20 > To disable submission, just add: >=20 > -machine suppress-config-section=3Don >=20 > Alternatively, if the target QEMU version isn't known at startup, this can > be done later from the QEMU monitor with: >=20 > qom-set /machine suppress-config-section on >=20 > This property won't be automatically set for pseries-2.3 because it would > then break backward migration to QEMU 2.4. If automatic behaviour is need= ed, > it is up to the tooling to handle this. As noted elsewhere, I'd actually be ok with enabling it for pseries-2.3. Basically we have to chose whether to work against qemu 2.3 or 2.4 out of the box, we can't have both, and it sounds like qemu 2.3 is more widely deployed than qemu 2.4. >=20 > Signed-off-by: Greg Kurz Reviewed-by: David Gibson I'm not sure whose tree these need to go in via. > --- > hw/core/machine.c | 21 +++++++++++++++++++++ > include/hw/boards.h | 1 + > migration/savevm.c | 8 +++++++- > qemu-options.hx | 3 ++- > 4 files changed, 31 insertions(+), 2 deletions(-) >=20 > diff --git a/hw/core/machine.c b/hw/core/machine.c > index 7203dd260bf2..ad4ecdc65787 100644 > --- a/hw/core/machine.c > +++ b/hw/core/machine.c > @@ -327,6 +327,21 @@ static bool machine_get_require_config_section(Objec= t *obj, Error **errp) > return ms->require_config_section; > } > =20 > +static void machine_set_suppress_config_section(Object *obj, bool value, > + Error **errp) > +{ > + MachineState *ms =3D MACHINE(obj); > + > + ms->suppress_config_section =3D value; > +} > + > +static bool machine_get_suppress_config_section(Object *obj, Error **err= p) > +{ > + MachineState *ms =3D MACHINE(obj); > + > + return ms->suppress_config_section; > +} > + > static int error_on_sysbus_device(SysBusDevice *sbdev, void *opaque) > { > error_report("Option '-device %s' cannot be handled by this machine", > @@ -489,6 +504,12 @@ static void machine_initfn(Object *obj) > object_property_set_description(obj, "require-config-section", > "Set on/off to reject/accept migrati= on without configuration section", > NULL); > + object_property_add_bool(obj, "suppress-config-section", > + machine_get_suppress_config_section, > + machine_set_suppress_config_section, NULL); > + object_property_set_description(obj, "suppress-config-section", > + "Set on/off to enable/disable config= uration section migration", > + NULL); > =20 > /* Register notifier when init is done for sysbus sanity checks */ > ms->sysbus_notifier.notify =3D machine_init_notify; > diff --git a/include/hw/boards.h b/include/hw/boards.h > index d6ff1ba4c260..35aaa6493458 100644 > --- a/include/hw/boards.h > +++ b/include/hw/boards.h > @@ -129,6 +129,7 @@ struct MachineState { > bool iommu; > bool suppress_vmdesc; > bool require_config_section; > + bool suppress_config_section; > =20 > ram_addr_t ram_size; > ram_addr_t maxram_size; > diff --git a/migration/savevm.c b/migration/savevm.c > index f8dee03a3350..3fd07efeb38b 100644 > --- a/migration/savevm.c > +++ b/migration/savevm.c > @@ -878,13 +878,19 @@ bool qemu_savevm_state_blocked(Error **errp) > return false; > } > =20 > +static bool should_send_configuration(void) > +{ > + MachineState *machine =3D MACHINE(qdev_get_machine()); > + return !machine->suppress_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); > =20 > - if (!savevm_state.skip_configuration) { > + if (!savevm_state.skip_configuration && should_send_configuration())= { > qemu_put_byte(f, QEMU_VM_CONFIGURATION); > vmstate_save_state(f, &vmstate_configuration, &savevm_state, 0); > } > diff --git a/qemu-options.hx b/qemu-options.hx > index 172471c75b1c..af08fa8ec314 100644 > --- a/qemu-options.hx > +++ b/qemu-options.hx > @@ -44,7 +44,8 @@ DEF("machine", HAS_ARG, QEMU_OPTION_machine, \ > " dea-key-wrap=3Don|off controls support for DEA key = wrapping (default=3Don)\n" > " suppress-vmdesc=3Don|off disables self-describing m= igration (default=3Doff)\n" > " nvdimm=3Don|off controls NVDIMM support (default=3D= off)\n" > - " require-config-section=3Don|off incoming migration = requires configuration section (default=3Don)\n", > + " require-config-section=3Don|off incoming migration = requires configuration section (default=3Don)\n" > + " suppress-config-section=3Don|off disables configura= tion section migration (default=3Doff)\n", > QEMU_ARCH_ALL) > STEXI > @item -machine [type=3D]@var{name}[,prop=3D@var{value}[,...]] >=20 --=20 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 --mR8QP4gmHujQHb1c Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWxTFxAAoJEGw4ysog2bOSjuoP/jtsg96Vfxe7mHY12a3QaXEr m25zAVWhtLE/KdIQO3D2dZvJzCnun1QHMzpx5ERzEz7rO5Ja5XvOn38djj5465Mu vDofE4I1gUXfHieNu50ie6LxAGCi9ts8az4kM1T05aWKZgRpxriOO03e3L5/OJ3z CoCVd8cNHwsX9kGkTu1MRXjbTgp2floBR8UMQhDrr4HBktnwIuZ8INvWaoPD1HWq 8Y5CzjL5nU8WGVpBR2vvB3bItWYt3TxqnFX5IBbidU91SOVQwVHcruDLt2+MBFin 1j1VtnLP1ob7hTrs/ZMZuK1fPSpQb8RdeNSyjdwWhYoAE4UU4oLgeJiIprBWwvQz JpG59PSbMjP55aAfL2wOAtWtNOAYKGgTrJ8c7bonnkbHf1wiFLyOdqSBHe9X10QJ nNbzK5oemSEaiYagc62aFHQVmYpz4pxHv432sqPTVriGHwwGNntkOH+ipmo48e3P QBRk77FYZBEbVe+3yaPascejRLzKy+WxzUyeh0v7oIGwD+fMZitRiADTro/7W3Su BjeAKCvmwDwI8xSBeB5q3Wm/4Exny1Xg+bBQv5pfPBCJhA0kLTh5baQYaXT3Yh4V O9LUQjk5htOcK6rdURF4Tm7JgWQ++Sonuy48Q02bglvQI8TXy7cufhac/SPMHvVv iXO3tbHQpo3v6yD/oO6V =EsjU -----END PGP SIGNATURE----- --mR8QP4gmHujQHb1c--