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