diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2012-10-15 09:28:05 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2013-01-16 06:58:53 +0100 |
commit | bd2d80b2b75b36955d536564ceb593f5bdae2f12 (patch) | |
tree | 43bdc5361ea0c487fd0128a916547315cb1d4abd /vl.c | |
parent | 249d41720b7dfbb5951b430b9eefdbee7464f515 (diff) |
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.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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; } |