aboutsummaryrefslogtreecommitdiff
path: root/qemu-char.c
diff options
context:
space:
mode:
Diffstat (limited to 'qemu-char.c')
-rw-r--r--qemu-char.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/qemu-char.c b/qemu-char.c
index f825294a9b..d04b429a03 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -3801,6 +3801,9 @@ ChardevReturn *qmp_chardev_add(const char *id, ChardevBackend *backend,
chr->label = g_strdup(id);
chr->avail_connections =
(backend->kind == CHARDEV_BACKEND_KIND_MUX) ? MAX_MUX : 1;
+ if (!chr->filename) {
+ chr->filename = g_strdup(ChardevBackendKind_lookup[backend->kind]);
+ }
QTAILQ_INSERT_TAIL(&chardevs, chr, next);
return ret;
} else {