qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/2] machine_parse(): list supported machine typ


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 2/2] machine_parse(): list supported machine types in their registration order
Date: Mon, 22 Sep 2014 18:17:09 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0

Il 22/09/2014 18:06, Andreas Färber ha scritto:
> Am 22.09.2014 um 17:57 schrieb Paolo Bonzini:
>> Il 22/09/2014 15:15, Laszlo Ersek ha scritto:
>>> $ git grep -E '\<qemu_register(_pc)?_machine\>' | wc -l
>>> 115
>>>
>>> Even if we just count the clusters, they're way too many:
>>>
>>> $ git grep -E '\<machine_init\>' | wc -l
>>> 66
>>
>> There are just a couple of multi-machine clusters (well, three: pseries,
>> pc, q35).  So the default clusters can just default to the machine type.
> 
> I would've gone even simpler and special-cased pc/q35 and "none" (like
> we did for -cpu "host") in the comparison function, sparing us any big
> interface work.
> 
> Therefore from my point of review, this was merely about how we
> implement the comparison function. No reason to get a heart attack IMO.

Yeah, what I'm proposing is something like

        MachineClass *a = pa, *b = pb;

        cl1 = a->cluster ? a->cluster : object_class_get_name(a);
        cl2 = b->cluster ? b->cluster : object_class_get_name(b);
        res = strcmp(cl1, cl2);
        if (res)
                return res;
        return strcmp(object_class_get_name(a),
                      object_class_get_name(b));

Plus a

        mc->cluster = qm->cluster;

in vl.c's machine_class_init.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]