[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v1 RFC 01/10] QEMU: introduce function cpudesc_avail
From: |
Michael Mueller |
Subject: |
[Qemu-devel] [PATCH v1 RFC 01/10] QEMU: introduce function cpudesc_avail |
Date: |
Tue, 13 May 2014 17:00:13 +0200 |
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 <address@hidden>
Acked-by: Cornelia Huck <address@hidden>
---
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
- [Qemu-devel] [PATCH v1 RFC 00/10] QEMU: s390: cpu model implementation, Michael Mueller, 2014/05/13
- [Qemu-devel] [PATCH v1 RFC 01/10] QEMU: introduce function cpudesc_avail,
Michael Mueller <=
- [Qemu-devel] [PATCH v1 RFC 03/10] QEMU: s390: cpu model facilities support, Michael Mueller, 2014/05/13
- [Qemu-devel] [PATCH v1 RFC 02/10] QEMU: s390: cpu model cpu class definition, Michael Mueller, 2014/05/13
- [Qemu-devel] [PATCH v1 RFC 07/10] QEMU: s390: cpu model class initialization, Michael Mueller, 2014/05/13
- [Qemu-devel] [PATCH v1 RFC 04/10] QEMU: s390: cpu model alias support, Michael Mueller, 2014/05/13
- [Qemu-devel] [PATCH v1 RFC 05/10] s390: update linux-headers for kvm VM device attributes, Michael Mueller, 2014/05/13
- [Qemu-devel] [PATCH v1 RFC 06/10] QEMU: s390: cpu model kvm VM attr interface routines, Michael Mueller, 2014/05/13
- [Qemu-devel] [PATCH v1 RFC 09/10] QEMU: s390: cpu model QMP query-cpu-model, Michael Mueller, 2014/05/13
- [Qemu-devel] [PATCH v1 RFC 08/10] QEMU: s390: cpu model QMP query-cpu-definitions, Michael Mueller, 2014/05/13