summaryrefslogtreecommitdiff
path: root/hw/char/virtio-console.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2016-10-22 12:52:59 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2016-10-24 15:27:21 +0200
commitfa394ed625731c18f904578903718bf16617fe92 (patch)
tree224ba9825ba286e3fcffc48394a3a4c1afbc9531 /hw/char/virtio-console.c
parentc39860e6dc90f6ee2e82ee078f978c5d7f3df86a (diff)
downloadqemu-fa394ed625731c18f904578903718bf16617fe92.tar.gz
char: make some qemu_chr_fe skip if no driver
In most cases, front ends do not care about the side effect of CharBackend, so we can simply skip the checks and call the qemu_chr_fe functions even without associated CharDriver. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20161022095318.17775-20-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/char/virtio-console.c')
-rw-r--r--hw/char/virtio-console.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/hw/char/virtio-console.c b/hw/char/virtio-console.c
index 135f589f54..378c1c1c45 100644
--- a/hw/char/virtio-console.c
+++ b/hw/char/virtio-console.c
@@ -108,7 +108,7 @@ static void set_guest_connected(VirtIOSerialPort *port, int guest_connected)
DeviceState *dev = DEVICE(port);
VirtIOSerialPortClass *k = VIRTIO_SERIAL_PORT_GET_CLASS(port);
- if (vcon->chr.chr && !k->is_console) {
+ if (!k->is_console) {
qemu_chr_fe_set_open(&vcon->chr, guest_connected);
}
@@ -122,9 +122,7 @@ static void guest_writable(VirtIOSerialPort *port)
{
VirtConsole *vcon = VIRTIO_CONSOLE(port);
- if (vcon->chr.chr) {
- qemu_chr_fe_accept_input(&vcon->chr);
- }
+ qemu_chr_fe_accept_input(&vcon->chr);
}
/* Readiness of the guest to accept data on a port */