mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
qom: add object_property_add_const_link
Suggested-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
3751d7c43f
commit
fb9e7e334b
2 changed files with 34 additions and 0 deletions
16
qom/object.c
16
qom/object.c
|
@ -1266,6 +1266,22 @@ out:
|
|||
g_free(full_type);
|
||||
}
|
||||
|
||||
void object_property_add_const_link(Object *obj, const char *name,
|
||||
Object *target, Error **errp)
|
||||
{
|
||||
char *link_type;
|
||||
ObjectProperty *op;
|
||||
|
||||
link_type = g_strdup_printf("link<%s>", object_get_typename(target));
|
||||
op = object_property_add(obj, name, link_type,
|
||||
object_get_child_property, NULL,
|
||||
NULL, target, errp);
|
||||
if (op != NULL) {
|
||||
op->resolve = object_resolve_child_property;
|
||||
}
|
||||
g_free(link_type);
|
||||
}
|
||||
|
||||
gchar *object_get_canonical_path_component(Object *obj)
|
||||
{
|
||||
ObjectProperty *prop = NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue