mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
chardev: add pty chardev support to chardev-add (qmp)
The ptsname is returned directly, so there is no need to use query-chardev to figure the pty device path. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
f6bd5d6ec5
commit
0a1a7fabda
3 changed files with 20 additions and 1 deletions
13
qemu-char.c
13
qemu-char.c
|
@ -3204,6 +3204,19 @@ ChardevReturn *qmp_chardev_add(const char *id, ChardevBackend *backend,
|
|||
case CHARDEV_BACKEND_KIND_SOCKET:
|
||||
chr = qmp_chardev_open_socket(backend->socket, errp);
|
||||
break;
|
||||
#ifdef HAVE_CHARDEV_TTY
|
||||
case CHARDEV_BACKEND_KIND_PTY:
|
||||
{
|
||||
/* qemu_chr_open_pty sets "path" in opts */
|
||||
QemuOpts *opts;
|
||||
opts = qemu_opts_create_nofail(qemu_find_opts("chardev"));
|
||||
chr = qemu_chr_open_pty(opts);
|
||||
ret->pty = g_strdup(qemu_opt_get(opts, "path"));
|
||||
ret->has_pty = true;
|
||||
qemu_opts_del(opts);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
case CHARDEV_BACKEND_KIND_NULL:
|
||||
chr = qemu_chr_open_null(NULL);
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue