From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60125) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkEC6-000789-Di for qemu-devel@nongnu.org; Tue, 13 May 2014 11:00:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WkEBw-0002ev-Ux for qemu-devel@nongnu.org; Tue, 13 May 2014 11:00:38 -0400 Received: from e06smtp18.uk.ibm.com ([195.75.94.114]:40978) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkEBw-0002ep-NG for qemu-devel@nongnu.org; Tue, 13 May 2014 11:00:28 -0400 Received: from /spool/local by e06smtp18.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 13 May 2014 16:00:28 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 67EF617D8066 for ; Tue, 13 May 2014 16:01:34 +0100 (BST) Received: from d06av09.portsmouth.uk.ibm.com (d06av09.portsmouth.uk.ibm.com [9.149.37.250]) by b06cxnps4076.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s4DF0QbU59244706 for ; Tue, 13 May 2014 15:00:26 GMT Received: from d06av09.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s4DF0P7m007470 for ; Tue, 13 May 2014 09:00:25 -0600 From: Michael Mueller Date: Tue, 13 May 2014 17:00:13 +0200 Message-Id: <1399993222-16339-2-git-send-email-mimu@linux.vnet.ibm.com> In-Reply-To: <1399993222-16339-1-git-send-email-mimu@linux.vnet.ibm.com> References: <1399993222-16339-1-git-send-email-mimu@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH v1 RFC 01/10] QEMU: introduce function cpudesc_avail List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, kvm@vger.kernel.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org Cc: mimu@linux.vnet.ibm.com, Gleb Natapov , Alexander Graf , Christian Borntraeger , "Jason J. Herne" , Cornelia Huck , Paolo Bonzini , Andreas Faerber , Richard Henderson This patch introduces the function cpudesc_avail() which returns by default true if not architecture specific implemented. Its intention is to indicate if the cpu model description is available for display by list_cpus(). This change allows cpu model descriptions to become dynamically created by evaluating the runtime context. Signed-off-by: Michael Mueller Acked-by: Cornelia Huck --- arch_init.c | 8 ++++++++ include/sysemu/arch_init.h | 1 + vl.c | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/arch_init.c b/arch_init.c index 995f56d..207d720 100644 --- a/arch_init.c +++ b/arch_init.c @@ -1346,6 +1346,14 @@ int xen_available(void) #endif } +bool cpudesc_avail(void) +{ + bool is_avail = true; +#if defined(cpudesc_ready) + is_avail = cpudesc_ready(); +#endif + return is_avail; +} TargetInfo *qmp_query_target(Error **errp) { diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h index 182d48d..cadcedc 100644 --- a/include/sysemu/arch_init.h +++ b/include/sysemu/arch_init.h @@ -35,6 +35,7 @@ void audio_init(void); int tcg_available(void); int kvm_available(void); int xen_available(void); +bool cpudesc_avail(void); CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp); diff --git a/vl.c b/vl.c index 73e0661..ddd98f7 100644 --- a/vl.c +++ b/vl.c @@ -4009,7 +4009,7 @@ int main(int argc, char **argv, char **envp) */ cpudef_init(); - if (cpu_model && is_help_option(cpu_model)) { + if (cpudesc_avail() && cpu_model && is_help_option(cpu_model)) { list_cpus(stdout, &fprintf, cpu_model); exit(0); } -- 1.8.3.1