summaryrefslogtreecommitdiff
path: root/qemu-char.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2013-05-27 12:41:24 +0200
committerGerd Hoffmann <kraxel@redhat.com>2013-05-27 12:47:28 +0200
commit60d95386abf1f5f37ded6a812d12ac458df2491b (patch)
treeffb9e237d3de60a0b77651511cbae71dc2e661f2 /qemu-char.c
parent3022e6b472d0f6d56efbe890e0f1c94841b170d4 (diff)
downloadqemu-60d95386abf1f5f37ded6a812d12ac458df2491b.zip
chardev: fix "info chardev" output
Fill unset CharDriverState->filename with the backend name, so 'info chardev' will return at least the chardev type. Don't touch it in case the chardev init function filled it already, like the socket+pty chardevs do for example. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
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 {