diff options
author | Peter Crosthwaite <peter.crosthwaite@xilinx.com> | 2014-09-25 22:19:19 -0700 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-10-23 16:41:25 +0200 |
commit | d3c4931647c16c2ffc09a2c7c80d71c73cd026c6 (patch) | |
tree | ae88284c413fc4fe6b50cdec8a699214c28c068f /qom | |
parent | 4adea8042f880dd9bd7cb5c191a781ec86fdc587 (diff) | |
download | hqemu-d3c4931647c16c2ffc09a2c7c80d71c73cd026c6.zip hqemu-d3c4931647c16c2ffc09a2c7c80d71c73cd026c6.tar.gz |
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: Alexander Graf <agraf@suse.de>
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'qom')
-rw-r--r-- | qom/object.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/qom/object.c b/qom/object.c index a751367..c7ef776 100644 --- a/qom/object.c +++ b/qom/object.c @@ -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, |