diff options
author | Igor Mammedov <imammedo@redhat.com> | 2014-06-02 15:24:59 +0200 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2014-06-18 21:10:21 +0300 |
commit | a790f4ecc9ac54769f483efc00d8e91f31bca14d (patch) | |
tree | 6b4edbd6ac605d900a45ec84987e1b748a98a468 /qmp.c | |
parent | 04ed3ea892386162b287b3ed704b75b0fc0c4616 (diff) | |
download | qemu-a790f4ecc9ac54769f483efc00d8e91f31bca14d.zip qemu-a790f4ecc9ac54769f483efc00d8e91f31bca14d.tar.gz qemu-a790f4ecc9ac54769f483efc00d8e91f31bca14d.tar.bz2 |
object_add: allow completion handler to get canonical path
Add object to /objects before calling user_creatable_complete()
handler, so that object might be able to call
object_get_canonical_path() in its completion handler.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Acked-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'qmp.c')
-rw-r--r-- | qmp.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -565,13 +565,18 @@ void object_add(const char *type, const char *id, const QDict *qdict, } } - user_creatable_complete(obj, &local_err); + object_property_add_child(container_get(object_get_root(), "/objects"), + id, obj, &local_err); if (local_err) { goto out; } - object_property_add_child(container_get(object_get_root(), "/objects"), - id, obj, &local_err); + user_creatable_complete(obj, &local_err); + if (local_err) { + object_property_del(container_get(object_get_root(), "/objects"), + id, &error_abort); + goto out; + } out: if (local_err) { error_propagate(errp, local_err); |