|
|
9ae3a8 |
From e7980021a52658198f04024cb762f09aac607e97 Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: Gerd Hoffmann <kraxel@redhat.com>
|
|
|
9ae3a8 |
Date: Mon, 14 Oct 2013 13:35:20 +0200
|
|
|
9ae3a8 |
Subject: [PATCH 13/18] qemu-char: add -chardev mux support
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
RH-Author: Gerd Hoffmann <kraxel@redhat.com>
|
|
|
9ae3a8 |
Message-id: <1381757723-23134-13-git-send-email-kraxel@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 54857
|
|
|
9ae3a8 |
O-Subject: [RHEL-7 qemu-kvm PATCH 12/15] qemu-char: add -chardev mux support
|
|
|
9ae3a8 |
Bugzilla: 922010
|
|
|
9ae3a8 |
RH-Acked-by: Hans de Goede <hdegoede@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Allow to explicitly create mux chardevs on the command line,
|
|
|
9ae3a8 |
like you can using QMP.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
|
9ae3a8 |
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
|
|
|
9ae3a8 |
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
|
|
|
9ae3a8 |
(cherry picked from commit bb6fb7c0857aeda7982ac14460328edf3c29cfc8)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Conflicts:
|
|
|
9ae3a8 |
qemu-char.c
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
qemu-char.c | 18 ++++++++++++++++++
|
|
|
9ae3a8 |
1 file changed, 18 insertions(+)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
qemu-char.c | 18 ++++++++++++++++++
|
|
|
9ae3a8 |
1 files changed, 18 insertions(+), 0 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/qemu-char.c b/qemu-char.c
|
|
|
9ae3a8 |
index 145fd30..fc1b21a 100644
|
|
|
9ae3a8 |
--- a/qemu-char.c
|
|
|
9ae3a8 |
+++ b/qemu-char.c
|
|
|
9ae3a8 |
@@ -3142,6 +3142,19 @@ static void qemu_chr_parse_ringbuf(QemuOpts *opts, ChardevBackend *backend,
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
+static void qemu_chr_parse_mux(QemuOpts *opts, ChardevBackend *backend,
|
|
|
9ae3a8 |
+ Error **errp)
|
|
|
9ae3a8 |
+{
|
|
|
9ae3a8 |
+ const char *chardev = qemu_opt_get(opts, "chardev");
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
+ if (chardev == NULL) {
|
|
|
9ae3a8 |
+ error_setg(errp, "chardev: mux: no chardev given");
|
|
|
9ae3a8 |
+ return;
|
|
|
9ae3a8 |
+ }
|
|
|
9ae3a8 |
+ backend->mux = g_new0(ChardevMux, 1);
|
|
|
9ae3a8 |
+ backend->mux->chardev = g_strdup(chardev);
|
|
|
9ae3a8 |
+}
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
typedef struct CharDriver {
|
|
|
9ae3a8 |
const char *name;
|
|
|
9ae3a8 |
/* old, pre qapi */
|
|
|
9ae3a8 |
@@ -3509,6 +3522,9 @@ QemuOptsList qemu_chardev_opts = {
|
|
|
9ae3a8 |
},{
|
|
|
9ae3a8 |
.name = "size",
|
|
|
9ae3a8 |
.type = QEMU_OPT_SIZE,
|
|
|
9ae3a8 |
+ },{
|
|
|
9ae3a8 |
+ .name = "chardev",
|
|
|
9ae3a8 |
+ .type = QEMU_OPT_STRING,
|
|
|
9ae3a8 |
},
|
|
|
9ae3a8 |
{ /* end of list */ }
|
|
|
9ae3a8 |
},
|
|
|
9ae3a8 |
@@ -3800,6 +3816,8 @@ static void register_types(void)
|
|
|
9ae3a8 |
register_char_driver_qapi("console", CHARDEV_BACKEND_KIND_CONSOLE, NULL);
|
|
|
9ae3a8 |
register_char_driver_qapi("pipe", CHARDEV_BACKEND_KIND_PIPE,
|
|
|
9ae3a8 |
qemu_chr_parse_pipe);
|
|
|
9ae3a8 |
+ register_char_driver_qapi("mux", CHARDEV_BACKEND_KIND_MUX,
|
|
|
9ae3a8 |
+ qemu_chr_parse_mux);
|
|
|
9ae3a8 |
/* Bug-compatibility: */
|
|
|
9ae3a8 |
register_char_driver_qapi("memory", CHARDEV_BACKEND_KIND_MEMORY,
|
|
|
9ae3a8 |
qemu_chr_parse_ringbuf);
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.7.1
|
|
|
9ae3a8 |
|