[Qemu-devel] [PATCH v3 16/17] qmp: Deprecate query-events in favor of query-qmp-schema

Markus Armbruster posted 17 patches 6 years, 9 months ago
Maintainers: Markus Armbruster <armbru@redhat.com>, David Hildenbrand <david@redhat.com>, Christian Borntraeger <borntraeger@de.ibm.com>, Halil Pasic <pasic@linux.ibm.com>, Eduardo Habkost <ehabkost@redhat.com>, Richard Henderson <rth@twiddle.net>, David Gibson <david@gibson.dropbear.id.au>, Gerd Hoffmann <kraxel@redhat.com>, Cornelia Huck <cohuck@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, "Dr. David Alan Gilbert" <dgilbert@redhat.com>, Michael Roth <mdroth@linux.vnet.ibm.com>, Eric Blake <eblake@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>
There is a newer version of this series
[Qemu-devel] [PATCH v3 16/17] qmp: Deprecate query-events in favor of query-qmp-schema
Posted by Markus Armbruster 6 years, 9 months ago
query-events doesn't reflect compile-time configuration.  Instead of
fixing that, deprecate the command in favor of query-qmp-schema.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 monitor.c            | 5 +++++
 qapi/misc.json       | 7 +++++--
 qemu-deprecated.texi | 5 +++++
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/monitor.c b/monitor.c
index eeec289aae..9f27621ed1 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1099,6 +1099,11 @@ CommandInfoList *qmp_query_commands(Error **errp)
 
 EventInfoList *qmp_query_events(Error **errp)
 {
+    /*
+     * TODO This deprecated command is the only user of
+     * QAPIEvent_str() and QAPIEvent_lookup[].  When the command goes,
+     * they should go, too.
+     */
     EventInfoList *info, *ev_list = NULL;
     QAPIEvent e;
 
diff --git a/qapi/misc.json b/qapi/misc.json
index 82f9147353..98f59f828a 100644
--- a/qapi/misc.json
+++ b/qapi/misc.json
@@ -318,12 +318,15 @@
 ##
 # @query-events:
 #
-# Return a list of supported QMP events by this server
+# Return information on QMP events.
 #
-# Returns: A list of @EventInfo for all supported events
+# Returns: A list of @EventInfo.
 #
 # Since: 1.2.0
 #
+# Note: This command is deprecated, because its output doesn't reflect
+# compile-time configuration.  Use query-qmp-schema instead.
+#
 # Example:
 #
 # -> { "execute": "query-events" }
diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi
index 9cc20b365c..3288e102d6 100644
--- a/qemu-deprecated.texi
+++ b/qemu-deprecated.texi
@@ -103,6 +103,11 @@ Use ``device_add'' for hotplugging vCPUs instead of ``cpu-add''.  See
 documentation of ``query-hotpluggable-cpus'' for additional
 details.
 
+@subsection query-events (since 4.0)
+
+The ``query-events'' command has been superseded by the more powerful
+and accurate ``query-qmp-schema'' command.
+
 @section Human Monitor Protocol (HMP) commands
 
 @subsection The hub_id parameter of 'hostfwd_add' / 'hostfwd_remove' (since 3.1)
-- 
2.17.2


Re: [Qemu-devel] [PATCH v3 16/17] qmp: Deprecate query-events in favor of query-qmp-schema
Posted by Marc-André Lureau 6 years, 9 months ago
Hi
On Wed, Feb 6, 2019 at 7:17 PM Markus Armbruster <armbru@redhat.com> wrote:
>
> query-events doesn't reflect compile-time configuration.  Instead of
> fixing that, deprecate the command in favor of query-qmp-schema.
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

sounds good to me (regardless on when the command is actually removed,
depending on libvirt needs).

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

> ---
>  monitor.c            | 5 +++++
>  qapi/misc.json       | 7 +++++--
>  qemu-deprecated.texi | 5 +++++
>  3 files changed, 15 insertions(+), 2 deletions(-)
>
> diff --git a/monitor.c b/monitor.c
> index eeec289aae..9f27621ed1 100644
> --- a/monitor.c
> +++ b/monitor.c
> @@ -1099,6 +1099,11 @@ CommandInfoList *qmp_query_commands(Error **errp)
>
>  EventInfoList *qmp_query_events(Error **errp)
>  {
> +    /*
> +     * TODO This deprecated command is the only user of
> +     * QAPIEvent_str() and QAPIEvent_lookup[].  When the command goes,
> +     * they should go, too.
> +     */
>      EventInfoList *info, *ev_list = NULL;
>      QAPIEvent e;
>
> diff --git a/qapi/misc.json b/qapi/misc.json
> index 82f9147353..98f59f828a 100644
> --- a/qapi/misc.json
> +++ b/qapi/misc.json
> @@ -318,12 +318,15 @@
>  ##
>  # @query-events:
>  #
> -# Return a list of supported QMP events by this server
> +# Return information on QMP events.
>  #
> -# Returns: A list of @EventInfo for all supported events
> +# Returns: A list of @EventInfo.
>  #
>  # Since: 1.2.0
>  #
> +# Note: This command is deprecated, because its output doesn't reflect
> +# compile-time configuration.  Use query-qmp-schema instead.
> +#
>  # Example:
>  #
>  # -> { "execute": "query-events" }
> diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi
> index 9cc20b365c..3288e102d6 100644
> --- a/qemu-deprecated.texi
> +++ b/qemu-deprecated.texi
> @@ -103,6 +103,11 @@ Use ``device_add'' for hotplugging vCPUs instead of ``cpu-add''.  See
>  documentation of ``query-hotpluggable-cpus'' for additional
>  details.
>
> +@subsection query-events (since 4.0)
> +
> +The ``query-events'' command has been superseded by the more powerful
> +and accurate ``query-qmp-schema'' command.
> +
>  @section Human Monitor Protocol (HMP) commands
>
>  @subsection The hub_id parameter of 'hostfwd_add' / 'hostfwd_remove' (since 3.1)
> --
> 2.17.2
>

Re: [Qemu-devel] [PATCH v3 16/17] qmp: Deprecate query-events in favor of query-qmp-schema
Posted by Eric Blake 6 years, 9 months ago
Adding libvirt in cc

On 2/6/19 12:17 PM, Markus Armbruster wrote:
> query-events doesn't reflect compile-time configuration.  Instead of
> fixing that, deprecate the command in favor of query-qmp-schema.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  monitor.c            | 5 +++++
>  qapi/misc.json       | 7 +++++--
>  qemu-deprecated.texi | 5 +++++
>  3 files changed, 15 insertions(+), 2 deletions(-)

Libvirt uses query-events; we'll need to patch libvirt to start relying
on query-qmp-schema before this deprecation cycle can complete (although
I'm in favor of making the change).

> 
> diff --git a/monitor.c b/monitor.c
> index eeec289aae..9f27621ed1 100644
> --- a/monitor.c
> +++ b/monitor.c
> @@ -1099,6 +1099,11 @@ CommandInfoList *qmp_query_commands(Error **errp)
>  
>  EventInfoList *qmp_query_events(Error **errp)
>  {
> +    /*
> +     * TODO This deprecated command is the only user of
> +     * QAPIEvent_str() and QAPIEvent_lookup[].  When the command goes,
> +     * they should go, too.
> +     */
>      EventInfoList *info, *ev_list = NULL;
>      QAPIEvent e;
>  
> diff --git a/qapi/misc.json b/qapi/misc.json
> index 82f9147353..98f59f828a 100644
> --- a/qapi/misc.json
> +++ b/qapi/misc.json
> @@ -318,12 +318,15 @@
>  ##
>  # @query-events:
>  #
> -# Return a list of supported QMP events by this server
> +# Return information on QMP events.
>  #
> -# Returns: A list of @EventInfo for all supported events
> +# Returns: A list of @EventInfo.
>  #
>  # Since: 1.2.0
>  #
> +# Note: This command is deprecated, because its output doesn't reflect
> +# compile-time configuration.  Use query-qmp-schema instead.
> +#
>  # Example:
>  #
>  # -> { "execute": "query-events" }
> diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi
> index 9cc20b365c..3288e102d6 100644
> --- a/qemu-deprecated.texi
> +++ b/qemu-deprecated.texi
> @@ -103,6 +103,11 @@ Use ``device_add'' for hotplugging vCPUs instead of ``cpu-add''.  See
>  documentation of ``query-hotpluggable-cpus'' for additional
>  details.
>  
> +@subsection query-events (since 4.0)
> +
> +The ``query-events'' command has been superseded by the more powerful
> +and accurate ``query-qmp-schema'' command.
> +
>  @section Human Monitor Protocol (HMP) commands
>  
>  @subsection The hub_id parameter of 'hostfwd_add' / 'hostfwd_remove' (since 3.1)
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

Re: [libvirt] [Qemu-devel] [PATCH v3 16/17] qmp: Deprecate query-events in favor of query-qmp-schema
Posted by Peter Krempa 6 years, 9 months ago
On Wed, Feb 06, 2019 at 12:42:05 -0600, Eric Blake wrote:
> Adding libvirt in cc
> 
> On 2/6/19 12:17 PM, Markus Armbruster wrote:
> > query-events doesn't reflect compile-time configuration.  Instead of
> > fixing that, deprecate the command in favor of query-qmp-schema.
> > 
> > Signed-off-by: Markus Armbruster <armbru@redhat.com>
> > ---
> >  monitor.c            | 5 +++++
> >  qapi/misc.json       | 7 +++++--
> >  qemu-deprecated.texi | 5 +++++
> >  3 files changed, 15 insertions(+), 2 deletions(-)
> 
> Libvirt uses query-events; we'll need to patch libvirt to start relying
> on query-qmp-schema before this deprecation cycle can complete (although
> I'm in favor of making the change).

Patches to use 'query-qmp-schema' output rather than 'query-events' in
libvirt:

https://www.redhat.com/archives/libvir-list/2019-February/msg00298.html

You can start the deprecation clock.
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [Qemu-devel] [PATCH v3 16/17] qmp: Deprecate query-events in favor of query-qmp-schema
Posted by Markus Armbruster 6 years, 9 months ago
Peter Krempa <pkrempa@redhat.com> writes:

> On Wed, Feb 06, 2019 at 12:42:05 -0600, Eric Blake wrote:
>> Adding libvirt in cc
>> 
>> On 2/6/19 12:17 PM, Markus Armbruster wrote:
>> > query-events doesn't reflect compile-time configuration.  Instead of
>> > fixing that, deprecate the command in favor of query-qmp-schema.
>> > 
>> > Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> > ---
>> >  monitor.c            | 5 +++++
>> >  qapi/misc.json       | 7 +++++--
>> >  qemu-deprecated.texi | 5 +++++
>> >  3 files changed, 15 insertions(+), 2 deletions(-)
>> 
>> Libvirt uses query-events; we'll need to patch libvirt to start relying
>> on query-qmp-schema before this deprecation cycle can complete (although
>> I'm in favor of making the change).
>
> Patches to use 'query-qmp-schema' output rather than 'query-events' in
> libvirt:
>
> https://www.redhat.com/archives/libvir-list/2019-February/msg00298.html
>
> You can start the deprecation clock.

Awesome!

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [Qemu-devel] [libvirt] [PATCH v3 16/17] qmp: Deprecate query-events in favor of query-qmp-schema
Posted by Peter Krempa 6 years, 9 months ago
On Thu, Feb 07, 2019 at 14:46:41 +0100, Markus Armbruster wrote:
> Peter Krempa <pkrempa@redhat.com> writes:
> 
> > On Wed, Feb 06, 2019 at 12:42:05 -0600, Eric Blake wrote:
> >> Adding libvirt in cc
> >> 
> >> On 2/6/19 12:17 PM, Markus Armbruster wrote:
> >> > query-events doesn't reflect compile-time configuration.  Instead of
> >> > fixing that, deprecate the command in favor of query-qmp-schema.
> >> > 
> >> > Signed-off-by: Markus Armbruster <armbru@redhat.com>
> >> > ---
> >> >  monitor.c            | 5 +++++
> >> >  qapi/misc.json       | 7 +++++--
> >> >  qemu-deprecated.texi | 5 +++++
> >> >  3 files changed, 15 insertions(+), 2 deletions(-)
> >> 
> >> Libvirt uses query-events; we'll need to patch libvirt to start relying
> >> on query-qmp-schema before this deprecation cycle can complete (although
> >> I'm in favor of making the change).
> >
> > Patches to use 'query-qmp-schema' output rather than 'query-events' in
> > libvirt:
> >
> > https://www.redhat.com/archives/libvir-list/2019-February/msg00298.html
> >
> > You can start the deprecation clock.
> 
> Awesome!

It's now pushed. Thankfully our existing infrastructure for querying
schema was able to handle it without any changes.