xemu/include/qemu/id.h
Marc-André Lureau 1e419ee68f 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>
2020-01-07 16:50:09 +04:00

15 lines
256 B
C

#ifndef QEMU_ID_H
#define QEMU_ID_H
typedef enum IdSubSystems {
ID_QDEV,
ID_BLOCK,
ID_CHR,
ID_MAX /* last element, used as array size */
} IdSubSystems;
char *id_generate(IdSubSystems id);
bool id_wellformed(const char *id);
#endif