From 1e419ee68fa545421e3a6d5ea32d04e9a20dfbf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Mon, 21 Oct 2019 16:31:31 +0200 Subject: chardev: generate an internal id when none given MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Internally, qemu may create chardev without ID. Those will not be looked up with qemu_chr_find(), which prevents using qdev_prop_set_chr(). Use id_generate(), to generate an internal name (prefixed with #), so no conflict exist with user-named chardev. Signed-off-by: Marc-André Lureau Reviewed-by: xiaoqiang zhao --- util/id.c | 1 + 1 file changed, 1 insertion(+) (limited to 'util') diff --git a/util/id.c b/util/id.c index af1c5f1b81..5addb4460e 100644 --- a/util/id.c +++ b/util/id.c @@ -34,6 +34,7 @@ bool id_wellformed(const char *id) static const char *const id_subsys_str[ID_MAX] = { [ID_QDEV] = "qdev", [ID_BLOCK] = "block", + [ID_CHR] = "chr", }; /* -- cgit v1.2.3