chardev: generate an internal id when none given
commit1e419ee68fa545421e3a6d5ea32d04e9a20dfbf2
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Mon, 21 Oct 2019 14:31:31 +0000 (21 16:31 +0200)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Tue, 7 Jan 2020 12:50:09 +0000 (7 16:50 +0400)
tree146036e88b4a3689cf2f7aaf76f872712d0449f4
parenta35c6ccc06536e076d5a23c51d67458e3546672c
chardev: generate an internal id when none given

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 <marcandre.lureau@redhat.com>
Reviewed-by: xiaoqiang zhao <zxq_yx_007@163.com>
chardev/char.c
include/qemu/id.h
util/id.c