lkml.org 
[lkml]   [2014]   [May]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v1 RFC 01/10] QEMU: introduce function cpudesc_avail
Date
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 <mimu@linux.vnet.ibm.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
---
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


\
 
 \ /
  Last update: 2014-05-14 04:42    [W:0.113 / U:1.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site