On Mon, 12 Sep 2016 11:27:57 +1000 David Gibson <da...@gibson.dropbear.id.au> wrote:
> On Fri, Sep 09, 2016 at 02:31:55PM +0200, Laurent Vivier wrote: > > > > > > On 09/09/2016 14:25, Greg Kurz wrote: > > > On Thu, 8 Sep 2016 09:50:31 +0200 > > > Laurent Vivier <lviv...@redhat.com> wrote: > > > > > >> On 08/09/2016 04:04, David Gibson wrote: > > >>> On Tue, Sep 06, 2016 at 03:17:56PM +0200, Laurent Vivier wrote: > > >>>> And add support for ppc64. > > >>>> > > >>>> Signed-off-by: Laurent Vivier <lviv...@redhat.com> > > >>> > > >>> Some of my coments may be obsoleted by the discussion with Greg. > > >>> > > >>>> --- > > >>>> v2: > > >>>> - remove useless parenthesis, inline > > >> [...] > > >>>> + > > >>>> +QGuestAllocator *machine_alloc_init(void) > > >>>> +{ > > >>>> + const char *arch = qtest_get_arch(); > > >>> > > >>> Maybe we need to add a qtest_get_machine_type(). > > >> > > >> I'm working on that... > > >> > > > > > > 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 ? > > > > Once the machine is started we can use QMP[1] to ask the machine type > > (for instance, "pseries-2.7-machine"). > > > > So what we could do is a generic qtest_machine_vboot() which ask the > > machine type and configure the qtest framework accordingly. > > > > Laurent > > [1] { 'execute': 'qom-get', 'arguments': { 'path': '/machine', > > 'property': 'type' } } > > Ok.. doesn't the qtest framework start the machine though? So it > should already know the machine type, shouldn't it? > 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
pgp3nqaD87Eyt.pgp
Description: OpenPGP digital signature