[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 003/103] object_add: allow completion handler to get
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 003/103] object_add: allow completion handler to get canonical path |
Date: |
Tue, 17 Jun 2014 20:36:24 +0300 |
From: Igor Mammedov <address@hidden>
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 <address@hidden>
Acked-by: Peter Crosthwaite <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
qmp.c | 11 ++++++++---
vl.c | 9 +++++----
2 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/qmp.c b/qmp.c
index a7f432b..b722dbe 100644
--- a/qmp.c
+++ b/qmp.c
@@ -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);
diff --git a/vl.c b/vl.c
index a3def97..47d4a11 100644
--- a/vl.c
+++ b/vl.c
@@ -2935,14 +2935,15 @@ static int object_create(QemuOpts *opts, void *opaque)
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;
}
-
- object_property_add_child(container_get(object_get_root(), "/objects"),
- id, obj, &local_err);
-
out:
object_unref(obj);
if (local_err) {
--
MST
- [Qemu-devel] [PULL 000/103] pc, pci, virtio, hotplug fixes, enhancements for 2.1, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 001/103] pc: create custom generic PC machine type, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 003/103] object_add: allow completion handler to get canonical path,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 004/103] vl.c: daemonize before guest memory allocation, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 005/103] add memdev backend infrastructure, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 006/103] vl.c: extend -m option to support options for memory hotplug, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 007/103] qdev: hotplug for buss-less devices, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 002/103] pc: ACPI BIOS: use enum for defining memory affinity flags, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 008/103] qdev: expose DeviceState.hotplugged field as a property, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 011/103] pc-dimm: do not allow to set already used memdev, Michael S. Tsirkin, 2014/06/17