mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
chardev: add support for qapi-based chardev initialization
This patch add support for a new way to initialize chardev devices. Instead of calling a initialization function with a QemuOpts we will now create a (qapi) ChardevBackend, optionally call a function to fill ChardevBackend from QemuOpts, then go create the chardev using the new qapi code path which is also used by chardev-add. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
8ca761f661
commit
2c5f488293
2 changed files with 45 additions and 0 deletions
|
@ -245,6 +245,8 @@ CharDriverState *qemu_chr_find(const char *name);
|
|||
QemuOpts *qemu_chr_parse_compat(const char *label, const char *filename);
|
||||
|
||||
void register_char_driver(const char *name, CharDriverState *(*open)(QemuOpts *));
|
||||
void register_char_driver_qapi(const char *name, int kind,
|
||||
void (*parse)(QemuOpts *opts, ChardevBackend *backend, Error **errp));
|
||||
|
||||
/* add an eventfd to the qemu devices that are polled */
|
||||
CharDriverState *qemu_chr_open_eventfd(int eventfd);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue