All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Stefan Hajnoczi <stefanha@redhat.com>, qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Anthony Liguori <aliguori@amazon.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 1/4] qom: split object_property_set_link()
Date: Wed, 05 Mar 2014 10:26:33 +0100	[thread overview]
Message-ID: <5316EDC9.2090609@suse.de> (raw)
In-Reply-To: <1393969512-9468-2-git-send-email-stefanha@redhat.com>

Am 04.03.2014 22:45, schrieb Stefan Hajnoczi:
> The path resolution logic in object_property_set_link() should be a
> separate function.  This makes the code easier to read and maintain.
> 
> More importantly, the error behavior of object_property_set_link() is
> dangerous.  It sets the link property object to NULL if an error occurs.
> A setter function should either succeed or fail, it shouldn't leave the
> value NULL on failure.
> 
> This patch splits the code and fixes the error case so the old link
> property object is left in place on failure.
> 
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>

Since this code movement is a bit invasive due to the reindent (looks OK
though), can we do this in two steps please? First split, then fix?

Regards,
Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

  reply	other threads:[~2014-03-05  9:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-04 21:45 [Qemu-devel] [PATCH 0/4] qom: link property fixes Stefan Hajnoczi
2014-03-04 21:45 ` [Qemu-devel] [PATCH 1/4] qom: split object_property_set_link() Stefan Hajnoczi
2014-03-05  9:26   ` Andreas Färber [this message]
2014-03-04 21:45 ` [Qemu-devel] [PATCH 2/4] qom: make QOM link property unref optional Stefan Hajnoczi
2014-03-04 21:45 ` [Qemu-devel] [PATCH 3/4] qom: add set() argument to object_property_add_link() Stefan Hajnoczi
2014-03-04 21:45 ` [Qemu-devel] [PATCH 4/4] virtio-rng: avoid default_backend refcount leak Stefan Hajnoczi
2014-03-05  8:14 ` [Qemu-devel] [PATCH 0/4] qom: link property fixes Paolo Bonzini
2014-03-05  9:24   ` Andreas Färber
2014-03-05  9:31     ` 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=5316EDC9.2090609@suse.de \
    --to=afaerber@suse.de \
    --cc=aliguori@amazon.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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.