Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933615AbbBQOaY (ORCPT ); Tue, 17 Feb 2015 09:30:24 -0500 Received: from e06smtp10.uk.ibm.com ([195.75.94.106]:40394 "EHLO e06smtp10.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756764AbbBQOZB (ORCPT ); Tue, 17 Feb 2015 09:25:01 -0500 From: Michael Mueller To: qemu-devel@nongnu.org, kvm@vger.kernel.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Gleb Natapov , Alexander Graf , Christian Borntraeger , "Jason J. Herne" , Cornelia Huck , Paolo Bonzini , Andreas Faerber , Richard Henderson , Michael Mueller Subject: [RFC PATCH v2 03/15] cpu-model: Introduce stub routine cpu_desc_avail Date: Tue, 17 Feb 2015 15:24:01 +0100 Message-Id: <1424183053-4310-4-git-send-email-mimu@linux.vnet.ibm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1424183053-4310-1-git-send-email-mimu@linux.vnet.ibm.com> References: <1424183053-4310-1-git-send-email-mimu@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15021714-0041-0000-0000-00000347CE59 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2227 Lines: 70 This patch introduces the function cpu_desc_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 instead of putting static cpu model information at display. Signed-off-by: Michael Mueller Reviewed-by: Thomas Huth --- include/qemu-common.h | 2 ++ stubs/Makefile.objs | 1 + stubs/cpu-desc-avail.c | 6 ++++++ vl.c | 2 +- 4 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 stubs/cpu-desc-avail.c diff --git a/include/qemu-common.h b/include/qemu-common.h index 644b46d..45040f9 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -481,4 +481,6 @@ int parse_debug_env(const char *name, int max, int initial); const char *qemu_ether_ntoa(const MACAddr *mac); +bool cpu_desc_avail(void); + #endif diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs index 5e347d0..fd7a489 100644 --- a/stubs/Makefile.objs +++ b/stubs/Makefile.objs @@ -40,3 +40,4 @@ stub-obj-$(CONFIG_WIN32) += fd-register.o stub-obj-y += cpus.o stub-obj-y += kvm.o stub-obj-y += qmp_pc_dimm_device_list.o +stub-obj-y += cpu-desc-avail.o diff --git a/stubs/cpu-desc-avail.c b/stubs/cpu-desc-avail.c new file mode 100644 index 0000000..0cd594e --- /dev/null +++ b/stubs/cpu-desc-avail.c @@ -0,0 +1,6 @@ +#include "qemu-common.h" + +bool cpu_desc_avail(void) +{ + return true; +} diff --git a/vl.c b/vl.c index 0fabc0b..130fb1e 100644 --- a/vl.c +++ b/vl.c @@ -3819,7 +3819,7 @@ int main(int argc, char **argv, char **envp) */ cpudef_init(); - if (cpu_model && is_help_option(cpu_model)) { + if (cpu_model && cpu_desc_avail() && is_help_option(cpu_model)) { list_cpus(stdout, &fprintf, cpu_model); exit(0); } -- 1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/