From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Crosthwaite <peter.crosthwaite@xilinx.com>, qemu-devel@nongnu.org
Cc: afaerber@suse.de
Subject: Re: [Qemu-devel] [PATCH qom v1 2/2] memory: remove object_property_add_child_array
Date: Thu, 31 Jul 2014 11:38:34 +0200 [thread overview]
Message-ID: <53DA0E9A.5060900@redhat.com> (raw)
In-Reply-To: <c05b8c7a784cff0f0104643d8f8b2a087e9b5f07.1406784296.git.peter.crosthwaite@xilinx.com>
Il 31/07/2014 07:35, Peter Crosthwaite ha scritto:
> Obsoleted by automatic object_property_add arrayification.
>
> Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
> ---
>
> memory.c | 30 +++++-------------------------
> 1 file changed, 5 insertions(+), 25 deletions(-)
>
> diff --git a/memory.c b/memory.c
> index 64d7176..5272bf9 100644
> --- a/memory.c
> +++ b/memory.c
> @@ -877,30 +877,6 @@ static char *memory_region_escape_name(const char *name)
> return escaped;
> }
>
> -static void object_property_add_child_array(Object *owner,
> - const char *name,
> - Object *child)
> -{
> - int i;
> - char *base_name = memory_region_escape_name(name);
> -
> - for (i = 0; ; i++) {
> - char *full_name = g_strdup_printf("%s[%d]", base_name, i);
> - Error *local_err = NULL;
> -
> - object_property_add_child(owner, full_name, child, &local_err);
> - g_free(full_name);
> - if (!local_err) {
> - break;
> - }
> -
> - error_free(local_err);
> - }
> -
> - g_free(base_name);
> -}
> -
> -
> void memory_region_init(MemoryRegion *mr,
> Object *owner,
> const char *name,
> @@ -918,8 +894,12 @@ void memory_region_init(MemoryRegion *mr,
> mr->name = g_strdup(name);
>
> if (name) {
> - object_property_add_child_array(owner, name, OBJECT(mr));
> + char *escaped_name = memory_region_escape_name(name);
> + char *name_array = g_strdup_printf("%s[*]", escaped_name);
> + object_property_add_child(owner, name_array, OBJECT(mr), &error_abort);
> object_unref(OBJECT(mr));
> + g_free(name_array);
> + g_free(escaped_name);
> }
> }
>
>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
next prev parent reply other threads:[~2014-07-31 9:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-31 5:34 [Qemu-devel] [PATCH qom v1 1/2] qom: object_property_add: Add automatic arrayification Peter Crosthwaite
2014-07-31 5:35 ` [Qemu-devel] [PATCH qom v1 2/2] memory: remove object_property_add_child_array Peter Crosthwaite
2014-07-31 9:38 ` Paolo Bonzini [this message]
2014-07-31 9:38 ` [Qemu-devel] [PATCH qom v1 1/2] qom: object_property_add: Add automatic arrayification 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=53DA0E9A.5060900@redhat.com \
--to=pbonzini@redhat.com \
--cc=afaerber@suse.de \
--cc=peter.crosthwaite@xilinx.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).