提交 d3c49316 编写于 作者: P Peter Crosthwaite 提交者: Paolo Bonzini

qom: Allow clearing of a Link property

By passing in "" to object_property_set_link.

The lead user of this is the QDEV GPIO framework which will implement
GPIO disconnects via an "unlink".  GPIO disconnection is used by
qtest's irq_intercept_out command.
Reviewed-by: NAlexander Graf <agraf@suse.de>
Signed-off-by: NPeter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 4adea804
......@@ -872,9 +872,13 @@ char *object_property_get_str(Object *obj, const char *name,
void object_property_set_link(Object *obj, Object *value,
const char *name, Error **errp)
{
gchar *path = object_get_canonical_path(value);
object_property_set_str(obj, path, name, errp);
g_free(path);
if (value) {
gchar *path = object_get_canonical_path(value);
object_property_set_str(obj, path, name, errp);
g_free(path);
} else {
object_property_set_str(obj, "", name, errp);
}
}
Object *object_property_get_link(Object *obj, const char *name,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册