[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5 02/11] qom: don't require user creatable obje
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [Qemu-devel] [PATCH v5 02/11] qom: don't require user creatable objects to be registered |
Date: |
Thu, 18 Oct 2018 20:04:51 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 |
On 10/10/2018 17:11, Philippe Mathieu-Daudé wrote:
> On 09/10/2018 15:04, Daniel P. Berrangé wrote:
>> When an object is in turn owned by another user object, it is not
>> desirable to expose this in the QOM object hierarchy, as it is
>> just an internal implementation detail, we should be free to change
>> without exposure.
>>
>> Signed-off-by: Daniel P. Berrangé <address@hidden>
>
> Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Tested-by: Philippe Mathieu-Daudé <address@hidden>
>
>> ---
>> qom/object.c | 12 ++++++++----
>> qom/object_interfaces.c | 16 ++++++++++------
>> 2 files changed, 18 insertions(+), 10 deletions(-)
>>
>> diff --git a/qom/object.c b/qom/object.c
>> index 547dcf97c3..f20f0c45a7 100644
>> --- a/qom/object.c
>> +++ b/qom/object.c
>> @@ -607,15 +607,19 @@ Object *object_new_with_propv(const char *typename,
>> goto error;
>> }
>>
>> - object_property_add_child(parent, id, obj, &local_err);
>> - if (local_err) {
>> - goto error;
>> + if (id != NULL) {
>> + object_property_add_child(parent, id, obj, &local_err);
>> + if (local_err) {
>> + goto error;
>> + }
>> }
>>
>> if (object_dynamic_cast(obj, TYPE_USER_CREATABLE)) {
>> user_creatable_complete(obj, &local_err);
>> if (local_err) {
>> - object_unparent(obj);
>> + if (id != NULL) {
>> + object_unparent(obj);
>> + }
>> goto error;
>> }
>> }
>> diff --git a/qom/object_interfaces.c b/qom/object_interfaces.c
>> index 941fd63afd..94d5f91d69 100644
>> --- a/qom/object_interfaces.c
>> +++ b/qom/object_interfaces.c
>> @@ -83,16 +83,20 @@ Object *user_creatable_add_type(const char *type, const
>> char *id,
>> goto out;
>> }
>>
>> - object_property_add_child(object_get_objects_root(),
>> - id, obj, &local_err);
>> - if (local_err) {
>> - goto out;
>> + if (id != NULL) {
>> + object_property_add_child(object_get_objects_root(),
>> + id, obj, &local_err);
>> + if (local_err) {
>> + goto out;
>> + }
>> }
>>
>> user_creatable_complete(obj, &local_err);
>> if (local_err) {
>> - object_property_del(object_get_objects_root(),
>> - id, &error_abort);
>> + if (id != NULL) {
>> + object_property_del(object_get_objects_root(),
>> + id, &error_abort);
>> + }
>> goto out;
>> }
>> out:
>>
- [Qemu-devel] [PATCH v5 00/11] Add a standard authorization framework, Daniel P . Berrangé, 2018/10/09
- [Qemu-devel] [PATCH v5 02/11] qom: don't require user creatable objects to be registered, Daniel P . Berrangé, 2018/10/09
- [Qemu-devel] [PATCH v5 01/11] util: add helper APIs for dealing with inotify in portable manner, Daniel P . Berrangé, 2018/10/09
- [Qemu-devel] [PATCH v5 03/11] hw/usb: don't set IN_ISDIR for inotify watch in MTP driver, Daniel P . Berrangé, 2018/10/09
- [Qemu-devel] [PATCH v5 04/11] hw/usb: fix const-ness for string params in MTP driver, Daniel P . Berrangé, 2018/10/09
- [Qemu-devel] [PATCH v5 05/11] hw/usb: switch MTP to use new inotify APIs, Daniel P . Berrangé, 2018/10/09
- [Qemu-devel] [PATCH v5 10/11] authz: add QAuthZPAM object type for authorizing using PAM, Daniel P . Berrangé, 2018/10/09