|
From: | Paolo Bonzini |
Subject: | Re: [Qemu-devel] [PATCH v6 2/9] qdev: add to BusState "hotplug-handler" link |
Date: | Wed, 05 Feb 2014 17:44:30 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 |
Il 05/02/2014 16:52, Andreas Färber ha scritto:
> + object_property_add_link(obj, QDEV_HOTPLUG_HANDLER_PROPERTY, > + TYPE_HOTPLUG_HANDLER, > + (Object **)&bus->hotplug_handler, NULL);Will/should the user ever change that property? If not, we could drop this hunk and change the inline link-setting below to just do it the C way. Otherwise it should probably be using &error_abort instead of NULL.
No, they shouldn't. But OTOH it's probably useful in general to _read_ the property, and links handle reference counting nicely too. It's similar to the parent_bus link.
I think we should add something like getter/setter for links like we have for object_property_add_str, because in most of the current cases the link should be read-only.
It should not hold this series, though. Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |