[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [Patch v3 03/30] s390x/cpumodel: expose CPU class propertie
From: |
David Hildenbrand |
Subject: |
[Qemu-devel] [Patch v3 03/30] s390x/cpumodel: expose CPU class properties |
Date: |
Wed, 24 Aug 2016 20:10:39 +0200 |
Let's expose the description and migration safety and whether a definition
is static, 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 | 25 +++++++++++++++++++++++++
3 files changed, 27 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 e34742e..075bb37 100644
--- a/target-s390x/cpu.h
+++ b/target-s390x/cpu.h
@@ -631,6 +631,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 01f442c..7b887f7 100644
--- a/target-s390x/cpu_models.c
+++ b/target-s390x/cpu_models.c
@@ -110,6 +110,31 @@ static void s390_cpu_model_finalize(Object *obj)
{
}
+static bool get_is_migration_safe(Object *obj, Error **errp)
+{
+ return S390_CPU_GET_CLASS(obj)->is_migration_safe;
+}
+
+static bool get_is_static(Object *obj, Error **errp)
+{
+ return S390_CPU_GET_CLASS(obj)->is_static;
+}
+
+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, "migration-safe", get_is_migration_safe,
+ NULL, NULL);
+ object_class_property_add_bool(oc, "static", get_is_static,
+ 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] [Patch v3 04/30] s390x/cpumodel: introduce CPU features, (continued)
- [Qemu-devel] [Patch v3 04/30] s390x/cpumodel: introduce CPU features, David Hildenbrand, 2016/08/24
- [Qemu-devel] [Patch v3 12/30] s390x/cpumodel: check and apply the CPU model, David Hildenbrand, 2016/08/24
- [Qemu-devel] [Patch v3 13/30] s390x/sclp: factor out preparation of cpu entries, David Hildenbrand, 2016/08/24
- [Qemu-devel] [Patch v3 22/30] s390x/kvm: disable host model for problematic compat machines, David Hildenbrand, 2016/08/24
- [Qemu-devel] [Patch v3 02/30] s390x/cpumodel: "host" and "qemu" as CPU subclasses, David Hildenbrand, 2016/08/24
- [Qemu-devel] [Patch v3 28/30] s390x/cpumodel: implement QMP interface "query-cpu-model-expansion", David Hildenbrand, 2016/08/24
- [Qemu-devel] [Patch v3 29/30] s390x/cpumodel: implement QMP interface "query-cpu-model-comparison", David Hildenbrand, 2016/08/24
- [Qemu-devel] [Patch v3 17/30] s390x/sclp: propagate the mha via sclp, David Hildenbrand, 2016/08/24
- [Qemu-devel] [Patch v3 11/30] s390x/cpumodel: let the CPU model handle feature checks, David Hildenbrand, 2016/08/24
- [Qemu-devel] [Patch v3 30/30] s390x/cpumodel: implement QMP interface "query-cpu-model-baseline", David Hildenbrand, 2016/08/24
- [Qemu-devel] [Patch v3 03/30] s390x/cpumodel: expose CPU class properties,
David Hildenbrand <=
- [Qemu-devel] [Patch v3 18/30] s390x/sclp: propagate hmfai, David Hildenbrand, 2016/08/24
- [Qemu-devel] [Patch v3 08/30] s390x/cpumodel: register defined CPU models as subclasses, David Hildenbrand, 2016/08/24
- [Qemu-devel] [Patch v3 27/30] qmp: add QMP interface "query-cpu-model-baseline", David Hildenbrand, 2016/08/24
- [Qemu-devel] [Patch v3 26/30] qmp: add QMP interface "query-cpu-model-comparison", David Hildenbrand, 2016/08/24
- [Qemu-devel] [Patch v3 24/30] s390x/kvm: don't enable key wrapping if msa3 is disabled, David Hildenbrand, 2016/08/24
- [Qemu-devel] [Patch v3 21/30] s390x/kvm: implement CPU model support, David Hildenbrand, 2016/08/24
- [Qemu-devel] [Patch v3 16/30] s390x/sclp: propagate the ibc val(lowest and unblocked ibc), David Hildenbrand, 2016/08/24
- [Qemu-devel] [Patch v3 09/30] s390x/cpumodel: store the CPU model in the CPU instance, David Hildenbrand, 2016/08/24