diff mbox

[4/5] vl.c: -object: handle duplicate 'id' properly

Message ID 1389197382-25085-5-git-send-email-imammedo@redhat.com
State New
Headers show

Commit Message

Igor Mammedov Jan. 8, 2014, 4:09 p.m. UTC
object_property_add_child() may fail if 'id' matches already
existing object. Which means incorrect command line,
so instead of silently ignoring error, report it and
go to error path (i.e. terminate QEMU).

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
 vl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff mbox

Patch

diff --git a/vl.c b/vl.c
index 1620393..84cb7a8 100644
--- a/vl.c
+++ b/vl.c
@@ -2821,7 +2821,7 @@  static int object_create(QemuOpts *opts, void *opaque)
     }
 
     object_property_add_child(container_get(object_get_root(), "/objects"),
-                              id, obj, NULL);
+                              id, obj, &local_err);
 
 out:
     object_unref(obj);