[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC 02/28] s390x/cpumodel: expose CPU class properties
From: |
David Hildenbrand |
Subject: |
[Qemu-devel] [RFC 02/28] s390x/cpumodel: expose CPU class properties |
Date: |
Tue, 21 Jun 2016 15:02:07 +0200 |
Let's expose the description and migration safety, as class properties,
this can be helpful in the future.
Acked-by: Cornelia Huck <address@hidden>
Signed-off-by: David Hildenbrand <address@hidden>
---
target-s390x/cpu.c | 1 +
target-s390x/cpu.h | 1 +
target-s390x/cpu_models.c | 18 ++++++++++++++++++
3 files changed, 20 insertions(+)
diff --git a/target-s390x/cpu.c b/target-s390x/cpu.c
index 44e53ec..d7d0b62 100644
--- a/target-s390x/cpu.c
+++ b/target-s390x/cpu.c
@@ -445,6 +445,7 @@ static void s390_cpu_class_init(ObjectClass *oc, void *data)
* object_unref().
*/
dc->cannot_destroy_with_object_finalize_yet = true;
+ s390_cpu_model_class_register_props(oc);
}
static const TypeInfo s390_cpu_type_info = {
diff --git a/target-s390x/cpu.h b/target-s390x/cpu.h
index f1cb9a2..832da89 100644
--- a/target-s390x/cpu.h
+++ b/target-s390x/cpu.h
@@ -632,6 +632,7 @@ extern void subsystem_reset(void);
void s390_cpu_list(FILE *f, fprintf_function cpu_fprintf);
#define cpu_list s390_cpu_list
+void s390_cpu_model_class_register_props(ObjectClass *oc);
void s390_realize_cpu_model(CPUState *cs, Error **errp);
ObjectClass *s390_cpu_class_by_name(const char *name);
diff --git a/target-s390x/cpu_models.c b/target-s390x/cpu_models.c
index 08ed640..18638a9 100644
--- a/target-s390x/cpu_models.c
+++ b/target-s390x/cpu_models.c
@@ -98,6 +98,24 @@ static void s390_cpu_model_finalize(Object *obj)
{
}
+static bool get_migratable(Object *obj, Error **errp)
+{
+ return S390_CPU_GET_CLASS(obj)->migration_safe;
+}
+
+static char *get_description(Object *obj, Error **errp)
+{
+ return g_strdup(S390_CPU_GET_CLASS(obj)->desc);
+}
+
+void s390_cpu_model_class_register_props(ObjectClass *oc)
+{
+ object_class_property_add_bool(oc, "migratable", get_migratable, NULL,
+ NULL);
+ object_class_property_add_str(oc, "description", get_description, NULL,
+ NULL);
+}
+
#ifdef CONFIG_KVM
static void s390_host_cpu_model_class_init(ObjectClass *oc, void *data)
{
--
2.6.6
- [Qemu-devel] [RFC 03/28] s390x/cpumodel: introduce CPU features, (continued)
- [Qemu-devel] [RFC 03/28] s390x/cpumodel: introduce CPU features, David Hildenbrand, 2016/06/21
- [Qemu-devel] [RFC 15/28] s390x/sclp: propagate the ibc val(lowest and unblocked ibc), David Hildenbrand, 2016/06/21
- [Qemu-devel] [RFC 07/28] s390x/cpumodel: register defined CPU models as subclasses, David Hildenbrand, 2016/06/21
- [Qemu-devel] [RFC 08/28] s390x/cpumodel: store the CPU model in the CPU instance, David Hildenbrand, 2016/06/21
- [Qemu-devel] [RFC 05/28] s390x/cpumodel: generate CPU feature group lists, David Hildenbrand, 2016/06/21
- [Qemu-devel] [RFC 19/28] s390x/kvm: allow runtime-instrumentation for "none" machine, David Hildenbrand, 2016/06/21
- [Qemu-devel] [RFC 10/28] s390x/cpumodel: let the CPU model handle feature checks, David Hildenbrand, 2016/06/21
- [Qemu-devel] [RFC 14/28] s390x/sclp: indicate sclp features, David Hildenbrand, 2016/06/21
- [Qemu-devel] [RFC 13/28] s390x/sclp: introduce sclp feature blocks, David Hildenbrand, 2016/06/21
- [Qemu-devel] [RFC 04/28] s390x/cpumodel: generate CPU feature lists for CPU models, David Hildenbrand, 2016/06/21
- [Qemu-devel] [RFC 02/28] s390x/cpumodel: expose CPU class properties,
David Hildenbrand <=
- [Qemu-devel] [RFC 23/28] qmp: add QMP interface "query-cpu-model-expansion", David Hildenbrand, 2016/06/21
- [Qemu-devel] [RFC 06/28] s390x/cpumodel: introduce CPU feature group definitions, David Hildenbrand, 2016/06/21
- [Qemu-devel] [RFC 12/28] s390x/sclp: factor out preparation of cpu entries, David Hildenbrand, 2016/06/21
- [Qemu-devel] [RFC 09/28] s390x/cpumodel: expose features and feature groups as properties, David Hildenbrand, 2016/06/21
- [Qemu-devel] [RFC 18/28] update linux headers (CPU model), David Hildenbrand, 2016/06/21
- [Qemu-devel] [RFC 24/28] qmp: add QMP interface "query-cpu-model-comparison", David Hildenbrand, 2016/06/21
- [Qemu-devel] [RFC 21/28] s390x/kvm: disable host model for existing compat machines, David Hildenbrand, 2016/06/21