]> git.proxmox.com Git - mirror_qemu.git/commitdiff
qmp: Report QOM type name on query-cpu-definitions
authorEduardo Habkost <ehabkost@redhat.com>
Wed, 16 Nov 2016 18:21:39 +0000 (16:21 -0200)
committerEduardo Habkost <ehabkost@redhat.com>
Thu, 12 Jan 2017 17:51:36 +0000 (15:51 -0200)
The new typename attribute on query-cpu-definitions will be used
to help management software use device-list-properties to check
which properties can be set using -cpu or -global for the CPU
model.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <1479320499-29818-1-git-send-email-ehabkost@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
qapi-schema.json
target/arm/helper.c
target/i386/cpu.c
target/ppc/translate_init.c
target/s390x/cpu_models.c

index e42998edec9615b4291d8bb71837293a7dc62169..ce20f16757cb2ea92b3bdbfeaac36b43720de14f 100644 (file)
 # @unavailable-features: #optional List of properties that prevent
 #                        the CPU model from running in the current
 #                        host. (since 2.8)
+# @typename: Type name that can be used as argument to @device-list-properties,
+#            to introspect properties configurable using -cpu or -global.
+#            (since 2.9)
 #
 # @unavailable-features is a list of QOM property names that
 # represent CPU model attributes that prevent the CPU from running.
 ##
 { 'struct': 'CpuDefinitionInfo',
   'data': { 'name': 'str', '*migration-safe': 'bool', 'static': 'bool',
-            '*unavailable-features': [ 'str' ] } }
+            '*unavailable-features': [ 'str' ], 'typename': 'str' } }
 
 ##
 # @query-cpu-definitions:
index 8dcabbf57654601c5370a4e30994886953eb8eb0..9f1a335e3f32f75b08dcfa745ec55e443701dac6 100644 (file)
@@ -5214,6 +5214,7 @@ static void arm_cpu_add_definition(gpointer data, gpointer user_data)
     info = g_malloc0(sizeof(*info));
     info->name = g_strndup(typename,
                            strlen(typename) - strlen("-" TYPE_ARM_CPU));
+    info->q_typename = g_strdup(typename);
 
     entry = g_malloc0(sizeof(*entry));
     entry->value = info;
index b0640f1e38d85a173a9fc34b40ac695fd4f97b47..a149c8dc4224165e533b31a5683dc305883fcac5 100644 (file)
@@ -2235,6 +2235,7 @@ static void x86_cpu_definition_entry(gpointer data, gpointer user_data)
     info->name = x86_cpu_class_get_model_name(cc);
     x86_cpu_class_check_missing_features(cc, &info->unavailable_features);
     info->has_unavailable_features = true;
+    info->q_typename = g_strdup(object_class_get_name(oc));
 
     entry = g_malloc0(sizeof(*entry));
     entry->value = info;
index 626e03186cdacd71c5b19ccc626dd8476df5897b..19ef2505e4a3c3dbb2831bc2d696f925f466dc29 100644 (file)
@@ -10305,6 +10305,7 @@ CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp)
 
         info = g_malloc0(sizeof(*info));
         info->name = g_strdup(alias->alias);
+        info->q_typename = g_strdup(object_class_get_name(oc));
 
         entry = g_malloc0(sizeof(*entry));
         entry->value = info;
index c1e729df5ed09bc22a0799e6b9316017006ce265..5b66d3325d55fed03b10c72885aa02b2f472e389 100644 (file)
@@ -290,6 +290,7 @@ static void create_cpu_model_list(ObjectClass *klass, void *opaque)
     info->has_migration_safe = true;
     info->migration_safe = scc->is_migration_safe;
     info->q_static = scc->is_static;
+    info->q_typename = g_strdup(object_class_get_name(klass));
 
 
     entry = g_malloc0(sizeof(*entry));