From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59820) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YcagY-0005Kj-3h for qemu-devel@nongnu.org; Mon, 30 Mar 2015 10:29:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YcagR-0006pO-15 for qemu-devel@nongnu.org; Mon, 30 Mar 2015 10:29:02 -0400 Received: from e06smtp13.uk.ibm.com ([195.75.94.109]:52618) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YcagQ-0006jR-OX for qemu-devel@nongnu.org; Mon, 30 Mar 2015 10:28:54 -0400 Received: from /spool/local by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 30 Mar 2015 15:28:43 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 4384F1B0804B for ; Mon, 30 Mar 2015 15:29:09 +0100 (BST) Received: from d06av10.portsmouth.uk.ibm.com (d06av10.portsmouth.uk.ibm.com [9.149.37.251]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t2UESfnI7995816 for ; Mon, 30 Mar 2015 14:28:41 GMT Received: from d06av10.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t2UESeUq015042 for ; Mon, 30 Mar 2015 08:28:41 -0600 From: Michael Mueller Date: Mon, 30 Mar 2015 16:28:14 +0200 Message-Id: <1427725708-52100-2-git-send-email-mimu@linux.vnet.ibm.com> In-Reply-To: <1427725708-52100-1-git-send-email-mimu@linux.vnet.ibm.com> References: <1427725708-52100-1-git-send-email-mimu@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH v4 01/15] Introduce stub routine cpu_desc_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: Eduardo Habkost , Gleb Natapov , Alexander Graf , Christian Borntraeger , Daniel Hansel , "Jason J. Herne" , Cornelia Huck , Paolo Bonzini , Richard Henderson , Andreas Faerber , Michael Mueller 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 1b5cffb..386750f 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -484,4 +484,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 8beff4c..dce9cd2 100644 --- a/stubs/Makefile.objs +++ b/stubs/Makefile.objs @@ -39,3 +39,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 74c2681..c552561 100644 --- a/vl.c +++ b/vl.c @@ -3820,7 +3820,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