summaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2015-03-12 14:00:41 +0100
committerMarkus Armbruster <armbru@redhat.com>2015-06-22 18:20:39 +0200
commitf006cf7fa9a63ba8e4ccf57d46231ce594301727 (patch)
tree0697a9d8dcac317ea512d1604bc702aa476a984f /vl.c
parent4caa489d1337c1a72d2e36185e4586ad246b98e1 (diff)
downloadqemu-f006cf7fa9a63ba8e4ccf57d46231ce594301727.tar.gz
qemu-f006cf7fa9a63ba8e4ccf57d46231ce594301727.tar.bz2
qemu-f006cf7fa9a63ba8e4ccf57d46231ce594301727.zip
qdev-monitor: Propagate errors through qdev_device_add()
Also polish an error message while I'm touching the line anyway, Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/vl.c b/vl.c
index 0c2208f723..fd6a5c2ee2 100644
--- a/vl.c
+++ b/vl.c
@@ -2276,11 +2276,14 @@ static int device_help_func(void *opaque, QemuOpts *opts, Error **errp)
static int device_init_func(void *opaque, QemuOpts *opts, Error **errp)
{
+ Error *err = NULL;
DeviceState *dev;
- dev = qdev_device_add(opts);
- if (!dev)
+ dev = qdev_device_add(opts, &err);
+ if (!dev) {
+ error_report_err(err);
return -1;
+ }
object_unref(OBJECT(dev));
return 0;
}