[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [FOR 0.12 PATCH v4 04/22] chardev: make chardevs specified
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [FOR 0.12 PATCH v4 04/22] chardev: make chardevs specified in config file work. |
Date: |
Tue, 8 Dec 2009 13:11:36 +0100 |
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 <address@hidden>
---
vl.c | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/vl.c b/vl.c
index f7acdd4..aa678ad 100644
--- a/vl.c
+++ b/vl.c
@@ -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;
--
1.6.5.2
- [Qemu-devel] [FOR 0.12 PATCH v4 01/22] default devices: qdev integration., Gerd Hoffmann, 2009/12/08
- [Qemu-devel] [FOR 0.12 PATCH v4 03/22] qdev: also match bus name for global properties, Gerd Hoffmann, 2009/12/08
- [Qemu-devel] [FOR 0.12 PATCH v4 04/22] chardev: make chardevs specified in config file work.,
Gerd Hoffmann <=
- [Qemu-devel] [FOR 0.12 PATCH v4 05/22] Revert "monitor: Command-line flag to enable control mode", Gerd Hoffmann, 2009/12/08
- [Qemu-devel] [FOR 0.12 PATCH v4 07/22] chardev: move greeting into vc backend., Gerd Hoffmann, 2009/12/08
- [Qemu-devel] [FOR 0.12 PATCH v4 01/22] qdev: make compat stuff more generic, Gerd Hoffmann, 2009/12/08
- [Qemu-devel] [FOR 0.12 PATCH v4 06/22] Revert "Set default console to virtio on S390x", Gerd Hoffmann, 2009/12/08
- [Qemu-devel] [FOR 0.12 PATCH v4 02/22] qdev: add command line option to set global defaults for properties., Gerd Hoffmann, 2009/12/08
- [Qemu-devel] [FOR 0.12 PATCH v4 08/22] vc: colorize chardev title line with blue background., Gerd Hoffmann, 2009/12/08
- [Qemu-devel] [FOR 0.12 PATCH v4 09/22] default devices: core code & serial lines., Gerd Hoffmann, 2009/12/08