All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Wenchao Xia <wenchaoqemu@gmail.com>, qemu-devel@nongnu.org
Cc: mdroth@linux.vnet.ibm.com, armbru@redhat.com, lcapitulino@redhat.com
Subject: Re: [Qemu-devel] [PATCH V6 05/29] qapi: adjust existing defines
Date: Fri, 13 Jun 2014 11:32:46 -0600	[thread overview]
Message-ID: <539B35BE.5030603@redhat.com> (raw)
In-Reply-To: <1401970944-18735-6-git-send-email-wenchaoqemu@gmail.com>

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

On 06/05/2014 06:22 AM, Wenchao Xia wrote:
> In order to let event defines use existing types later, instead of
> redefine new ones, some old type defines for spice and vnc are changed,
> and BlockErrorAction is moved from block.h to qapi schema. Note that
> BlockErrorAction is not merged with BlockdevOnError.

If you were to respin this, I'd split it into two - one part moving
BlockErrorAction from block.h into the schema, and the other tweaking
spice and vnc schema members.  But at this point, I'm more interested in
getting it into the tree than worrying about another round of delays for
a respin.

> 
> One thing not perfect is that, VncInfo should be foldered but may break

s/that,/that/

"foldered" is not a word, but off-hand I have no idea what you meant. [1]

> API stability.
> 
> Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com>
> ---
>  block.c                |   17 ++++---
>  block/backup.c         |    2 +-
>  block/mirror.c         |    7 ++-
>  block/stream.c         |    4 +-
>  blockjob.c             |   11 ++--
>  hmp.c                  |    5 +-
>  hw/block/virtio-blk.c  |    6 +-
>  hw/ide/core.c          |    6 +-
>  hw/scsi/scsi-disk.c    |    6 +-
>  include/block/block.h  |    4 --
>  include/qemu/sockets.h |    2 +
>  qapi-schema.json       |  126 ++++++++++++++++++++++++++++++++++++++----------

Of course, some of this is in qapi/block-core.json now; but Paolo's
rebased series picked up on that.

>  ui/spice-core.c        |    7 ++-
>  ui/vnc.c               |    9 ++--
>  util/qemu-sockets.c    |   10 ++++
>  15 files changed, 156 insertions(+), 66 deletions(-)
> 

> +++ b/qapi-schema.json
> @@ -1163,21 +1163,59 @@
>  { 'command': 'query-blockstats', 'returns': ['BlockStats'] }
>  
>  ##
> -# @VncClientInfo:
> +# @NetworkAddressFamily
>  #
> -# Information about a connected VNC client.
> +# The network address family
> +#
> +# @ipv4: IPV4 family
> +#
> +# @ipv6: IPV6 family
> +#
> +# @unix: unix socket
> +#
> +# @unknown: otherwise
> +#
> +# Since: 2.1
> +##
> +{ 'enum': 'NetworkAddressFamily',
> +  'data': [ 'ipv4', 'ipv6', 'unix', 'unknown' ] }

Nice. Conversion of 'str' to 'NetworkAddressFamily' has no impact to the
on-the-wire format, but makes us have better type safety.

> +
> +##
> +# @VncBasicInfo
>  #
> -# @host: The host name of the client.  QEMU tries to resolve this to a DNS name
> -#        when possible.
> +# The basic information for vnc network connection
>  #
> -# @family: 'ipv6' if the client is connected via IPv6 and TCP
> -#          'ipv4' if the client is connected via IPv4 and TCP
> -#          'unix' if the client is connected via a unix domain socket
> -#          'unknown' otherwise
> +# @host: IP address
>  #
> -# @service: The service name of the client's port.  This may depends on the
> -#           host system's service database so symbolic names should not be
> -#           relied on.
> +# @service: The service name of vnc port. This may depend on the host system's

s/of/of the/

> +#           service database so symbolic names should not be relied on.
> +#
> +# @family: address family
> +#
> +# Since: 2.1
> +##
> +{ 'type': 'VncBasicInfo',
> +  'data': { 'host': 'str',
> +            'service': 'str',
> +            'family': 'NetworkAddressFamily' } }
> +
> +##
> +# @VncServerInfo
> +#
> +# The network connection information for server
> +#
> +# @auth: #optional, authentication method

I wonder if this parameter should eventually be converted to an enum
rather than open-coded str, but that doesn't need to happen right away.

> +#
> +# Since: 2.1
> +##
> +{ 'type': 'VncServerInfo',
> +  'base': 'VncBasicInfo',
> +  'data': { '*auth': 'str' } }
> +
> +##
> +# @VncClientInfo:
> +#
> +# Information about a connected VNC client.
>  #
>  # @x509_dname: #optional If x509 authentication is in use, the Distinguished
>  #              Name of the client.
> @@ -1188,8 +1226,8 @@
>  # Since: 0.14.0
>  ##
>  { 'type': 'VncClientInfo',
> -  'data': {'host': 'str', 'family': 'str', 'service': 'str',
> -           '*x509_dname': 'str', '*sasl_username': 'str'} }
> +  'base': 'VncBasicInfo',
> +  'data': { '*x509_dname'   : 'str', '*sasl_username': 'str' } }

Spurious addition of spaces; s/   :/:/ in your cleanup patch.

>  
>  ##
>  # @VncInfo:
> @@ -1228,7 +1266,8 @@
>  # Since: 0.14.0
>  ##
>  { 'type': 'VncInfo',
> -  'data': {'enabled': 'bool', '*host': 'str', '*family': 'str',
> +  'data': {'enabled': 'bool', '*host': 'str',
> +           '*family': 'NetworkAddressFamily',
>             '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']} }

[1] Okay, I think I see what you meant in your commit message.  You did
NOT convert 'VncInfo' to use 'VncBasicInfo' as a base class, because you
were worried about whether it would break things.  And your worry is
justified - VncBasicInfo marks 'host', 'family', and 'service' as
manadatory, while 'VncInfo' marks them as optional.

If VncInfo is only used on the output side of commands (which indeed
appears to be the case - it is only used as the return of 'query-vnc'),
then converting from optional to mandatory is fine from the
backwards-compatibility aspect; the only question is whether the
existing code for query-vnc has sane defaults for those three fields in
the case where it was previously omitting them.  If you choose to make
that change, do it as a followup patch.  This patch is fine.  And now
that I understand your concern, I'd rewrite that paragraph in the commit
message to this (and either Paolo can rebase it back into his github
tree, or whoever applies the patches can make the tweak when adding my R-b):

At this point, VncInfo is not made a child of VncBasicInfo, due to the
difference in mandatory vs. optional parameters.

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 --]

  reply	other threads:[~2014-06-13 17:33 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-05 12:21 [Qemu-devel] [PATCH V6 00/29] add direct support of event in qapi schema Wenchao Xia
2014-06-05 12:21 ` [Qemu-devel] [PATCH V6 01/29] os-posix: include sys/time.h Wenchao Xia
2014-06-05 12:21 ` [Qemu-devel] [PATCH V6 02/29] qapi: add event helper functions Wenchao Xia
2014-06-05 12:21 ` [Qemu-devel] [PATCH V6 03/29] qapi script: add event support Wenchao Xia
2014-06-13 16:47   ` Eric Blake
2014-06-13 21:28   ` Eric Blake
2014-06-18  3:33   ` Eric Blake
2014-06-18  6:06     ` Paolo Bonzini
2014-06-18 22:45       ` Wenchao Xia
2014-06-18  3:50   ` Eric Blake
2014-06-05 12:21 ` [Qemu-devel] [PATCH V6 04/29] test: add test cases for qapi event Wenchao Xia
2014-06-13 17:05   ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 05/29] qapi: adjust existing defines Wenchao Xia
2014-06-13 17:32   ` Eric Blake [this message]
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 06/29] monitor: add an implemention as qapi event emit method Wenchao Xia
2014-06-13 19:04   ` Eric Blake
2014-06-15  0:27     ` Wenchao Xia
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 07/29] qapi: add new schema file qapi-event.json Wenchao Xia
2014-06-13 19:25   ` Eric Blake
2014-06-13 19:45     ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 08/29] qapi event: convert SHUTDOWN Wenchao Xia
2014-06-13 19:57   ` Eric Blake
2014-06-15  0:32     ` Wenchao Xia
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 09/29] qapi event: convert POWERDOWN Wenchao Xia
2014-06-13 20:02   ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 10/29] qapi event: convert RESET Wenchao Xia
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 11/29] qapi event: convert STOP Wenchao Xia
2014-06-13 20:29   ` Eric Blake
2014-06-17  9:17     ` Paolo Bonzini
2014-06-17 13:18       ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 12/29] qapi event: convert RESUME Wenchao Xia
2014-06-13 20:33   ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 13/29] qapi event: convert SUSPEND Wenchao Xia
2014-06-13 20:40   ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 14/29] qapi event: convert SUSPEND_DISK Wenchao Xia
2014-06-13 20:42   ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 15/29] qapi event: convert WAKEUP Wenchao Xia
2014-06-13 20:57   ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 16/29] qapi event: convert RTC_CHANGE Wenchao Xia
2014-06-13 21:27   ` Eric Blake
2014-06-15  0:38     ` Wenchao Xia
2014-06-15 14:01       ` Paolo Bonzini
2014-06-15 14:00     ` Paolo Bonzini
2014-06-17  9:21     ` Paolo Bonzini
2014-06-17 13:19       ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 17/29] qapi event: convert WATCHDOG Wenchao Xia
2014-06-13 21:47   ` Eric Blake
2014-06-13 22:05     ` Eric Blake
2014-06-15  0:45       ` Wenchao Xia
2014-06-17  9:23     ` Paolo Bonzini
2014-06-17 13:21       ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 18/29] qapi event: convert DEVICE_DELETED Wenchao Xia
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 19/29] qapi event: convert DEVICE_TRAY_MOVED Wenchao Xia
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 20/29] qapi event: convert BLOCK_IO_ERROR and BLOCK_JOB_ERROR Wenchao Xia
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 21/29] qapi event: convert BLOCK_IMAGE_CORRUPTED Wenchao Xia
2014-06-16 22:53   ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 22/29] qapi event: convert other BLOCK_JOB events Wenchao Xia
2014-06-16 22:57   ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 23/29] qapi event: convert NIC_RX_FILTER_CHANGED Wenchao Xia
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 24/29] qapi event: convert VNC events Wenchao Xia
2014-06-16 23:01   ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 25/29] qapi event: convert SPICE events Wenchao Xia
2014-06-16 23:05   ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 26/29] qapi event: convert BALLOON_CHANGE Wenchao Xia
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 27/29] qapi event: convert GUEST_PANICKED Wenchao Xia
2014-06-16 14:08   ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 28/29] qapi event: convert QUORUM events Wenchao Xia
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 29/29] qapi event: clean up Wenchao Xia
2014-06-16 14:09   ` Eric Blake
2014-06-10  5:48 ` [Qemu-devel] [PATCH V6 00/29] add direct support of event in qapi schema Paolo Bonzini
2014-06-15  0:52   ` Wenchao Xia
2014-06-17 10:57     ` Paolo Bonzini
2014-06-17 16:05       ` Eric Blake
2014-06-17 16:30         ` Paolo Bonzini
2014-06-17 22:10           ` Wenchao Xia
2014-06-18  4:00       ` Eric Blake
2014-06-18  6:07         ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=539B35BE.5030603@redhat.com \
    --to=eblake@redhat.com \
    --cc=armbru@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=wenchaoqemu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.