diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2009-12-08 13:11:36 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-12-12 07:59:41 -0600 |
commit | 1a688d3bbc2a44bfefa3f6774a11b0385dafc029 (patch) | |
tree | 8b162b2bdc8918d1c239f110bc482334e465f203 /vl.c | |
parent | 07a8de3566bd576dc33e55af830d63dcc2287617 (diff) | |
download | qemu-1a688d3bbc2a44bfefa3f6774a11b0385dafc029.tar.gz qemu-1a688d3bbc2a44bfefa3f6774a11b0385dafc029.tar.bz2 qemu-1a688d3bbc2a44bfefa3f6774a11b0385dafc029.zip |
chardev: make chardevs specified in config file work.
The patch decuples the -chardev switch and the actual chardev
initialization. Without this patch qemu ignores chardev entries
coming via -readconfig.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'vl.c')
-rw-r--r-- | vl.c | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -4586,6 +4586,16 @@ static int device_init_func(QemuOpts *opts, void *opaque) return 0; } +static int chardev_init_func(QemuOpts *opts, void *opaque) +{ + CharDriverState *chr; + + chr = qemu_chr_open_opts(opts, NULL); + if (!chr) + return -1; + return 0; +} + struct device_config { enum { DEV_USB, /* -usbdevice */ @@ -5180,9 +5190,6 @@ int main(int argc, char **argv, char **envp) fprintf(stderr, "parse error: %s\n", optarg); exit(1); } - if (qemu_chr_open_opts(opts, NULL) == NULL) { - exit(1); - } break; case QEMU_OPTION_serial: if (serial_device_index >= MAX_SERIAL_PORTS) { @@ -5501,6 +5508,9 @@ int main(int argc, char **argv, char **envp) } } + if (qemu_opts_foreach(&qemu_chardev_opts, chardev_init_func, NULL, 1) != 0) + exit(1); + #ifndef _WIN32 if (daemonize) { pid_t pid; |