diff options
-rw-r--r-- | qemu-char.c | 16 | ||||
-rw-r--r-- | qemu-char.h | 1 | ||||
-rw-r--r-- | qemu-config.c | 3 |
3 files changed, 20 insertions, 0 deletions
diff --git a/qemu-char.c b/qemu-char.c index ef73afef71..ce2799e205 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -2416,6 +2416,10 @@ CharDriverState *qemu_chr_open(const char *label, const char *filename, void (*i CharDriverState *chr; QemuOpts *opts; + if (strstart(filename, "chardev:", &p)) { + return qemu_chr_find(p); + } + opts = qemu_chr_parse_compat(label, filename); if (!opts) return NULL; @@ -2445,3 +2449,15 @@ void qemu_chr_info(Monitor *mon) monitor_printf(mon, "%s: filename=%s\n", chr->label, chr->filename); } } + +CharDriverState *qemu_chr_find(const char *name) +{ + CharDriverState *chr; + + TAILQ_FOREACH(chr, &chardevs, next) { + if (strcmp(chr->label, name) != 0) + continue; + return chr; + } + return NULL; +} diff --git a/qemu-char.h b/qemu-char.h index 9bff0c7f11..0bf89442c6 100644 --- a/qemu-char.h +++ b/qemu-char.h @@ -90,6 +90,7 @@ void qemu_chr_read(CharDriverState *s, uint8_t *buf, int len); int qemu_chr_get_msgfd(CharDriverState *s); void qemu_chr_accept_input(CharDriverState *s); void qemu_chr_info(Monitor *mon); +CharDriverState *qemu_chr_find(const char *name); extern int term_escape_char; diff --git a/qemu-config.c b/qemu-config.c index 8404f1b4be..f6f4cb4828 100644 --- a/qemu-config.c +++ b/qemu-config.c @@ -130,6 +130,9 @@ QemuOptsList qemu_chardev_opts = { },{ .name = "rows", .type = QEMU_OPT_NUMBER, + },{ + .name = "mux", + .type = QEMU_OPT_BOOL, }, { /* end if list */ } }, |