[Qemu-devel] [RFC v5 17/26] qmp: add new event "request-dropped"

Peter Xu posted 26 patches 8 years, 2 months ago
There is a newer version of this series
[Qemu-devel] [RFC v5 17/26] qmp: add new event "request-dropped"
Posted by Peter Xu 8 years, 2 months ago
This event will be emitted if one QMP request is dropped.  Along,
declare an enum for the reasons.

Signed-off-by: Peter Xu <peterx@redhat.com>
---
 qapi-schema.json | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/qapi-schema.json b/qapi-schema.json
index 531fd4c0db..9d2625b6b3 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -3222,3 +3222,37 @@
 # Since: 2.11
 ##
 { 'command': 'watchdog-set-action', 'data' : {'action': 'WatchdogAction'} }
+
+##
+# @RequestDropReason:
+#
+# Reasons that caused one command to be dropped.
+#
+# @queue-full: the queue of request is full.
+#
+# Since: 2.12
+##
+{ 'enum': 'RequestDropReason',
+  'data': [ 'queue-full' ] }
+
+##
+# @REQUEST_DROPPED:
+#
+# Emitted when one QMP request is dropped due to some reason.
+# REQUEST_DROPPED is only emitted when the oob capability is enabled.
+#
+# @id: The dropped command's "id" field.
+#
+# @reason: The reason why the request is dropped.
+#
+# Since: 2.12
+#
+# Example:
+#
+# { "event": "REQUEST_DROPPED",
+#   "data": {"result": {"id": "libvirt-102",
+#                       "reason": "queue-full" } } }
+#
+##
+{ 'event': 'REQUEST_DROPPED' ,
+  'data': { 'id': 'any', 'reason': 'RequestDropReason' } }
-- 
2.14.3


Re: [Qemu-devel] [RFC v5 17/26] qmp: add new event "request-dropped"
Posted by Stefan Hajnoczi 8 years, 1 month ago
On Tue, Dec 05, 2017 at 01:51:51PM +0800, Peter Xu wrote:
> +##
> +# @RequestDropReason:
> +#
> +# Reasons that caused one command to be dropped.
> +#
> +# @queue-full: the queue of request is full.
> +#
> +# Since: 2.12
> +##
> +{ 'enum': 'RequestDropReason',

qapi-schema.json calls them "commands", not "requests".  Please rename
it CommandDropReason for consistency and update the documentation.

> +  'data': [ 'queue-full' ] }
> +
> +##
> +# @REQUEST_DROPPED:
> +#
> +# Emitted when one QMP request is dropped due to some reason.
> +# REQUEST_DROPPED is only emitted when the oob capability is enabled.

Please make it clear that requests can only be dropped when the oob
capability is enabled.

  Emitted when a command is dropped due to some reason.  Commands can
  only be dropped when the oob capability is enabled.
Re: [Qemu-devel] [RFC v5 17/26] qmp: add new event "request-dropped"
Posted by Peter Xu 8 years, 1 month ago
On Thu, Dec 14, 2017 at 11:16:02AM +0000, Stefan Hajnoczi wrote:
> On Tue, Dec 05, 2017 at 01:51:51PM +0800, Peter Xu wrote:
> > +##
> > +# @RequestDropReason:
> > +#
> > +# Reasons that caused one command to be dropped.
> > +#
> > +# @queue-full: the queue of request is full.
> > +#
> > +# Since: 2.12
> > +##
> > +{ 'enum': 'RequestDropReason',
> 
> qapi-schema.json calls them "commands", not "requests".  Please rename
> it CommandDropReason for consistency and update the documentation.
> 
> > +  'data': [ 'queue-full' ] }
> > +
> > +##
> > +# @REQUEST_DROPPED:
> > +#
> > +# Emitted when one QMP request is dropped due to some reason.
> > +# REQUEST_DROPPED is only emitted when the oob capability is enabled.
> 
> Please make it clear that requests can only be dropped when the oob
> capability is enabled.
> 
>   Emitted when a command is dropped due to some reason.  Commands can
>   only be dropped when the oob capability is enabled.

Will address all comments, including the other reply.

Meanwhile I'll rename REQUEST_DROPPED to COMMAND_DROPPED so no
"request" but all "command" then.  Thanks,

-- 
Peter Xu

Re: [Qemu-devel] [RFC v5 17/26] qmp: add new event "request-dropped"
Posted by Stefan Hajnoczi 8 years, 1 month ago
On Tue, Dec 05, 2017 at 01:51:51PM +0800, Peter Xu wrote:
> +##
> +# @RequestDropReason:
> +#
> +# Reasons that caused one command to be dropped.
> +#
> +# @queue-full: the queue of request is full.

Please add:

  This can only occur when the client sends a new non-oob command before
  the response to the previous non-oob command has been received.

This way simple clients that only send 1 command at a time don't need to
worry about queue-full.  I think this documents the behavior implemented
by this patch series.