From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47928) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XW6Im-00055o-Pf for qemu-devel@nongnu.org; Mon, 22 Sep 2014 12:17:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XW6Id-0002tj-O2 for qemu-devel@nongnu.org; Mon, 22 Sep 2014 12:17:24 -0400 Received: from mail-wg0-x22f.google.com ([2a00:1450:400c:c00::22f]:38041) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XW6Id-0002sE-IB for qemu-devel@nongnu.org; Mon, 22 Sep 2014 12:17:15 -0400 Received: by mail-wg0-f47.google.com with SMTP id y10so3226403wgg.18 for ; Mon, 22 Sep 2014 09:17:09 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <54204B85.6010406@redhat.com> Date: Mon, 22 Sep 2014 18:17:09 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1411385195-13495-1-git-send-email-lersek@redhat.com> <1411385195-13495-3-git-send-email-lersek@redhat.com> <5420105C.2090701@suse.de> <54201614.6040903@redhat.com> <20140922123641.GB7992@redhat.com> <54202100.7020205@redhat.com> <542046E3.8080203@redhat.com> <5420491C.8070905@suse.de> In-Reply-To: <5420491C.8070905@suse.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 2/2] machine_parse(): list supported machine types in their registration order List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?windows-1252?Q?Andreas_F=E4rber?= , Laszlo Ersek , "Michael S. Tsirkin" Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org, marcel.a@redhat.com 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 '\' | wc -l >>> 115 >>> >>> Even if we just count the clusters, they're way too many: >>> >>> $ git grep -E '\' | 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