aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2012-10-15 09:28:05 +0200
committerGerd Hoffmann <kraxel@redhat.com>2013-01-16 06:58:53 +0100
commitbd2d80b2b75b36955d536564ceb593f5bdae2f12 (patch)
tree43bdc5361ea0c487fd0128a916547315cb1d4abd /vl.c
parent249d41720b7dfbb5951b430b9eefdbee7464f515 (diff)
downloadqemu-bd2d80b2b75b36955d536564ceb593f5bdae2f12.zip
qemu-bd2d80b2b75b36955d536564ceb593f5bdae2f12.tar.gz
qemu-bd2d80b2b75b36955d536564ceb593f5bdae2f12.tar.bz2
chardev: add error reporting for qemu_chr_new_from_opts
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/vl.c b/vl.c
index 15e0280..8ce2b10 100644
--- a/vl.c
+++ b/vl.c
@@ -2238,11 +2238,14 @@ static int device_init_func(QemuOpts *opts, void *opaque)
static int chardev_init_func(QemuOpts *opts, void *opaque)
{
- CharDriverState *chr;
+ Error *local_err = NULL;
- chr = qemu_chr_new_from_opts(opts, NULL);
- if (!chr)
+ qemu_chr_new_from_opts(opts, NULL, &local_err);
+ if (error_is_set(&local_err)) {
+ fprintf(stderr, "%s\n", error_get_pretty(local_err));
+ error_free(local_err);
return -1;
+ }
return 0;
}