]> Git Repo - qemu.git/commit
virtio-serial: add missing virtio_detach_element() call
authorStefan Hajnoczi <[email protected]>
Mon, 19 Sep 2016 13:28:05 +0000 (14:28 +0100)
committerMichael S. Tsirkin <[email protected]>
Sun, 9 Oct 2016 22:16:58 +0000 (01:16 +0300)
commitd4c19cdeeb2f1e474bc426a6da261f1d7346eb5b
treeca6257b6196dbfa2857984b4c87646ece6553f2f
parent97b93c8ad2242c5a5f89ac50f9e696289c5b4947
virtio-serial: add missing virtio_detach_element() call

Ports enter a "throttled" state when writing to the chardev would block.
The current output VirtQueueElement is kept around until the chardev
becomes writable again.

There are several places in the virtio-serial lifecycle where the
VirtQueueElement should be thrown away.  For example, if the virtio
device is reset then virtqueue elements are no longer valid.

This patch adds the discard_throttle_data() function to unmap the
scatter-gather list and decrement vq->inuse.  This ensures that the
VirtQueueElement is freed properly.

Cc: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>
Tested-by: Ladi Prosek <[email protected]>
Reviewed-by: Ladi Prosek <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
hw/char/virtio-serial-bus.c
This page took 0.023476 seconds and 4 git commands to generate.