From patchwork Sat Feb 23 17:52:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 222740 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D1B7A2C02B4 for ; Sun, 24 Feb 2013 04:52:48 +1100 (EST) Received: from localhost ([::1]:45041 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U9JHC-0007aU-U5 for incoming@patchwork.ozlabs.org; Sat, 23 Feb 2013 12:52:46 -0500 Received: from eggs.gnu.org ([208.118.235.92]:57032) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U9JH1-0007Zq-HX for qemu-devel@nongnu.org; Sat, 23 Feb 2013 12:52:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U9JGy-0007hb-T0 for qemu-devel@nongnu.org; Sat, 23 Feb 2013 12:52:35 -0500 Received: from cantor2.suse.de ([195.135.220.15]:44587 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U9JGy-0007hP-Mg; Sat, 23 Feb 2013 12:52:32 -0500 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id B5237A51FE; Sat, 23 Feb 2013 18:52:31 +0100 (CET) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Sat, 23 Feb 2013 18:52:24 +0100 Message-Id: <1361641944-21179-1-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.7.10.4 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 195.135.220.15 Cc: qemu-ppc@nongnu.org, =?UTF-8?q?Andreas=20F=C3=A4rber?= , Alexander Graf Subject: [Qemu-devel] [PATCH RFC ppc-next] target-ppc: Report CPU aliases for QMP X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The QMP query-cpu-definitions implementation iterated over CPU classes only, which were getting less and less as aliases were extracted. Keep them in QMP as valid -cpu arguments even if not guaranteed stable. Signed-off-by: Andreas Färber --- target-ppc/translate_init.c | 21 +++++++++++++++++++++ 1 Datei geändert, 21 Zeilen hinzugefügt(+) diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c index 9cb8daa..d4871d1 100644 --- a/target-ppc/translate_init.c +++ b/target-ppc/translate_init.c @@ -8407,11 +8407,32 @@ CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp) { CpuDefinitionInfoList *cpu_list = NULL; GSList *list; + int i; list = object_class_get_list(TYPE_POWERPC_CPU, false); g_slist_foreach(list, ppc_cpu_defs_entry, &cpu_list); g_slist_free(list); + for (i = 0; i < ARRAY_SIZE(ppc_cpu_aliases); i++) { + const PowerPCCPUAlias *alias = &ppc_cpu_aliases[i]; + ObjectClass *oc; + CpuDefinitionInfoList *entry; + CpuDefinitionInfo *info; + + oc = ppc_cpu_class_by_name(alias->model); + if (oc == NULL) { + continue; + } + + info = g_malloc0(sizeof(*info)); + info->name = g_strdup(alias->alias); + + entry = g_malloc0(sizeof(*entry)); + entry->value = info; + entry->next = cpu_list; + cpu_list = entry; + } + return cpu_list; }