diff options
| author | Amit Shah | 2010-04-27 14:34:04 +0200 |
|---|---|---|
| committer | Anthony Liguori | 2010-04-28 15:58:21 +0200 |
| commit | 3ecb45f893d09a97b8f24399b5e40808a708261f (patch) | |
| tree | d0baca75d720b6981616bc5f2d743fc073deef77 | |
| parent | virtio-serial: Propagate errors in initialising ports / devices in guest (diff) | |
| download | qemu-3ecb45f893d09a97b8f24399b5e40808a708261f.tar.gz qemu-3ecb45f893d09a97b8f24399b5e40808a708261f.tar.xz qemu-3ecb45f893d09a97b8f24399b5e40808a708261f.zip | |
virtio-serial: Send out guest data to ports only if port is opened
Data should be written only when ports are open.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
| -rw-r--r-- | hw/virtio-serial-bus.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c index 3a09f0d3c6..6befd4d139 100644 --- a/hw/virtio-serial-bus.c +++ b/hw/virtio-serial-bus.c @@ -335,6 +335,11 @@ static void handle_output(VirtIODevice *vdev, VirtQueue *vq) goto next_buf; } + if (!port->host_connected) { + ret = 0; + goto next_buf; + } + /* * A port may not have any handler registered for consuming the * data that the guest sends or it may not have a chardev associated |
