serial: chardev hotswap support
commit1a29cc8f5ebd657e159dbe4be340102595846d42
authorAnton Nefedov <anton.nefedov@virtuozzo.com>
Thu, 6 Jul 2017 12:09:00 +0000 (6 15:09 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 14 Jul 2017 09:04:34 +0000 (14 11:04 +0200)
tree0ff4daeb09242021da568ccfc116c21e9b3c282c
parent757358425e3d6b22ac312f8f69dcaf44ed523ad0
serial: chardev hotswap support

This allows to change the port's backend runtime, e.g. change it from
file to a socket making it possible to establish a debug session with
WinDbg

> qemu-system [..] -chardev file,id=charchannel2,path=/tmp/charchannel2 \
  -device isa-serial,chardev=charchannel2,id=channel2

QEMU 2.9.50 monitor - type 'help' for more information
(qemu) chardev-change charchannel2 \
  socket,host=127.0.0.1,port=4242,server,nowait

For a backend change, a number of ioctls has to be replayed to sync
the current setup of a frontend to a backend tty. This is hopefully
enough so we don't have to track, store and replay the whole original
control byte sequence.

Signed-off-by: Anton Nefedov <anton.nefedov@virtuozzo.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <1499342940-56739-14-git-send-email-anton.nefedov@virtuozzo.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/char/serial.c