mirror of
https://github.com/utmapp/qemu.git
synced 2026-12-01 22:23:23 -10:00
qom: don't require user creatable objects to be registered
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 <[email protected]> Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Tested-by: Philippe Mathieu-Daudé <[email protected]> Signed-off-by: Daniel P. Berrangé <[email protected]>
This commit is contained in:
1 parent
90e33dfec6
commit
6134d7522e
2 files changed
+18
-10
No files matched your search
+8
-4
@@ -646,16 +646,20 @@ 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;
|
||||
}
|
||||
}
|
||||
|
||||
uc = (UserCreatable *)object_dynamic_cast(obj, TYPE_USER_CREATABLE);
|
||||
if (uc) {
|
||||
user_creatable_complete(uc, &local_err);
|
||||
if (local_err) {
|
||||
object_unparent(obj);
|
||||
if (id != NULL) {
|
||||
object_unparent(obj);
|
||||
}
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
+10
-6
@@ -75,16 +75,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(USER_CREATABLE(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:
|
||||
|
||||
Reference in new issue
Block a user