From: "Andreas Färber" <afaerber@suse.de>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: av1474@comtv.ru, qemu-devel@nongnu.org,
Anthony Liguori <anthony@codemonkey.ws>
Subject: Re: [Qemu-devel] [PATCH 6/8] qom: do not return root for empty path
Date: Mon, 29 Apr 2013 19:30:50 +0200 [thread overview]
Message-ID: <517EAE4A.90108@suse.de> (raw)
In-Reply-To: <1366303444-24620-7-git-send-email-pbonzini@redhat.com>
Am 18.04.2013 18:44, schrieb Paolo Bonzini:
> An empty path will return the sole object of that type in the
> QOM tree. This is different from "/", which returns the root.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Looks OK to me, but not confident about callers' expectations.
Might this need a documentation update? CC'ing Mr. QOM.
Andreas
> ---
> qom/object.c | 12 ++----------
> 1 file changed, 2 insertions(+), 10 deletions(-)
>
> diff --git a/qom/object.c b/qom/object.c
> index 093502e..dd53d24 100644
> --- a/qom/object.c
> +++ b/qom/object.c
> @@ -1113,21 +1113,13 @@ static Object *object_resolve_partial_path(Object *parent,
> Object *object_resolve_path_type(const char *path, const char *typename,
> bool *ambiguous)
> {
> - bool partial_path = true;
> Object *obj;
> gchar **parts;
>
> parts = g_strsplit(path, "/", 0);
> - if (parts == NULL || parts[0] == NULL) {
> - g_strfreev(parts);
> - return object_get_root();
> - }
> -
> - if (strcmp(parts[0], "") == 0) {
> - partial_path = false;
> - }
> + assert(parts);
>
> - if (partial_path) {
> + if (parts[0] == NULL || strcmp(parts[0], "") != 0) {
> if (ambiguous) {
> *ambiguous = false;
> }
>
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
next prev parent reply other threads:[~2013-04-29 17:30 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-18 16:43 [Qemu-devel] [PATCH 1.5 0/8] make audio card configuration uniform Paolo Bonzini
2013-04-18 16:43 ` [Qemu-devel] [PATCH 1/8] adlib: qdev-ify Paolo Bonzini
2013-04-29 17:26 ` Andreas Färber
2013-04-18 16:43 ` [Qemu-devel] [PATCH 2/8] audio: remove the need for audio card CONFIG_* symbols Paolo Bonzini
2013-04-18 16:43 ` [Qemu-devel] [PATCH 3/8] audio: remove HAS_AUDIO Paolo Bonzini
2013-04-18 16:44 ` [Qemu-devel] [PATCH 4/8] audio: remove CONFIG_* symbols Paolo Bonzini
2013-04-18 16:44 ` [Qemu-devel] [PATCH 5/8] audio: replace audio card configuration with default-configs Paolo Bonzini
2013-04-18 16:44 ` [Qemu-devel] [PATCH 6/8] qom: do not return root for empty path Paolo Bonzini
2013-04-29 17:30 ` Andreas Färber [this message]
2013-04-18 16:44 ` [Qemu-devel] [PATCH 7/8] audio: look for the ISA and PCI buses Paolo Bonzini
2013-04-30 12:16 ` Andreas Färber
2013-04-30 14:00 ` Paolo Bonzini
2013-04-30 14:39 ` Anthony Liguori
2013-04-30 12:52 ` Alexander Graf
2013-04-18 16:44 ` [Qemu-devel] [PATCH 8/8] audio: enable PCI audio cards for all PCI-enabled targets Paolo Bonzini
2013-04-29 15:51 ` [Qemu-devel] [PATCH 1.5 0/8] make audio card configuration uniform Paolo Bonzini
2013-04-30 18:58 ` Anthony Liguori
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=517EAE4A.90108@suse.de \
--to=afaerber@suse.de \
--cc=anthony@codemonkey.ws \
--cc=av1474@comtv.ru \
--cc=pbonzini@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.