[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 11/13] qemu-char: add -chardev mux support
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH v2 11/13] qemu-char: add -chardev mux support |
Date: |
Mon, 24 Jun 2013 08:39:54 +0200 |
Allow to explicitly create mux chardevs on the command line,
like you can using QMP.
Signed-off-by: Gerd Hoffmann <address@hidden>
---
qemu-char.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/qemu-char.c b/qemu-char.c
index e6c3157..7d072a8 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -3122,6 +3122,19 @@ static void qemu_chr_parse_memory(QemuOpts *opts,
ChardevBackend *backend,
}
}
+static void qemu_chr_parse_mux(QemuOpts *opts, ChardevBackend *backend,
+ Error **errp)
+{
+ const char *chardev = qemu_opt_get(opts, "chardev");
+
+ if (chardev == NULL) {
+ error_setg(errp, "chardev: mux: no chardev given");
+ return;
+ }
+ backend->mux = g_new0(ChardevMux, 1);
+ backend->mux->chardev = g_strdup(chardev);
+}
+
typedef struct CharDriver {
const char *name;
/* old, pre qapi */
@@ -3488,6 +3501,9 @@ QemuOptsList qemu_chardev_opts = {
},{
.name = "size",
.type = QEMU_OPT_SIZE,
+ },{
+ .name = "chardev",
+ .type = QEMU_OPT_STRING,
},
{ /* end of list */ }
},
@@ -3778,6 +3794,8 @@ static void register_types(void)
register_char_driver_qapi("console", CHARDEV_BACKEND_KIND_CONSOLE, NULL);
register_char_driver_qapi("pipe", CHARDEV_BACKEND_KIND_PIPE,
qemu_chr_parse_pipe);
+ register_char_driver_qapi("mux", CHARDEV_BACKEND_KIND_MUX,
+ qemu_chr_parse_mux);
}
type_init(register_types);
--
1.7.9.7
- [Qemu-devel] [PATCH v2 04/13] qemu-char: check optional fields using has_*, (continued)
- [Qemu-devel] [PATCH v2 04/13] qemu-char: check optional fields using has_*, Gerd Hoffmann, 2013/06/24
- [Qemu-devel] [PATCH v2 06/13] qemu-char: print notification to stderr, Gerd Hoffmann, 2013/06/24
- [Qemu-devel] [PATCH v2 05/13] qemu-char: use more specific error_setg_* variants, Gerd Hoffmann, 2013/06/24
- [Qemu-devel] [PATCH v2 09/13] qemu-char: use ChardevBackendKind in in CharDriver, Gerd Hoffmann, 2013/06/24
- [Qemu-devel] [PATCH v2 07/13] qemu-char: fix documentation for telnet+wait socket flags, Gerd Hoffmann, 2013/06/24
- [Qemu-devel] [PATCH v2 08/13] qemu-char: don't leak opts on error, Gerd Hoffmann, 2013/06/24
- [Qemu-devel] [PATCH v2 13/13] qemu-socket: don't leak opts on error, Gerd Hoffmann, 2013/06/24
- [Qemu-devel] [PATCH v2 12/13] qemu-char: report udb backend errors, Gerd Hoffmann, 2013/06/24
- [Qemu-devel] [PATCH v2 11/13] qemu-char: add -chardev mux support,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH v2 10/13] qemu-char: minor mux chardev fixes, Gerd Hoffmann, 2013/06/24
- [Qemu-devel] [PATCH v2 02/13] qemu-socket: drop pointless allocation, Gerd Hoffmann, 2013/06/24
- Re: [Qemu-devel] [Qemu-trivial] [PATCH v2 00/13] A bunch of little socket + chardev fixes, Michael Tokarev, 2013/06/24
- Re: [Qemu-devel] [PATCH v2 00/13] A bunch of little socket + chardev fixes, Laszlo Ersek, 2013/06/24