b74cb8761c
Add path option to the pty char backend which will create a symbolic link to the given path that points to the allocated PTY. This avoids having to make QMP or HMP monitor queries to find out what the new PTY device path is. Based on patch from Paulo Neves: https://patchew.org/QEMU/1548509635-15776-1-git-send-email-ptsneves@gmail.com/ Tested with the following invocations that the link is created and removed when qemu stops: qemu-system-x86_64 -nodefaults -mon chardev=compat_monitor \ -chardev pty,path=test,id=compat_monitor0 qemu-system-x86_64 -nodefaults -monitor pty:test # check QMP invocation with path set qemu-system-x86_64 -nodefaults -qmp tcp:localhost:4444,server=on,wait=off nc localhost 4444 > {"execute": "qmp_capabilities"} > {"execute": "chardev-add", "arguments": {"id": "bar", "backend": { "type": "pty", "data": {"path": "test" }}}} # check QMP invocation with path not set qemu-system-x86_64 -nodefaults -qmp tcp:localhost:4444,server=on,wait=off nc localhost 4444 > {"execute": "qmp_capabilities"} > {"execute": "chardev-add", "arguments": {"id": "bar", "backend": { "type": "pty", "data": {}}}} Also tested that when a link path is not passed invocations still work, e.g.: qemu-system-x86_64 -monitor pty Co-authored-by: Paulo Neves <ptsneves@gmail.com> Signed-off-by: Paulo Neves <ptsneves@gmail.com> [OP: rebase and address original patch review comments] Signed-off-by: Octavian Purdila <tavip@google.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-ID: <20240806010735.2450555-1-tavip@google.com> |
||
---|---|---|
.. | ||
acpi.json | ||
audio.json | ||
authz.json | ||
block-core.json | ||
block-export.json | ||
block.json | ||
char.json | ||
common.json | ||
compat.json | ||
control.json | ||
crypto.json | ||
cryptodev.json | ||
cxl.json | ||
dump.json | ||
ebpf.json | ||
error.json | ||
introspect.json | ||
job.json | ||
machine-common.json | ||
machine-target.json | ||
machine.json | ||
meson.build | ||
migration.json | ||
misc-target.json | ||
misc.json | ||
net.json | ||
opts-visitor.c | ||
pci.json | ||
pragma.json | ||
qapi-clone-visitor.c | ||
qapi-dealloc-visitor.c | ||
qapi-forward-visitor.c | ||
qapi-schema.json | ||
qapi-type-helpers.c | ||
qapi-util.c | ||
qapi-visit-core.c | ||
qdev.json | ||
qmp-dispatch.c | ||
qmp-event.c | ||
qmp-registry.c | ||
qobject-input-visitor.c | ||
qobject-output-visitor.c | ||
qom.json | ||
replay.json | ||
rocker.json | ||
run-state.json | ||
sockets.json | ||
stats.json | ||
string-input-visitor.c | ||
string-output-visitor.c | ||
tpm.json | ||
trace-events | ||
trace.h | ||
trace.json | ||
transaction.json | ||
ui.json | ||
vfio.json | ||
virtio.json | ||
yank.json |