qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 19/22] qapi: add QMP put-event command


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH 19/22] qapi: add QMP put-event command
Date: Wed, 09 Mar 2011 07:48:53 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Lightning/1.0b2 Thunderbird/3.1.8

On 03/09/2011 07:31 AM, Avi Kivity wrote:
On 03/07/2011 03:23 AM, Anthony Liguori wrote:
This is needed for libqmp to support events. put-event is used to disconnect
from signals.

Signed-off-by: Anthony Liguori<address@hidden>

diff --git a/qmp-schema.json b/qmp-schema.json
index 3f2dd4e..a13885f 100644
--- a/qmp-schema.json
+++ b/qmp-schema.json
@@ -58,3 +58,18 @@
  # Since: 0.14.0
  ##
  [ 'qmp_capabilities', {}, {}, 'none' ]
+
+##
+# @put_event:
+#
+# Disconnect a signal. This command is used to disconnect from a signal based
+# on the handle returned by a signal accessor.
+#
+# @tag: the handle returned by a signal accessor.
+#
+# Returns: Nothing on success.
+#          If @tag is not a valid handle, InvalidParameterValue
+#
+# Since: 0.15.0
+##
+[ 'put-event', {'tag': 'int'}, {}, 'none' ]

Why is tag an int?

It's a handle so the type doesn't matter as long as I can make sure values are unique. ints are easier to work with because they don't require memory allocation.

  don't we use strings for command ids and similar?

id's can be any valid JSON value.

But a handle is not the same thing as an id.

Also could be better named, disconnect-event or unlisten-event.

I was going for symmetry with the signal accessors which are typically in the format 'get-block-io-error-event'.

Maybe it would be better to do 'connect-block-io-error-event' and 'disconnect-event'?

Regards,

Anthony Liguori




reply via email to

[Prev in Thread] Current Thread [Next in Thread]