diff options
author | Markus Armbruster <armbru@redhat.com> | 2015-03-12 14:00:41 +0100 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2015-06-22 18:20:39 +0200 |
commit | f006cf7fa9a63ba8e4ccf57d46231ce594301727 (patch) | |
tree | 0697a9d8dcac317ea512d1604bc702aa476a984f /vl.c | |
parent | 4caa489d1337c1a72d2e36185e4586ad246b98e1 (diff) | |
download | qemu-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.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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; } |