From: "Daniel P. Berrange" <berrange@redhat.com>
To: "Marc-André Lureau" <mlureau@redhat.com>
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
qemu-devel@nongnu.org, berto@igalia.com, armbru@redhat.com
Subject: Re: [Qemu-devel] [PATCH 2/3] qapi: clear given pointer
Date: Wed, 21 Sep 2016 16:34:14 +0100 [thread overview]
Message-ID: <20160921153414.GW15535@redhat.com> (raw)
In-Reply-To: <1436395991.478799.1474471065062.JavaMail.zimbra@redhat.com>
On Wed, Sep 21, 2016 at 11:17:45AM -0400, Marc-André Lureau wrote:
> Hi
>
> ----- Original Message -----
> > On Wed, Sep 21, 2016 at 02:36:28PM +0400, Marc-André Lureau wrote:
> > > Some getters already set *obj argument to NULL early, let's do this for
> > > all for consistent behaviour in case of errors.
> > >
> > > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> >
> > If we want consistent behaviour, there's plenty more visit methods
> > that need updating beyond these two. eg input_type_int64 will
> > leave '*obj' untouched on error.
> >
> > In fact if we want to have '*obj' given a NULL value on error,
> > then it seems we should instead add code to 'qapi-visit-core.c'
> > to always initialize '*obj' to NULL, instead of doing it in
> > qmp-input-visitor.c That way all visitor implementations get
> > the same behaviour
>
> I think that's not easily doable, as an input visitor will want to set *obj (to NULL or something), but the output visitor may need *obj != NULL as an input.
Oh good point.
> It'snot really elegant that there is visitor-input/output specific code already in the visit-core, I would rather have that code in the respective visitors.
Also, my series of visitor patches will delete opts-visitor and
string-input-visitor, so ultimately qmp-input-visitor will be
the only one left doing input work.
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
next prev parent reply other threads:[~2016-09-21 15:34 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-21 10:36 [Qemu-devel] [PATCH 0/3] qapi: return 'missing parameter' error Marc-André Lureau
2016-09-21 10:36 ` [Qemu-devel] [PATCH 1/3] qapi: return a " Marc-André Lureau
2016-09-21 12:57 ` Alberto Garcia
2016-09-21 14:33 ` Markus Armbruster
2016-09-21 15:05 ` Marc-André Lureau
2016-09-21 16:07 ` Marc-André Lureau
2016-09-22 11:02 ` Markus Armbruster
2016-09-21 10:36 ` [Qemu-devel] [PATCH 2/3] qapi: clear given pointer Marc-André Lureau
2016-09-21 12:57 ` Alberto Garcia
2016-09-21 14:41 ` Daniel P. Berrange
2016-09-21 15:17 ` Marc-André Lureau
2016-09-21 15:34 ` Daniel P. Berrange [this message]
2016-09-21 15:24 ` Markus Armbruster
2016-09-21 10:36 ` [Qemu-devel] [PATCH 3/3] iotests: fix expected error message Marc-André Lureau
2016-09-21 12:58 ` Alberto Garcia
2016-09-21 15:14 ` Markus Armbruster
2016-09-21 15:32 ` Marc-André Lureau
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=20160921153414.GW15535@redhat.com \
--to=berrange@redhat.com \
--cc=armbru@redhat.com \
--cc=berto@igalia.com \
--cc=marcandre.lureau@redhat.com \
--cc=mlureau@redhat.com \
--cc=qemu-devel@nongnu.org \
/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.