[PATCH] Revert "chardev: fix backend events regression with mux chardev"

2020-06-30 Thread Szymon Lukasz
>be == d->backends[d->focus]) So there's no need to add the code for sending events to the focused frontend because qemu_chr_be_event() will do that for us. Signed-off-by: Szymon Lukasz --- chardev/char-mux.c | 10 -- chardev/char.c | 18 ++ include

[PATCH v3 8/9] virtio-serial-bus: add terminal resize messages

2020-06-29 Thread Szymon Lukasz
Linux implementation, so hopefully there is no implementation of this functionality conforming to the spec. Signed-off-by: Szymon Lukasz Reviewed-by: Michael S. Tsirkin --- hw/char/trace-events | 1 + hw/char/virtio-serial-bus.c | 42 +-- hw/core

[PATCH v3 7/9] qmp: add chardev-resize command

2020-06-29 Thread Szymon Lukasz
The managment software can use this command to notify QEMU about the size of the terminal connected to a chardev, QEMU can then forward this information to the guest if the chardev is connected to a virtio console device. Signed-off-by: Szymon Lukasz Suggested-by: Daniel P. Berrangé

[PATCH v3 2/9] chardev: add CHR_EVENT_RESIZE

2020-06-29 Thread Szymon Lukasz
Add a new chardev event, CHR_EVENT_RESIZE, which a backend should trigger if detects the size of the connected terminal changed. Signed-off-by: Szymon Lukasz --- backends/cryptodev-vhost-user.c | 1 + chardev/char.c | 1 + hw/block/vhost-user-blk.c | 1 + hw/char

[PATCH v3 5/9] main-loop: change the handling of SIGWINCH

2020-06-29 Thread Szymon Lukasz
Block SIGWINCH, so it is delivered only via signalfd. Install a handler that uses NotifierList to tell interested parties about SIGWINCH delivery. Signed-off-by: Szymon Lukasz --- include/qemu/main-loop.h | 4 ui/curses.c | 11 ++- util/main-loop.c | 21

[PATCH v3 9/9] virtio-console: notify the guest about terminal resizes

2020-06-29 Thread Szymon Lukasz
If a virtio serial port is a console port forward terminal resize messages from the chardev backend to the guest. Signed-off-by: Szymon Lukasz --- hw/char/virtio-console.c | 62 +--- 1 file changed, 58 insertions(+), 4 deletions(-) diff --git a/hw/char

[PATCH v3 6/9] char-stdio: add support for the terminal size

2020-06-29 Thread Szymon Lukasz
Update the terminal size upon SIGWINCH delivery. Signed-off-by: Szymon Lukasz --- chardev/char-stdio.c | 29 + 1 file changed, 29 insertions(+) diff --git a/chardev/char-stdio.c b/chardev/char-stdio.c index 82eaebc1db..4c3c8a80b6 100644 --- a/chardev/char-stdio.c

[PATCH v3 3/9] chardev: add qemu_chr_resize()

2020-06-29 Thread Szymon Lukasz
This function should be called whenever we learn about a new size of the terminal connected to a chardev. Signed-off-by: Szymon Lukasz --- chardev/char.c | 11 +++ include/chardev/char.h | 2 ++ 2 files changed, 13 insertions(+) diff --git a/chardev/char.c b/chardev/char.c

[PATCH v3 0/9] virtio-console: notify about the terminal size

2020-06-29 Thread Szymon Lukasz
libvirt setting, it will allow to implement a resizable terminal for virsh console and other libvirt clients. v3: add resize messages over QMP, as suggested by Daniel v2: fix adding a new virtio feature bit to the virtio console device Szymon Lukasz (9): chardev: add cols, rows fields chardev

[PATCH v3 4/9] char-mux: add support for the terminal size

2020-06-29 Thread Szymon Lukasz
-off-by: Szymon Lukasz --- chardev/char-mux.c | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/chardev/char-mux.c b/chardev/char-mux.c index 46c44af67c..fa81f8341e 100644 --- a/chardev/char-mux.c +++ b/chardev/char-mux.c @@ -247,9 +247,24 @@ void

[PATCH v3 1/9] chardev: add cols, rows fields

2020-06-29 Thread Szymon Lukasz
These fields should be interpreted as the size of the terminal connected to a given chardev. Signed-off-by: Szymon Lukasz --- chardev/char-fe.c | 13 + include/chardev/char-fe.h | 10 ++ include/chardev/char.h| 1 + 3 files changed, 24 insertions(+) diff --git

Re: [PATCH v2 0/6] virtio-console: notify about the terminal size

2020-06-25 Thread Szymon Lukasz
On Wed, Jun 24, 2020 at 12:56:15PM +0100, Daniel P. Berrangé wrote: > On Wed, Jun 24, 2020 at 01:26:34PM +0200, Szymon Lukasz wrote: > > In this series resize notifications are only supported for the stdio > > backend but I think it should be easy to add support for the vc backend.

Re: [PATCH v2 0/6] virtio-console: notify about the terminal size

2020-06-25 Thread Szymon Lukasz
On Wed, Jun 24, 2020 at 12:49:15PM +0100, Daniel P. Berrangé wrote: > On Wed, Jun 24, 2020 at 01:26:34PM +0200, Szymon Lukasz wrote: > > Also there is a problem with the virtio spec and Linux Kernel > > implementation, the order of fields in virtio_console_resize struct > >

[PATCH v2 5/6] virtio-serial-bus: add terminal resize messages

2020-06-24 Thread Szymon Lukasz
Linux implementation, so hopefully there is no implementation of this functionality conforming to the spec. Signed-off-by: Szymon Lukasz --- hw/char/trace-events | 1 + hw/char/virtio-serial-bus.c | 42 +-- hw/core/machine.c | 1

[PATCH v2 6/6] virtio-console: notify the guest about terminal resizes

2020-06-24 Thread Szymon Lukasz
If a virtio serial port is a console port forward terminal resize messages from the chardev backend to the guest. Signed-off-by: Szymon Lukasz --- hw/char/virtio-console.c | 64 +--- 1 file changed, 60 insertions(+), 4 deletions(-) diff --git a/hw/char

[PATCH v2 3/6] chardev: add support for notifying about terminal resizes

2020-06-24 Thread Szymon Lukasz
Add a new chardev event, CHR_EVENT_RESIZE, which a backend should trigger if detects the size of the connected terminal changed. Signed-off-by: Szymon Lukasz --- backends/cryptodev-vhost-user.c | 1 + chardev/char.c | 1 + hw/block/vhost-user-blk.c | 1 + hw/char

[PATCH v2 1/6] main-loop: change the handling of SIGWINCH

2020-06-24 Thread Szymon Lukasz
Block SIGWINCH, so it is delivered only via signalfd. Install a handler that uses NotifierList to tell interested parties about SIGWINCH delivery. Signed-off-by: Szymon Lukasz --- include/qemu/main-loop.h | 4 ui/curses.c | 11 ++- util/main-loop.c | 21

[PATCH v2 4/6] char-stdio: add support for the terminal size

2020-06-24 Thread Szymon Lukasz
Implement chr_get_winsize for the stdio backend and trigger CHR_EVENT_RESIZE upon SIGWINCH delivery. Signed-off-by: Szymon Lukasz --- chardev/char-stdio.c | 35 +++ 1 file changed, 35 insertions(+) diff --git a/chardev/char-stdio.c b/chardev/char-stdio.c index

[PATCH v2 0/6] virtio-console: notify about the terminal size

2020-06-24 Thread Szymon Lukasz
different order than Linux. v2: fix adding a new virtio feature bit to the virtio console device Szymon Lukasz (6): main-loop: change the handling of SIGWINCH chardev: add support for retrieving the terminal size chardev: add support for notifying about terminal resizes char-stdio: add support

[PATCH v2 2/6] chardev: add support for retrieving the terminal size

2020-06-24 Thread Szymon Lukasz
backend connected to some (pseudo)terminal there is no clean way to detect resizes since SIGWINCH is sent only for the controlling terminal). Signed-off-by: Szymon Lukasz --- chardev/char-fe.c | 11 +++ chardev/char-mux.c| 7 +++ include/chardev/char-fe.h | 11

[PATCH 6/6] virtio-console: notify the guest about terminal resizes

2020-06-21 Thread Szymon Lukasz
If a virtio serial port is a console port forward terminal resize messages from the chardev backend to the guest. Signed-off-by: Szymon Lukasz --- hw/char/virtio-console.c | 64 +--- 1 file changed, 60 insertions(+), 4 deletions(-) diff --git a/hw/char

[PATCH 2/6] chardev: add support for retrieving the terminal size

2020-06-21 Thread Szymon Lukasz
backend connected to some (pseudo)terminal there is no clean way to detect resizes since SIGWINCH is sent only for the controlling terminal). Signed-off-by: Szymon Lukasz --- chardev/char-fe.c | 11 +++ chardev/char-mux.c| 7 +++ include/chardev/char-fe.h | 11

[PATCH 4/6] char-stdio: add support for the terminal size

2020-06-21 Thread Szymon Lukasz
Implement chr_get_winsize for the stdio backend and trigger CHR_EVENT_RESIZE upon SIGWINCH delivery. Signed-off-by: Szymon Lukasz --- chardev/char-stdio.c | 34 ++ 1 file changed, 34 insertions(+) diff --git a/chardev/char-stdio.c b/chardev/char-stdio.c index

[PATCH 1/6] main-loop: change the handling of SIGWINCH

2020-06-21 Thread Szymon Lukasz
Block SIGWINCH, so it is delivered only via signalfd. Install a handler that uses NotifierList to tell interested parties about SIGWINCH delivery. Signed-off-by: Szymon Lukasz --- include/qemu/main-loop.h | 4 ui/curses.c | 11 ++- util/main-loop.c | 21

[PATCH 5/6] virtio-serial-bus: add terminal resize messages

2020-06-21 Thread Szymon Lukasz
Linux implementation, so hopefully there is no implementation of this functionality conforming to the spec. Signed-off-by: Szymon Lukasz --- hw/char/trace-events | 1 + hw/char/virtio-serial-bus.c | 41 +-- include/hw/virtio/virtio-serial.h | 5

[PATCH 3/6] chardev: add support for notifying about terminal resizes

2020-06-21 Thread Szymon Lukasz
Add a new chardev event, CHR_EVENT_RESIZE, which a backend should trigger if detects the size of the connected terminal changed. Signed-off-by: Szymon Lukasz --- backends/cryptodev-vhost-user.c | 1 + chardev/char.c | 1 + hw/block/vhost-user-blk.c | 1 + hw/char

[PATCH 0/6] virtio-console: notify about the terminal size

2020-06-21 Thread Szymon Lukasz
different order than Linux. Szymon Lukasz (6): main-loop: change the handling of SIGWINCH chardev: add support for retrieving the terminal size chardev: add support for notifying about terminal resizes char-stdio: add support for the terminal size virtio-serial-bus: add terminal resize