Received: from eggs.gnu.org ([2001:4830:134:3::10]:39650) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gAEpt-00062W-1d for qemu-devel@nongnu.org; Wed, 10 Oct 2018 09:47:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gAEpo-0004ud-QI for qemu-devel@nongnu.org; Wed, 10 Oct 2018 09:47:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60438) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gAEpj-0004qq-Dx for qemu-devel@nongnu.org; Wed, 10 Oct 2018 09:47:28 -0400 Date: Wed, 10 Oct 2018 10:46:56 -0300 From: Eduardo Habkost Message-ID: <20181010134656.GE5738@habkost.net> References: <20181009232607.15521-1-crosa@redhat.com> <20181009232607.15521-5-crosa@redhat.com> <835fcb24-5832-9e6c-9f57-0364f0bf849a@redhat.com> <95a8561c-0511-6a8a-a3eb-25d556029e7a@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <95a8561c-0511-6a8a-a3eb-25d556029e7a@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 4/7] scripts/qemu.py: set predefined machine type based on arch List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cleber Rosa Cc: Philippe =?iso-8859-1?Q?Mathieu-Daud=E9?= , qemu-devel@nongnu.org, Alex =?iso-8859-1?Q?Benn=E9e?= , Fam Zheng , Philippe =?iso-8859-1?Q?Mathieu-Daud=E9?= , Caio Carrara , Stefan Hajnoczi , Laszlo Ersek On Wed, Oct 10, 2018 at 08:35:38AM -0400, Cleber Rosa wrote: >=20 >=20 > On 10/10/18 7:00 AM, Philippe Mathieu-Daud=E9 wrote: > > On 10/10/2018 01:26, Cleber Rosa wrote: > >> Some targets require a machine type to be set, as there's no default > >> (aarch64 is one example). To give a consistent interface to users o= f > >> this API, this changes set_machine() so that a predefined default ca= n > >> be used, if one is not given. The approach used is exactly the same > >> with the console device type. > >> > >> Also, even when there's a default machine type, for some purposes, > >> testing included, it's better if outside code is explicit about the > >> machine type, instead of relying on whatever is set internally. > >> > >> Signed-off-by: Cleber Rosa > >> --- > >> scripts/qemu.py | 22 +++++++++++++++++++++- > >> 1 file changed, 21 insertions(+), 1 deletion(-) > >> > >> diff --git a/scripts/qemu.py b/scripts/qemu.py > >> index d9e24a0c1a..fca9b76990 100644 > >> --- a/scripts/qemu.py > >> +++ b/scripts/qemu.py > >> @@ -36,6 +36,15 @@ CONSOLE_DEV_TYPES =3D { > >> r'^s390-ccw-virtio.*': 'sclpconsole', > >> } > >> =20 > >> +#: Maps archictures to the preferred machine type > >> +MACHINE_TYPES =3D { > >> + r'^aarch64$': 'virt', > >> + r'^ppc$': 'g3beige', > >> + r'^ppc64$': 'pseries', > >> + r'^s390x$': 's390-ccw-virtio', > >> + r'^x86_64$': 'q35', > >=20 > > Why choose Q35 rather than PC (the default)? > >=20 > > I was wondering about how to generate variants/machines.json but this= is > > definitively something we want to do via a QMP query. > >=20 > > Eduardo what do you think? > >=20 >=20 > It was motivated by Eduardo's initiative to make q35 the default "acros= s > the board". He can confirm and give more details. Making Q35 the default on applications using QEMU and libvirt is something I'd like to happen. But I think the simplest way to do that is to change the QEMU default. This way you won't need this table on qemu.py: you can just use the default provided by QEMU. --=20 Eduardo