Commit d4c19cd
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: amit.shah@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Ladi Prosek <lprosek@redhat.com>
Reviewed-by: Ladi Prosek <lprosek@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>1 parent 97b93c8 commit d4c19cd
1 file changed
+14
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
148 | 157 | | |
149 | 158 | | |
150 | 159 | | |
| |||
267 | 276 | | |
268 | 277 | | |
269 | 278 | | |
| 279 | + | |
270 | 280 | | |
271 | 281 | | |
272 | 282 | | |
| |||
591 | 601 | | |
592 | 602 | | |
593 | 603 | | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
594 | 607 | | |
595 | 608 | | |
596 | 609 | | |
| |||
901 | 914 | | |
902 | 915 | | |
903 | 916 | | |
| 917 | + | |
904 | 918 | | |
905 | 919 | | |
906 | 920 | | |
| |||
0 commit comments