From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Crosthwaite <peter.crosthwaite@xilinx.com>, qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, agraf@suse.de, afaerber@suse.de
Subject: Re: [Qemu-devel] [PATCH qom v3 05/14] qom: Allow clearing of a Link property
Date: Fri, 26 Sep 2014 14:59:49 +0200 [thread overview]
Message-ID: <54256345.1070605@redhat.com> (raw)
In-Reply-To: <a899685dab4db84e9166465947cc19ce1fccccf0.1411703316.git.peter.crosthwaite@xilinx.com>
Il 26/09/2014 07:19, Peter Crosthwaite ha scritto:
> By passing in NULL to object_property_set_link.
>
> The lead user of this is the QDEV GPIO framework which will implement
> GPIO disconnects via an "unlink".
>
> Reviewed-by: Alexander Graf <agraf@suse.de>
> Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
> ---
>
> qom/object.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/qom/object.c b/qom/object.c
> index da0919a..fe2d1c9 100644
> --- a/qom/object.c
> +++ b/qom/object.c
> @@ -870,7 +870,7 @@ char *object_property_get_str(Object *obj, const char *name,
> void object_property_set_link(Object *obj, Object *value,
> const char *name, Error **errp)
> {
> - gchar *path = object_get_canonical_path(value);
> + gchar *path = value ? object_get_canonical_path(value) : NULL;
It should also work if you pass an empty string here.
If you do this, you do not need patch 4.
Paolo
> object_property_set_str(obj, path, name, errp);
> g_free(path);
> }
> @@ -1173,7 +1173,7 @@ static void object_set_link_property(Object *obj, Visitor *v, void *opaque,
>
> visit_type_str(v, &path, name, &local_err);
>
> - if (!local_err && strcmp(path, "") != 0) {
> + if (!local_err && path && strcmp(path, "") != 0) {
> new_target = object_resolve_link(obj, name, path, &local_err);
> }
>
>
next prev parent reply other threads:[~2014-09-26 13:00 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-26 5:16 [Qemu-devel] [PATCH qom v3 00/14] GPIO/IRQ QOMification: Phase 2 - Getting rid of SYSBUS IRQs Peter Crosthwaite
2014-09-26 5:17 ` [Qemu-devel] [PATCH qom v3 01/14] qdev: gpio: Don't allow name share between I and O Peter Crosthwaite
2014-09-26 5:17 ` [Qemu-devel] [PATCH qom v3 02/14] qdev: gpio: Register GPIO inputs as child objects Peter Crosthwaite
2014-09-26 5:18 ` [Qemu-devel] [PATCH qom v3 03/14] qdev: gpio: Register GPIO outputs as QOM links Peter Crosthwaite
2014-09-26 5:18 ` [Qemu-devel] [PATCH qom v3 04/14] qmp: qstring: Handle NULL strings Peter Crosthwaite
2014-09-26 13:27 ` Paolo Bonzini
2014-09-29 15:08 ` Andreas Färber
2014-09-26 5:19 ` [Qemu-devel] [PATCH qom v3 05/14] qom: Allow clearing of a Link property Peter Crosthwaite
2014-09-26 12:59 ` Paolo Bonzini [this message]
2014-09-26 13:42 ` Igor Mammedov
2014-09-26 5:19 ` [Qemu-devel] [PATCH qom v3 06/14] qom: Demote already-has-a-parent to a regular error Peter Crosthwaite
2014-09-26 5:20 ` [Qemu-devel] [PATCH qom v3 07/14] qdev: gpio: Re-impement qdev_connect_gpio QOM style Peter Crosthwaite
2014-09-26 13:04 ` Paolo Bonzini
2014-09-26 5:20 ` [Qemu-devel] [PATCH qom v3 08/14] qdev: gpio: Add API for intercepting a GPIO Peter Crosthwaite
2014-09-26 5:21 ` [Qemu-devel] [PATCH qom v3 09/14] qtest/irq: Rework IRQ interception Peter Crosthwaite
2014-09-26 5:22 ` [Qemu-devel] [PATCH qom v3 10/14] irq: Remove qemu_irq_intercept_out Peter Crosthwaite
2014-09-26 5:22 ` [Qemu-devel] [PATCH qom v3 11/14] qdev: gpio: delete NamedGPIOList::out Peter Crosthwaite
2014-09-26 5:23 ` [Qemu-devel] [PATCH qom v3 12/14] qdev: gpio: Remove qdev_init_gpio_out x1 restriction Peter Crosthwaite
2014-09-26 5:23 ` [Qemu-devel] [PATCH qom v3 13/14] qdev: gpio: Define qdev_pass_gpios() Peter Crosthwaite
2014-09-26 5:24 ` [Qemu-devel] [PATCH qom v3 14/14] sysbus: Use TYPE_DEVICE GPIO functionality Peter Crosthwaite
2014-09-26 13:13 ` [Qemu-devel] [PATCH qom v3 00/14] GPIO/IRQ QOMification: Phase 2 - Getting rid of SYSBUS IRQs Paolo Bonzini
2014-09-26 13:17 ` Andreas Färber
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=54256345.1070605@redhat.com \
--to=pbonzini@redhat.com \
--cc=afaerber@suse.de \
--cc=agraf@suse.de \
--cc=peter.crosthwaite@xilinx.com \
--cc=peter.maydell@linaro.org \
--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.