From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35779) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHmD2-0008N9-DU for qemu-devel@nongnu.org; Thu, 14 Aug 2014 00:00:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XHmCz-0004bS-Ku for qemu-devel@nongnu.org; Thu, 14 Aug 2014 00:00:16 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:32909) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHmCz-0004Ze-9e for qemu-devel@nongnu.org; Thu, 14 Aug 2014 00:00:13 -0400 Date: Thu, 14 Aug 2014 13:10:30 +1000 From: David Gibson Message-ID: <20140814031029.GI7628@voom.redhat.com> References: <1407892991-15752-1-git-send-email-david@gibson.dropbear.id.au> <87tx5g3als.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="v2/QI0iRXglpx0hK" Content-Disposition: inline In-Reply-To: <87tx5g3als.fsf@blackfin.pond.sub.org> Subject: Re: [Qemu-devel] [PATCH] spapr: Make machine naming conventions closer to those for PC List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: aik@ozlabs.ru, agraf@suse.de, qemu-devel@nongnu.org --v2/QI0iRXglpx0hK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 13, 2014 at 01:14:23PM +0200, Markus Armbruster wrote: > David Gibson writes: >=20 > > As of qemu-2.1, spapr/pseries, has a set of versioned machine classes to > > represent the machine type as it appeared to the guest in different qemu > > versions. This allows for safe migration of guests between current and > > future qemu versions. > > > > In PC, however, the default plain "pc" machine type is just an alias for > > the most recent versioned machine type. In sPAPR at the moment, it nam= es > > the base machine class from which the versioned types are derived. > > > > The PC approach is preferable; it makes it clearer which explicit versi= on > > is the current one. Additionally updating the "current" machine as the > > base class makes it even more likely than otherwise to incorrectly alter > > the versioned machines' behaviour when updating the current machine. > > > > Therefore this patch changes sPAPR to the PC approach - the base class > > becomes abstract, and plain "pseries" becomes an alias for the most > > recent versioned machine class. > > > > Signed-off-by: David Gibson > > --- > > hw/ppc/spapr.c | 5 +++-- > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > > index d01978f..2785dbc 100644 > > --- a/hw/ppc/spapr.c > > +++ b/hw/ppc/spapr.c > > @@ -1583,7 +1583,6 @@ static void spapr_machine_class_init(ObjectClass = *oc, void *data) > > =20 > > mc->name =3D "pseries"; > > mc->desc =3D "pSeries Logical Partition (PAPR compliant)"; > > - mc->is_default =3D 1; > > mc->init =3D ppc_spapr_init; > > mc->reset =3D ppc_spapr_reset; > > mc->block_default_type =3D IF_SCSI; >=20 > I suspect many of these assignments are actually overwritten by the > derived machine types' class init function. Without that, mc->name =3D > "pseries" would clash with the mc->alias =3D "pseries" below, wouldn't > i? Less than you'd think, since there's basically only one derived machine type variant so far. mc->name does need to change though, I'll rework. > Care to trim the redundant assignments? >=20 > > @@ -1598,6 +1597,7 @@ static void spapr_machine_class_init(ObjectClass = *oc, void *data) > > static const TypeInfo spapr_machine_info =3D { > > .name =3D TYPE_SPAPR_MACHINE, > > .parent =3D TYPE_MACHINE, > > + .abstract =3D true, > > .instance_size =3D sizeof(sPAPRMachineState), > > .instance_init =3D spapr_machine_initfn, > > .class_init =3D spapr_machine_class_init, > > @@ -1613,7 +1613,8 @@ static void spapr_machine_2_1_class_init(ObjectCl= ass *oc, void *data) > > =20 > > mc->name =3D "pseries-2.1"; > > mc->desc =3D "pSeries Logical Partition (PAPR compliant) v2.1"; > > - mc->is_default =3D 0; > > + mc->alias =3D "pseries"; > > + mc->is_default =3D 1; > > } > > =20 > > static const TypeInfo spapr_machine_2_1_info =3D { >=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 --v2/QI0iRXglpx0hK Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJT7CilAAoJEGw4ysog2bOSqPQP/RkMJvYJN+YgyMdWxLh3ueS9 EWPvmF4g4WVYyRbviQ+ofPr2gblRYTJmVZKHdSHsdi/bqrAfuxiDflbaGvJtQXb9 J7azYrQiG+3+0ZfWjNlzWCgLBqysBJlwKzwBu9qDGxujD86uMDJytXq7IhnxS49/ kw2J5IWq+TSA1ySVXQCQYAzOtY4s7TEOY5FDAQq4Ieuoi0r1HphhJc2bqpbKCqPN guAkzBDdUW4noiGtHK4AAEKchMK0+Y/7RMMPmU2Sgeace43ZuEtwWk7WTf1+b8E6 QkdAxCUCwMvtO6XOa0Z8Cr1+eCx8h3elwhoM4+W9tS1Qy5GCahkCjejSlJEcd0nc sgP7RJLEzoq47nNeyjguqiq/5lLffIBxBaQtnns9I6t68ooMxu3UP3/Il5mPuNzu DpO+2lmqP2TXU+6j7nqcBUztrAcztl0atRVkI0iTXpg2Ec3s7MREjBNGa1zIbTuu 2XwqY6h+tG5NXlCO95MPyItlHekCEQgNcQSyyuObo0wev8Mh+N8vYkQ6q5z1LPLX t5yQnvB3gQSLf8og3fFpvx7KUZtkbeb3vA4p1J+hBWn/oRB/8FeA33B621TK+aNs FdATwmWO11cywRC6E6P8cVyKyFlPtKsvxQoWkbr3q0+3RvWN0CdUBBPigiRn6s7l 3U3GTueAB5RD4QZmgAXd =nfMR -----END PGP SIGNATURE----- --v2/QI0iRXglpx0hK--