qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Andreas Färber" <afaerber@suse.de>,
	"Pavel Fedin" <p.fedin@samsung.com>,
	"'Markus Armbruster'" <armbru@redhat.com>
Cc: 'Peter Crosthwaite' <peter.crosthwaite@xilinx.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v4 2/2] QOM: object_property_add() performance improvement
Date: Mon, 27 Jul 2015 17:09:19 +0200	[thread overview]
Message-ID: <55B6499F.407@redhat.com> (raw)
In-Reply-To: <55B64900.6020008@redhat.com>



On 27/07/2015 17:06, Paolo Bonzini wrote:
> 
> 
> On 27/07/2015 16:57, Andreas Färber wrote:
>>>>  I am absolutely fine with absolutely anything. Suggest what you like and i'll change it.
>> Paolo suggested ...-count on #qemu, but I would prefer ...-max or so, as
>> the number could differ when some property gets deleted.
> 
> Yes, I agree -max is better.
> 
> I'm just asking myself whether this is really necessary.  Is the
> automagic [*] really needed in this case?  Can it just do:
> 
> diff --git a/hw/core/qdev.c b/hw/core/qdev.c
> index b2f404a..19bfee1 100644
> --- a/hw/core/qdev.c
> +++ b/hw/core/qdev.c
> @@ -415,19 +415,19 @@ static NamedGPIOList *qdev_get_named_gpio_list(DeviceState *dev,
>  void qdev_init_gpio_in_named(DeviceState *dev, qemu_irq_handler handler,
>                               const char *name, int n)
>  {
> -    int i;
> +    int i, j;
>      NamedGPIOList *gpio_list = qdev_get_named_gpio_list(dev, name);
> -    char *propname = g_strdup_printf("%s[*]", name ? name : "unnamed-gpio-in");
>  
>      assert(gpio_list->num_out == 0 || !name);
>      gpio_list->in = qemu_extend_irqs(gpio_list->in, gpio_list->num_in, handler,
>                                       dev, n);
>  
>      for (i = gpio_list->num_in; i < gpio_list->num_in + n; i++) {
> +        char *propname = g_strdup_printf("%s[%d]", name ? name : "unnamed-gpio-in", j++);
>          object_property_add_child(OBJECT(dev), propname,
>                                    OBJECT(gpio_list->in[i]), &error_abort);
> +        g_free(propname);
>      }
> -    g_free(propname);
>  
>      gpio_list->num_in += n;
>  }
> 
> ?

... and the same in qdev_init_gpio_out_named.

Paolo

  reply	other threads:[~2015-07-27 15:09 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-14  9:38 [Qemu-devel] [PATCH v4 0/2] QOM: object_property_add() performance improvement Pavel Fedin
2015-07-14  9:39 ` [Qemu-devel] [PATCH v4 1/2] QOM: Introduce object_property_add_single() Pavel Fedin
2015-07-14  9:39 ` [Qemu-devel] [PATCH v4 2/2] QOM: object_property_add() performance improvement Pavel Fedin
2015-07-27 11:42   ` Daniel P. Berrange
2015-07-27 14:36     ` Pavel Fedin
2015-07-27 13:03   ` Markus Armbruster
2015-07-27 13:23     ` Daniel P. Berrange
2015-07-27 13:46       ` Paolo Bonzini
2015-07-27 14:36     ` Pavel Fedin
2015-07-27 14:57       ` Andreas Färber
2015-07-27 15:06         ` Paolo Bonzini
2015-07-27 15:09           ` Paolo Bonzini [this message]
2015-07-27 15:19           ` Pavel Fedin
2015-07-27 15:22             ` Paolo Bonzini
2015-07-28  6:45               ` Pavel Fedin
2015-07-28  7:06                 ` Paolo Bonzini
2015-07-27 11:19 ` [Qemu-devel] [PATCH v4 0/2] " Daniel P. Berrange

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=55B6499F.407@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=afaerber@suse.de \
    --cc=armbru@redhat.com \
    --cc=p.fedin@samsung.com \
    --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).