aboutsummaryrefslogtreecommitdiff
path: root/qemu-char.c
diff options
context:
space:
mode:
Diffstat (limited to 'qemu-char.c')
-rw-r--r--qemu-char.c16
1 files changed, 16 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;
+}