[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [PATCH 1/5] virtio-console: set frontend open permanently
From: |
Cornelia Huck |
Subject: |
Re: [Qemu-ppc] [PATCH 1/5] virtio-console: set frontend open permanently for console devs |
Date: |
Wed, 3 Aug 2016 19:37:40 +0200 |
On Wed, 3 Aug 2016 17:22:36 +0100
"Daniel P. Berrange" <address@hidden> wrote:
> The virtio-console.c file handles both serial consoles
> and interactive consoles, since they're backed by the
> same device model.
>
> Since serial devices are expected to be reliable and
> need to notify the guest when the backend is opened
> or closed, the virtio-console.c file wires up support
> for chardev events. This affects both serial consoles
> and interactive consoles, using a network connection
> based chardev backend such as 'socket', but not when
> using a PTY based backend or plain 'file' backends.
>
> When the host side is not connected the handle_output()
> method in virtio-serial-bus.c will drop any data sent
> by the guest, before it even reaches the virtio-console.c
> code. This means that if the chardev has a logfile
> configured, the data will never get logged.
>
> Consider for example, configuring a x86_64 guest with a
> plain UART serial port
>
> -chardev
> socket,id=charserial1,host=127.0.0.1,port=9001,server,nowait,logfile=console1.log,logappend=on
> -device isa-serial,chardev=charserial1,id=serial1
>
> vs a s390 guest which has to use the virtio-console port
>
> -chardev
> socket,id=charconsole1,host=127.0.0.1,port=9000,server,nowait,logfile=console2.log,logappend=on
> -device virtconsole,chardev=charconsole1,id=console1
>
> The isa-serial one gets data written to the log regardless
> of whether a client is connected, while the virtioconsole
> one only gets data written to the log when a client is
> connected.
>
> There is no need for virtio-serial-bus.c to aggressively
> drop the data for console devices, as the chardev code is
> prefectly capable of discarding the data itself.
>
> So this patch changes virtconsole devices so that they
> are always marked as having the host side open. This
> ensures that the guest OS will always send any data it
> has (Linux virtio-console hvc driver actually ignores
> the host open state and sends data regardless, but we
> should not rely on that), and also prevents the
> virtio-serial-bus code prematurely discarding data.
>
> The behaviour of virtserialport devices is *not* changed,
> only virtconsole, because for the former, it is important
> that the guest OSknow exactly when the host side is opened
> / closed so it can do any protocol re-negotiation that may
> be required.
>
> Fixes bug: https://bugs.launchpad.net/qemu/+bug/1599214
>
> Signed-off-by: Daniel P. Berrange <address@hidden>
> ---
> hw/char/virtio-console.c | 25 +++++++++++++++++++++----
> 1 file changed, 21 insertions(+), 4 deletions(-)
From my limited understanding of the character layer this sounds
reasonable, and I agree that this is 2.7 material.
Acked-by: Cornelia Huck <address@hidden>
- [Qemu-ppc] [PATCH 0/5] Global fix / workaround usage of qemu_chr_fe_write, Daniel P. Berrange, 2016/08/03
- [Qemu-ppc] [PATCH 2/5] impi: check return of qemu_chr_fe_write() for errors, Daniel P. Berrange, 2016/08/03
- [Qemu-ppc] [PATCH 1/5] virtio-console: set frontend open permanently for console devs, Daniel P. Berrange, 2016/08/03
- [Qemu-ppc] [PATCH 4/5] hw: replace most use of qemu_chr_fe_write with qemu_chr_fe_write_all, Daniel P. Berrange, 2016/08/03
- [Qemu-ppc] [PATCH 3/5] sclpconsole: remove bogus check for -EAGAIN, Daniel P. Berrange, 2016/08/03
- [Qemu-ppc] [PATCH 5/5] char: convert qemu_chr_fe_write to qemu_chr_fe_write_all, Daniel P. Berrange, 2016/08/03