diff options
author | David Hildenbrand | 2016-09-05 10:52:17 +0200 |
---|---|---|
committer | Cornelia Huck | 2016-09-06 17:06:49 +0200 |
commit | 6efadc905038ac21e7a5e67392c88368932ec5a9 (patch) | |
tree | d2f50070b075d075b0e5df982bbec0eef20cd918 /target-s390x/cpu_models.c | |
parent | s390x/cpumodel: "host" and "qemu" as CPU subclasses (diff) | |
download | qemu-6efadc905038ac21e7a5e67392c88368932ec5a9.tar.gz qemu-6efadc905038ac21e7a5e67392c88368932ec5a9.tar.xz qemu-6efadc905038ac21e7a5e67392c88368932ec5a9.zip |
s390x/cpumodel: expose CPU class properties
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 <cornelia.huck@de.ibm.com>
Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Message-Id: <20160905085244.99980-4-dahi@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'target-s390x/cpu_models.c')
-rw-r--r-- | target-s390x/cpu_models.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/target-s390x/cpu_models.c b/target-s390x/cpu_models.c index 49969e87a1..b043c63cf1 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) { |