qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Markus Armbruster <armbru@redhat.com>, qemu-devel@nongnu.org
Cc: vilanova@ac.upc.edu, pbonzini@redhat.com, akong@redhat.com,
	mdroth@linux.vnet.ibm.com, lcapitulino@redhat.com
Subject: Re: [Qemu-devel] [PATCH 04/13] qapi: Replace start_optional()/end_optional() by optional()
Date: Mon, 05 May 2014 11:09:05 -0600	[thread overview]
Message-ID: <5367C5B1.9050900@redhat.com> (raw)
In-Reply-To: <1399034675-17844-5-git-send-email-armbru@redhat.com>

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

On 05/02/2014 06:44 AM, Markus Armbruster wrote:
> Semantics of end_optional() differ subtly from the other end_FOO()
> callbacks: when start_FOO() succeeds, the matching end_FOO() gets
> called regardless of what happens in between.  end_optional() gets
> called only when everything in between succeeds as well.  Entirely
> undocumented, like all of the visitor API.
> 
> The only user of Visitor Callback end_optional() never did anything,
> and was removed in commit 9f9ab46.
> 
> I'm about to clean up error handling in the generated visitor code,
> and end_optional() is in my way.  No users mean no test cases, and
> making non-trivial cleanup transformations without test cases doesn't
> strike me as a good idea.
> 
> Drop end_optional(), and rename start_optional() to optional().  We
> can always go back to a pair of callbacks when we have an actual need.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  include/qapi/visitor-impl.h |  5 ++---
>  include/qapi/visitor.h      |  5 ++---
>  qapi/opts-visitor.c         |  5 ++---
>  qapi/qapi-visit-core.c      | 15 ++++-----------
>  qapi/qmp-input-visitor.c    |  6 +++---
>  qapi/string-input-visitor.c |  6 +++---
>  scripts/qapi-commands.py    |  5 ++---
>  scripts/qapi-visit.py       |  3 +--
>  8 files changed, 19 insertions(+), 31 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

> +++ b/qapi/opts-visitor.c
> @@ -483,8 +483,7 @@ opts_type_size(Visitor *v, uint64_t *obj, const char *name, Error **errp)
>  
>  
>  static void
> -opts_start_optional(Visitor *v, bool *present, const char *name,
> -                       Error **errp)
> +opts_optional(Visitor *v, bool *present, const char *name, Error **errp)

Managed to fix an indentation problem while at it :)

-- 
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-05-05 17:09 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-02 12:44 [Qemu-devel] [PATCH 00/13] qapi: Purge error_is_set() Markus Armbruster
2014-05-02 12:44 ` [Qemu-devel] [PATCH 01/13] qapi: Update qapi-code-gen.txt example to match current code Markus Armbruster
2014-05-04  2:40   ` Eric Blake
2014-05-05  6:49     ` Markus Armbruster
2014-05-05 14:20       ` Eric Blake
2014-05-07  7:51         ` Markus Armbruster
2014-05-02 12:44 ` [Qemu-devel] [PATCH 02/13] qapi: Normalize marshalling's visitor initialization and cleanup Markus Armbruster
2014-05-05 14:32   ` Eric Blake
2014-05-02 12:44 ` [Qemu-devel] [PATCH 03/13] qapi: Remove unused Visitor callbacks start_handle(), end_handle() Markus Armbruster
2014-05-05 16:51   ` Eric Blake
2014-05-02 12:44 ` [Qemu-devel] [PATCH 04/13] qapi: Replace start_optional()/end_optional() by optional() Markus Armbruster
2014-05-05 17:09   ` Eric Blake [this message]
2014-05-02 12:44 ` [Qemu-devel] [PATCH 05/13] qapi-visit.py: Clean up confusing push_indent() / pop_indent() use Markus Armbruster
2014-05-05 17:12   ` Eric Blake
2014-05-02 12:44 ` [Qemu-devel] [PATCH 06/13] qapi: Clean up shadowing of parameters and locals in inner scopes Markus Armbruster
2014-05-05 20:42   ` Eric Blake
2014-05-02 12:44 ` [Qemu-devel] [PATCH 07/13] qapi-visit.py: Clean up a sloppy use of field prefix Markus Armbruster
2014-05-05 20:44   ` Eric Blake
2014-05-02 12:44 ` [Qemu-devel] [PATCH 08/13] qapi: Un-inline visit of implicit struct Markus Armbruster
2014-05-05 20:48   ` Eric Blake
2014-05-06 12:30     ` Markus Armbruster
2014-05-02 12:44 ` [Qemu-devel] [PATCH 09/13] hmp: Call visit_end_struct() after visit_start_struct() succeeds Markus Armbruster
2014-05-05 20:50   ` Eric Blake
2014-05-02 12:44 ` [Qemu-devel] [PATCH 10/13] hw: Don't call visit_end_struct() after visit_start_struct() fails Markus Armbruster
2014-05-05 20:56   ` Eric Blake
2014-05-06 12:22     ` Markus Armbruster
2014-05-02 12:44 ` [Qemu-devel] [PATCH 11/13] tests: " Markus Armbruster
2014-05-05 21:12   ` Eric Blake
2014-05-02 12:44 ` [Qemu-devel] [PATCH 12/13] qapi: Replace uncommon use of the error API by the common one Markus Armbruster
2014-05-05 21:43   ` Eric Blake
2014-05-06 12:32     ` Markus Armbruster
2014-05-02 12:44 ` [Qemu-devel] [PATCH 13/13] error: error_is_set() is finally unused; remove Markus Armbruster
2014-05-05 21:45   ` Eric Blake

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=5367C5B1.9050900@redhat.com \
    --to=eblake@redhat.com \
    --cc=akong@redhat.com \
    --cc=armbru@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=vilanova@ac.upc.edu \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).