All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2] qmp: Disable query-cpu-* commands when they're unavailable
@ 2016-10-05 19:49 Eduardo Habkost
  2016-10-05 19:52 ` Eric Blake
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Eduardo Habkost @ 2016-10-05 19:49 UTC (permalink / raw)
  To: qemu-devel, armbru
  Cc: peter.maydell, dahi, agraf, borntraeger, jjherne, cornelia.huck,
	pbonzini, jdenemar, david, eblake, rth

Instead of requiring clients to actually call the query-cpu-*
commands to find out if they are implemented, remove them from
the output of "query-commands", so clients know they are not
available.

This is implemented by extending the existing hack at
qmp_unregister_commands_hack(). I wish I could avoid adding even
more #ifdefs to that code, but that's the solution we have today.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Changes v1 -> v2:
* Instead of adding new qmp_commands_init() and
  arch_qmp_commands_init() functions, simply extend the hack at
  qmp_unregister_commands_hack()
---
 monitor.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/monitor.c b/monitor.c
index 83c4edf..4ff74b7 100644
--- a/monitor.c
+++ b/monitor.c
@@ -992,6 +992,15 @@ static void qmp_unregister_commands_hack(void)
 #ifndef TARGET_ARM
     qmp_unregister_command("query-gic-capabilities");
 #endif
+#if !defined(TARGET_S390X)
+    qmp_unregister_command("query-cpu-model-expansion");
+    qmp_unregister_command("query-cpu-model-baseline");
+    qmp_unregister_command("query-cpu-model-comparison");
+#endif
+#if !defined(TARGET_PPC) && !defined(TARGET_ARM) && !defined(TARGET_I386) \
+    && !defined(TARGET_S390X)
+    qmp_unregister_command("query-cpu-definitions");
+#endif
 }
 
 static void qmp_init_marshal(void)
-- 
2.7.4

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

* Re: [Qemu-devel] [PATCH v2] qmp: Disable query-cpu-* commands when they're unavailable
  2016-10-05 19:49 [Qemu-devel] [PATCH v2] qmp: Disable query-cpu-* commands when they're unavailable Eduardo Habkost
@ 2016-10-05 19:52 ` Eric Blake
  2016-10-06 14:17 ` Markus Armbruster
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Eric Blake @ 2016-10-05 19:52 UTC (permalink / raw)
  To: Eduardo Habkost, qemu-devel, armbru
  Cc: peter.maydell, dahi, agraf, borntraeger, jjherne, cornelia.huck,
	pbonzini, jdenemar, david, rth

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

On 10/05/2016 02:49 PM, Eduardo Habkost wrote:
> Instead of requiring clients to actually call the query-cpu-*
> commands to find out if they are implemented, remove them from
> the output of "query-commands", so clients know they are not
> available.
> 
> This is implemented by extending the existing hack at
> qmp_unregister_commands_hack(). I wish I could avoid adding even
> more #ifdefs to that code, but that's the solution we have today.
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
> Changes v1 -> v2:
> * Instead of adding new qmp_commands_init() and
>   arch_qmp_commands_init() functions, simply extend the hack at
>   qmp_unregister_commands_hack()
> ---
>  monitor.c | 9 +++++++++
>  1 file changed, 9 insertions(+)

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
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 v2] qmp: Disable query-cpu-* commands when they're unavailable
  2016-10-05 19:49 [Qemu-devel] [PATCH v2] qmp: Disable query-cpu-* commands when they're unavailable Eduardo Habkost
  2016-10-05 19:52 ` Eric Blake
@ 2016-10-06 14:17 ` Markus Armbruster
  2016-10-07 12:03 ` Markus Armbruster
  2016-10-07 12:05 ` Christian Borntraeger
  3 siblings, 0 replies; 5+ messages in thread
From: Markus Armbruster @ 2016-10-06 14:17 UTC (permalink / raw)
  To: Eduardo Habkost
  Cc: qemu-devel, peter.maydell, dahi, agraf, borntraeger, jjherne,
	cornelia.huck, pbonzini, jdenemar, rth, david

Eduardo Habkost <ehabkost@redhat.com> writes:

> Instead of requiring clients to actually call the query-cpu-*
> commands to find out if they are implemented, remove them from
> the output of "query-commands", so clients know they are not
> available.
>
> This is implemented by extending the existing hack at
> qmp_unregister_commands_hack(). I wish I could avoid adding even
> more #ifdefs to that code, but that's the solution we have today.
>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
> Changes v1 -> v2:
> * Instead of adding new qmp_commands_init() and
>   arch_qmp_commands_init() functions, simply extend the hack at
>   qmp_unregister_commands_hack()
> ---
>  monitor.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/monitor.c b/monitor.c
> index 83c4edf..4ff74b7 100644
> --- a/monitor.c
> +++ b/monitor.c
> @@ -992,6 +992,15 @@ static void qmp_unregister_commands_hack(void)
>  #ifndef TARGET_ARM
>      qmp_unregister_command("query-gic-capabilities");
>  #endif
> +#if !defined(TARGET_S390X)
> +    qmp_unregister_command("query-cpu-model-expansion");
> +    qmp_unregister_command("query-cpu-model-baseline");
> +    qmp_unregister_command("query-cpu-model-comparison");
> +#endif
> +#if !defined(TARGET_PPC) && !defined(TARGET_ARM) && !defined(TARGET_I386) \
> +    && !defined(TARGET_S390X)
> +    qmp_unregister_command("query-cpu-definitions");
> +#endif
>  }
>  
>  static void qmp_init_marshal(void)

Reviewed-by: Markus Armbruster <armbru@redhat.com>

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

* Re: [Qemu-devel] [PATCH v2] qmp: Disable query-cpu-* commands when they're unavailable
  2016-10-05 19:49 [Qemu-devel] [PATCH v2] qmp: Disable query-cpu-* commands when they're unavailable Eduardo Habkost
  2016-10-05 19:52 ` Eric Blake
  2016-10-06 14:17 ` Markus Armbruster
@ 2016-10-07 12:03 ` Markus Armbruster
  2016-10-07 12:05 ` Christian Borntraeger
  3 siblings, 0 replies; 5+ messages in thread
From: Markus Armbruster @ 2016-10-07 12:03 UTC (permalink / raw)
  To: Eduardo Habkost
  Cc: qemu-devel, peter.maydell, dahi, agraf, borntraeger, jjherne,
	cornelia.huck, pbonzini, jdenemar, rth, david

Eduardo Habkost <ehabkost@redhat.com> writes:

> Instead of requiring clients to actually call the query-cpu-*
> commands to find out if they are implemented, remove them from
> the output of "query-commands", so clients know they are not
> available.
>
> This is implemented by extending the existing hack at
> qmp_unregister_commands_hack(). I wish I could avoid adding even
> more #ifdefs to that code, but that's the solution we have today.
>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>

Applied to my qapi-next branch.  Thanks!

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

* Re: [Qemu-devel] [PATCH v2] qmp: Disable query-cpu-* commands when they're unavailable
  2016-10-05 19:49 [Qemu-devel] [PATCH v2] qmp: Disable query-cpu-* commands when they're unavailable Eduardo Habkost
                   ` (2 preceding siblings ...)
  2016-10-07 12:03 ` Markus Armbruster
@ 2016-10-07 12:05 ` Christian Borntraeger
  3 siblings, 0 replies; 5+ messages in thread
From: Christian Borntraeger @ 2016-10-07 12:05 UTC (permalink / raw)
  To: Eduardo Habkost, qemu-devel, armbru
  Cc: peter.maydell, dahi, agraf, jjherne, cornelia.huck, pbonzini,
	jdenemar, david, eblake, rth

On 10/05/2016 09:49 PM, Eduardo Habkost wrote:
> Instead of requiring clients to actually call the query-cpu-*
> commands to find out if they are implemented, remove them from
> the output of "query-commands", so clients know they are not
> available.
> 
> This is implemented by extending the existing hack at
> qmp_unregister_commands_hack(). I wish I could avoid adding even
> more #ifdefs to that code, but that's the solution we have today.
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
> Changes v1 -> v2:
> * Instead of adding new qmp_commands_init() and
>   arch_qmp_commands_init() functions, simply extend the hack at
>   qmp_unregister_commands_hack()
> ---
>  monitor.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/monitor.c b/monitor.c
> index 83c4edf..4ff74b7 100644
> --- a/monitor.c
> +++ b/monitor.c
> @@ -992,6 +992,15 @@ static void qmp_unregister_commands_hack(void)
>  #ifndef TARGET_ARM
>      qmp_unregister_command("query-gic-capabilities");
>  #endif
> +#if !defined(TARGET_S390X)
> +    qmp_unregister_command("query-cpu-model-expansion");
> +    qmp_unregister_command("query-cpu-model-baseline");
> +    qmp_unregister_command("query-cpu-model-comparison");
> +#endif
> +#if !defined(TARGET_PPC) && !defined(TARGET_ARM) && !defined(TARGET_I386) \
> +    && !defined(TARGET_S390X)
> +    qmp_unregister_command("query-cpu-definitions");
> +#endif

Had no chance to test that, but the patch looks sane.

>  }
> 
>  static void qmp_init_marshal(void)
> 

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

end of thread, other threads:[~2016-10-07 12:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-05 19:49 [Qemu-devel] [PATCH v2] qmp: Disable query-cpu-* commands when they're unavailable Eduardo Habkost
2016-10-05 19:52 ` Eric Blake
2016-10-06 14:17 ` Markus Armbruster
2016-10-07 12:03 ` Markus Armbruster
2016-10-07 12:05 ` Christian Borntraeger

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.