[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v7 02/11] qom: don't require user creatable objects
From: |
Daniel P . Berrangé |
Subject: |
[Qemu-devel] [PATCH v7 02/11] qom: don't require user creatable objects to be registered |
Date: |
Fri, 30 Nov 2018 14:06:06 +0000 |
When an object is in turn owned by another user object, it is not
desirable to expose this in the QOM object hierarchy. It is just an
internal implementation detail, we should be free to change without
exposure to apps managing QEMU.
Reviewed-by: Marc-André Lureau <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Tested-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Daniel P. Berrangé <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 97b79b48bb..b5b95e067a 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:
--
2.19.2
- [Qemu-devel] [PATCH v7 00/11] Add a standard authorization framework, Daniel P . Berrangé, 2018/11/30
- [Qemu-devel] [PATCH v7 02/11] qom: don't require user creatable objects to be registered,
Daniel P . Berrangé <=
- [Qemu-devel] [PATCH v7 03/11] hw/usb: don't set IN_ISDIR for inotify watch in MTP driver, Daniel P . Berrangé, 2018/11/30
- [Qemu-devel] [PATCH v7 01/11] util: add helper APIs for dealing with inotify in portable manner, Daniel P . Berrangé, 2018/11/30
- [Qemu-devel] [PATCH v7 04/11] hw/usb: fix const-ness for string params in MTP driver, Daniel P . Berrangé, 2018/11/30
- [Qemu-devel] [PATCH v7 06/11] authz: add QAuthZ object as an authorization base class, Daniel P . Berrangé, 2018/11/30
- [Qemu-devel] [PATCH v7 05/11] hw/usb: switch MTP to use new inotify APIs, Daniel P . Berrangé, 2018/11/30
- [Qemu-devel] [PATCH v7 07/11] authz: add QAuthZSimple object type for easy whitelist auth checks, Daniel P . Berrangé, 2018/11/30
- [Qemu-devel] [PATCH v7 08/11] authz: add QAuthZList object type for an access control list, Daniel P . Berrangé, 2018/11/30
- [Qemu-devel] [PATCH v7 09/11] authz: add QAuthZListFile object type for a file access control list, Daniel P . Berrangé, 2018/11/30
- [Qemu-devel] [PATCH v7 10/11] authz: add QAuthZPAM object type for authorizing using PAM, Daniel P . Berrangé, 2018/11/30
- [Qemu-devel] [PATCH v7 11/11] authz: delete existing ACL implementation, Daniel P . Berrangé, 2018/11/30