This patch add the filename when the new qapi backend init from opts. Commit 2c5f488293c7d0cd095635c74157c2526e2c4947 add support for qapi-based chardev initialization, but miss the filename of the char device as below:
(qemu) info chardev parallel0: filename=(null) serial0: filename=(null) compat_monitor0: filename=(null) Signed-off-by: Lei Li <li...@linux.vnet.ibm.com> --- qemu-char.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/qemu-char.c b/qemu-char.c index 30a2ddf..a9f618a 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -3276,6 +3276,7 @@ CharDriverState *qemu_chr_new_from_opts(QemuOpts *opts, ChardevReturn *ret = NULL; const char *id = qemu_opts_id(opts); const char *bid = NULL; + char *filename = g_strdup(qemu_opt_get(opts, "backend")); if (qemu_opt_get_bool(opts, "mux", 0)) { bid = g_strdup_printf("%s-base", id); @@ -3308,6 +3309,7 @@ CharDriverState *qemu_chr_new_from_opts(QemuOpts *opts, } chr = qemu_chr_find(id); + chr->filename = filename; qapi_out: qapi_free_ChardevBackend(backend); -- 1.7.7.6