All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: 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 15:41:58 +0100	[thread overview]
Message-ID: <20160921144158.GT15535@redhat.com> (raw)
In-Reply-To: <20160921103629.6410-3-marcandre.lureau@redhat.com>

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

Alternatively, we could say that '*obj' should never be touched
on error paths, in which case we've a bunchof cleanup todo
in qmp_input_visitor to avoid splattering *obj.

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

  parent reply	other threads:[~2016-09-21 14:42 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 [this message]
2016-09-21 15:17     ` Marc-André Lureau
2016-09-21 15:34       ` Daniel P. Berrange
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=20160921144158.GT15535@redhat.com \
    --to=berrange@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berto@igalia.com \
    --cc=marcandre.lureau@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.