From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60678) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjMaD-0000GU-Il for qemu-devel@nongnu.org; Mon, 12 Sep 2016 04:27:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bjMa9-0007rs-BB for qemu-devel@nongnu.org; Mon, 12 Sep 2016 04:27:16 -0400 Received: from 3.mo68.mail-out.ovh.net ([46.105.58.60]:47671) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjMa9-0007r8-2k for qemu-devel@nongnu.org; Mon, 12 Sep 2016 04:27:13 -0400 Received: from player778.ha.ovh.net (b7.ovh.net [213.186.33.57]) by mo68.mail-out.ovh.net (Postfix) with ESMTP id 7C4E5FF9566 for ; Mon, 12 Sep 2016 10:27:10 +0200 (CEST) Date: Mon, 12 Sep 2016 10:27:02 +0200 From: Greg Kurz Message-ID: <20160912102702.214ef04a@bahia> In-Reply-To: <20160912012757.GE12621@voom.fritz.box> References: <1473167877-2545-1-git-send-email-lvivier@redhat.com> <1473167877-2545-3-git-send-email-lvivier@redhat.com> <20160908020423.GD3883@voom.fritz.box> <19b24b76-5650-74de-6870-f6a8bc3f5e12@redhat.com> <20160909142545.4876b85e@bahia> <20160912012757.GE12621@voom.fritz.box> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/.QF7sN+t/gyt5/JdXPmIIvj"; protocol="application/pgp-signature" Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH v4 2/3] tests: make pc_alloc_init/init_flags/uninit generic List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: Laurent Vivier , thuth@redhat.com, qemu-ppc@nongnu.org, qemu-devel@nongnu.org --Sig_/.QF7sN+t/gyt5/JdXPmIIvj Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Mon, 12 Sep 2016 11:27:57 +1000 David Gibson wrote: > On Fri, Sep 09, 2016 at 02:31:55PM +0200, Laurent Vivier wrote: > >=20 > >=20 > > On 09/09/2016 14:25, Greg Kurz wrote: =20 > > > On Thu, 8 Sep 2016 09:50:31 +0200 > > > Laurent Vivier wrote: > > > =20 > > >> On 08/09/2016 04:04, David Gibson wrote: =20 > > >>> On Tue, Sep 06, 2016 at 03:17:56PM +0200, Laurent Vivier wrote: = =20 > > >>>> And add support for ppc64. > > >>>> > > >>>> Signed-off-by: Laurent Vivier =20 > > >>> > > >>> Some of my coments may be obsoleted by the discussion with Greg. > > >>> =20 > > >>>> --- > > >>>> v2: > > >>>> - remove useless parenthesis, inline =20 > > >> [...] =20 > > >>>> + > > >>>> +QGuestAllocator *machine_alloc_init(void) > > >>>> +{ > > >>>> + const char *arch =3D qtest_get_arch(); =20 > > >>> > > >>> Maybe we need to add a qtest_get_machine_type(). =20 > > >> > > >> I'm working on that... > > >> =20 > > >=20 > > > The problem is that qtest only knows about archs, based on $(TARGETS). > > > Maybe the machine type could be the default one for a given arch ? =20 > >=20 > > Once the machine is started we can use QMP[1] to ask the machine type > > (for instance, "pseries-2.7-machine"). > >=20 > > So what we could do is a generic qtest_machine_vboot() which ask the > > machine type and configure the qtest framework accordingly. > >=20 > > Laurent > > [1] { 'execute': 'qom-get', 'arguments': { 'path': '/machine', > > 'property': 'type' } } =20 >=20 > Ok.. doesn't the qtest framework start the machine though? So it > should already know the machine type, shouldn't it? >=20 As already mentioned , qtest only knows about archs... the machine type is either explicitly passed to qtest_start(), either the default one for a given arch, if any. For some generic code that would have to choose the right memory allocation implementation based on the machine type, Laurent's suggestion seems to be appropriate indeed. Cheers. -- Greg --Sig_/.QF7sN+t/gyt5/JdXPmIIvj Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlfWZtYACgkQAvw66wEB28Ip/wCgmvgJYdOqEYuc930RhNAf/QPU bfkAn2wsNC1pMBm76ZbPyvjT3drF0sIz =rqSI -----END PGP SIGNATURE----- --Sig_/.QF7sN+t/gyt5/JdXPmIIvj--