All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for-2.9] qmp: Report QOM type name on query-cpu-definitions
@ 2016-11-16 18:21 Eduardo Habkost
  2016-11-16 18:47 ` Eric Blake
  2016-11-17 12:38 ` Markus Armbruster
  0 siblings, 2 replies; 5+ messages in thread
From: Eduardo Habkost @ 2016-11-16 18:21 UTC (permalink / raw)
  To: qemu-devel, Markus Armbruster, Eric Blake
  Cc: David Gibson, Paolo Bonzini, Daniel P. Berrange, Jiri Denemark,
	Peter Maydell, Richard Henderson, Alexander Graf, qemu-arm,
	qemu-ppc, libvir-list

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>
---
 qapi-schema.json            | 4 +++-
 target-arm/helper.c         | 1 +
 target-i386/cpu.c           | 1 +
 target-ppc/translate_init.c | 1 +
 target-s390x/cpu_models.c   | 1 +
 5 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/qapi-schema.json b/qapi-schema.json
index b0b4bf6..9a3bdd4 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -3216,6 +3216,8 @@
 # @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.
 #
 # @unavailable-features is a list of QOM property names that
 # represent CPU model attributes that prevent the CPU from running.
@@ -3237,7 +3239,7 @@
 ##
 { 'struct': 'CpuDefinitionInfo',
   'data': { 'name': 'str', '*migration-safe': 'bool', 'static': 'bool',
-            '*unavailable-features': [ 'str' ] } }
+            '*unavailable-features': [ 'str' ], 'typename': 'str' } }
 
 ##
 # @query-cpu-definitions:
diff --git a/target-arm/helper.c b/target-arm/helper.c
index b5b65ca..3fc01b5 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -5207,6 +5207,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;
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 6eec5dc..725f6cb 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -2239,6 +2239,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;
diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
index 208fa1e..42b9274 100644
--- a/target-ppc/translate_init.c
+++ b/target-ppc/translate_init.c
@@ -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;
diff --git a/target-s390x/cpu_models.c b/target-s390x/cpu_models.c
index c1e729d..5b66d33 100644
--- a/target-s390x/cpu_models.c
+++ b/target-s390x/cpu_models.c
@@ -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));
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.9] qmp: Report QOM type name on query-cpu-definitions
  2016-11-16 18:21 [Qemu-devel] [PATCH for-2.9] qmp: Report QOM type name on query-cpu-definitions Eduardo Habkost
@ 2016-11-16 18:47 ` Eric Blake
  2016-11-16 19:02   ` Eduardo Habkost
  2016-11-17 12:38 ` Markus Armbruster
  1 sibling, 1 reply; 5+ messages in thread
From: Eric Blake @ 2016-11-16 18:47 UTC (permalink / raw)
  To: Eduardo Habkost, qemu-devel, Markus Armbruster
  Cc: David Gibson, Paolo Bonzini, Daniel P. Berrange, Jiri Denemark,
	Peter Maydell, Richard Henderson, Alexander Graf, qemu-arm,
	qemu-ppc, libvir-list

[-- Attachment #1: Type: text/plain, Size: 1662 bytes --]

On 11/16/2016 12:21 PM, Eduardo Habkost wrote:
> 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>
> ---
>  qapi-schema.json            | 4 +++-
>  target-arm/helper.c         | 1 +
>  target-i386/cpu.c           | 1 +
>  target-ppc/translate_init.c | 1 +
>  target-s390x/cpu_models.c   | 1 +
>  5 files changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/qapi-schema.json b/qapi-schema.json
> index b0b4bf6..9a3bdd4 100644
> --- a/qapi-schema.json
> +++ b/qapi-schema.json
> @@ -3216,6 +3216,8 @@
>  # @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.

Missing a '(since 2.9)' designation.

>  #
>  # @unavailable-features is a list of QOM property names that
>  # represent CPU model attributes that prevent the CPU from running.
> @@ -3237,7 +3239,7 @@
>  ##
>  { 'struct': 'CpuDefinitionInfo',
>    'data': { 'name': 'str', '*migration-safe': 'bool', 'static': 'bool',
> -            '*unavailable-features': [ 'str' ] } }
> +            '*unavailable-features': [ 'str' ], 'typename': 'str' } }
>  

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.9] qmp: Report QOM type name on query-cpu-definitions
  2016-11-16 18:47 ` Eric Blake
@ 2016-11-16 19:02   ` Eduardo Habkost
  0 siblings, 0 replies; 5+ messages in thread
From: Eduardo Habkost @ 2016-11-16 19:02 UTC (permalink / raw)
  To: Eric Blake
  Cc: qemu-devel, Markus Armbruster, David Gibson, Paolo Bonzini,
	Daniel P. Berrange, Jiri Denemark, Peter Maydell,
	Richard Henderson, Alexander Graf, qemu-arm, qemu-ppc,
	libvir-list

On Wed, Nov 16, 2016 at 12:47:14PM -0600, Eric Blake wrote:
> On 11/16/2016 12:21 PM, Eduardo Habkost wrote:
> > 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>
> > ---
> >  qapi-schema.json            | 4 +++-
> >  target-arm/helper.c         | 1 +
> >  target-i386/cpu.c           | 1 +
> >  target-ppc/translate_init.c | 1 +
> >  target-s390x/cpu_models.c   | 1 +
> >  5 files changed, 7 insertions(+), 1 deletion(-)
> > 
> > diff --git a/qapi-schema.json b/qapi-schema.json
> > index b0b4bf6..9a3bdd4 100644
> > --- a/qapi-schema.json
> > +++ b/qapi-schema.json
> > @@ -3216,6 +3216,8 @@
> >  # @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.
> 
> Missing a '(since 2.9)' designation.

Oops. I will add it the next version. Thanks!

> 
> >  #
> >  # @unavailable-features is a list of QOM property names that
> >  # represent CPU model attributes that prevent the CPU from running.
> > @@ -3237,7 +3239,7 @@
> >  ##
> >  { 'struct': 'CpuDefinitionInfo',
> >    'data': { 'name': 'str', '*migration-safe': 'bool', 'static': 'bool',
> > -            '*unavailable-features': [ 'str' ] } }
> > +            '*unavailable-features': [ 'str' ], 'typename': 'str' } }
> >  
> 
> -- 
> Eric Blake   eblake redhat com    +1-919-301-3266
> Libvirt virtualization library http://libvirt.org
> 

-- 
Eduardo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.9] qmp: Report QOM type name on query-cpu-definitions
  2016-11-16 18:21 [Qemu-devel] [PATCH for-2.9] qmp: Report QOM type name on query-cpu-definitions Eduardo Habkost
  2016-11-16 18:47 ` Eric Blake
@ 2016-11-17 12:38 ` Markus Armbruster
  2016-11-17 13:26   ` Eduardo Habkost
  1 sibling, 1 reply; 5+ messages in thread
From: Markus Armbruster @ 2016-11-17 12:38 UTC (permalink / raw)
  To: Eduardo Habkost
  Cc: qemu-devel, Eric Blake, Peter Maydell, libvir-list,
	Alexander Graf, qemu-arm, qemu-ppc, Paolo Bonzini, David Gibson,
	Jiri Denemark, Richard Henderson

Eduardo Habkost <ehabkost@redhat.com> writes:

> 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>
> ---
>  qapi-schema.json            | 4 +++-
>  target-arm/helper.c         | 1 +
>  target-i386/cpu.c           | 1 +
>  target-ppc/translate_init.c | 1 +
>  target-s390x/cpu_models.c   | 1 +
>  5 files changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/qapi-schema.json b/qapi-schema.json
> index b0b4bf6..9a3bdd4 100644
> --- a/qapi-schema.json
> +++ b/qapi-schema.json
> @@ -3216,6 +3216,8 @@
>  # @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.
>  #
>  # @unavailable-features is a list of QOM property names that
>  # represent CPU model attributes that prevent the CPU from running.
> @@ -3237,7 +3239,7 @@
>  ##
>  { 'struct': 'CpuDefinitionInfo',
>    'data': { 'name': 'str', '*migration-safe': 'bool', 'static': 'bool',
> -            '*unavailable-features': [ 'str' ] } }
> +            '*unavailable-features': [ 'str' ], 'typename': 'str' } }
>  
>  ##
>  # @query-cpu-definitions:
> diff --git a/target-arm/helper.c b/target-arm/helper.c
> index b5b65ca..3fc01b5 100644
> --- a/target-arm/helper.c
> +++ b/target-arm/helper.c
> @@ -5207,6 +5207,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;
> diff --git a/target-i386/cpu.c b/target-i386/cpu.c
> index 6eec5dc..725f6cb 100644
> --- a/target-i386/cpu.c
> +++ b/target-i386/cpu.c
> @@ -2239,6 +2239,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;
> diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
> index 208fa1e..42b9274 100644
> --- a/target-ppc/translate_init.c
> +++ b/target-ppc/translate_init.c
> @@ -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;
> diff --git a/target-s390x/cpu_models.c b/target-s390x/cpu_models.c
> index c1e729d..5b66d33 100644
> --- a/target-s390x/cpu_models.c
> +++ b/target-s390x/cpu_models.c
> @@ -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));

A bit sad that the QOM type name needs to be computed in
target-dependent code.

With Eric's doc fix:
Reviewed-by: Markus Armbruster <armbru@redhat.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.9] qmp: Report QOM type name on query-cpu-definitions
  2016-11-17 12:38 ` Markus Armbruster
@ 2016-11-17 13:26   ` Eduardo Habkost
  0 siblings, 0 replies; 5+ messages in thread
From: Eduardo Habkost @ 2016-11-17 13:26 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: qemu-devel, Eric Blake, Peter Maydell, libvir-list,
	Alexander Graf, qemu-arm, qemu-ppc, Paolo Bonzini, David Gibson,
	Jiri Denemark, Richard Henderson

On Thu, Nov 17, 2016 at 01:38:54PM +0100, Markus Armbruster wrote:
[...]
> A bit sad that the QOM type name needs to be computed in
> target-dependent code.

I plan to provide a generic implementation of
query-cpu-definitions later, to fix this.

> 
> With Eric's doc fix:
> Reviewed-by: Markus Armbruster <armbru@redhat.com>

Thanks!

-- 
Eduardo

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-11-17 13:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-16 18:21 [Qemu-devel] [PATCH for-2.9] qmp: Report QOM type name on query-cpu-definitions Eduardo Habkost
2016-11-16 18:47 ` Eric Blake
2016-11-16 19:02   ` Eduardo Habkost
2016-11-17 12:38 ` Markus Armbruster
2016-11-17 13:26   ` Eduardo Habkost

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.