From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=39182 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PxJm3-0005zF-Tq for qemu-devel@nongnu.org; Wed, 09 Mar 2011 08:50:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PxJm0-0000cV-Mk for qemu-devel@nongnu.org; Wed, 09 Mar 2011 08:49:59 -0500 Received: from mail-iw0-f173.google.com ([209.85.214.173]:42525) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PxJm0-0000cB-H8 for qemu-devel@nongnu.org; Wed, 09 Mar 2011 08:49:56 -0500 Received: by iwl42 with SMTP id 42so623813iwl.4 for ; Wed, 09 Mar 2011 05:49:55 -0800 (PST) Message-ID: <4D778545.7040403@codemonkey.ws> Date: Wed, 09 Mar 2011 07:48:53 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 19/22] qapi: add QMP put-event command References: <1299460984-15849-1-git-send-email-aliguori@us.ibm.com> <1299460984-15849-20-git-send-email-aliguori@us.ibm.com> <4D778117.9060505@redhat.com> In-Reply-To: <4D778117.9060505@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: qemu-devel@nongnu.org, Adam Litke , Markus Armbruster , Luiz Capitulino 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 >> >> 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