qemu/hw
Stefan Hajnoczi 4b7f91ed02 virtio: zero vq->inuse in virtio_reset()
vq->inuse must be zeroed upon device reset like most other virtqueue
fields.

In theory, virtio_reset() just needs assert(vq->inuse == 0) since
devices must clean up in-flight requests during reset (requests cannot
not be leaked!).

In practice, it is difficult to achieve vq->inuse == 0 across reset
because balloon, blk, 9p, etc implement various different strategies for
cleaning up requests.  Most devices call g_free(elem) directly without
telling virtio.c that the VirtQueueElement is cleaned up.  Therefore
vq->inuse is not decremented during reset.

This patch zeroes vq->inuse and trusts that devices are not leaking
VirtQueueElements across reset.

I will send a follow-up series that refactors request life-cycle across
all devices and converts vq->inuse = 0 into assert(vq->inuse == 0) but
this more invasive approach is not appropriate for stable trees.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Cc: qemu-stable <qemu-stable@nongnu.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Ladi Prosek <lprosek@redhat.com>
2016-09-09 20:58:34 +03:00
..
9pfs 9pfs: handle walk of ".." in the root directory 2016-08-30 19:23:00 +01:00
acpi trace-events: fix first line comment in trace-events 2016-08-12 10:36:01 +01:00
alpha trace-events: fix first line comment in trace-events 2016-08-12 10:36:01 +01:00
arm ARM: ACPI: fix the AML ID format for CPU devices 2016-09-06 19:52:17 +01:00
audio portio: keep references on portio 2016-09-08 18:05:21 +04:00
block portio: keep references on portio 2016-09-08 18:05:21 +04:00
bt
char portio: keep references on portio 2016-09-08 18:05:21 +04:00
core bus: simplify name handling 2016-09-08 18:05:22 +04:00
cpu
cris
display portio: keep references on portio 2016-09-08 18:05:21 +04:00
dma portio: keep references on portio 2016-09-08 18:05:21 +04:00
gpio
i2c i2c: fix migration regression introduced by broadcast support 2016-08-03 18:44:56 +02:00
i386 pc: Add 2.8 machine 2016-09-09 20:58:34 +03:00
ide portio: keep references on portio 2016-09-08 18:05:21 +04:00
input pc: simplify passing qemu_irq 2016-09-08 18:05:21 +04:00
intc xics_kvm: drop extra checking of kernel_xics_fd 2016-09-07 09:52:14 +10:00
ipack
ipmi ipmi: free extern timer 2016-09-08 18:05:22 +04:00
isa portio: keep references on portio 2016-09-08 18:05:21 +04:00
lm32
m68k
mem nvdimm: fix memory leak in error code path 2016-07-20 19:30:26 +03:00
microblaze
mips error: Strip trailing '\n' from error string arguments (again) 2016-08-08 09:00:44 +02:00
misc ppc patch queue for 2016-Sep-7 2016-09-08 11:28:12 +01:00
moxie
net spapr: implement H_CHANGE_LOGICAL_LAN_MAC h_call 2016-09-07 12:40:13 +10:00
nvram trace-events: fix first line comment in trace-events 2016-08-12 10:36:01 +01:00
openrisc
pci trace-events: fix first line comment in trace-events 2016-08-12 10:36:01 +01:00
pci-bridge hw/pci-bridge: Convert pxb initialization functions to Error 2016-07-29 00:07:09 +03:00
pci-host apb: convert init to realize 2016-07-29 00:07:09 +03:00
pcmcia
ppc hw/ppc: add a ppc_create_page_sizes_prop() helper routine 2016-09-07 12:40:12 +10:00
s390x s390x/kvm: allow runtime-instrumentation for "none" machine 2016-09-06 17:06:50 +02:00
scsi scsi: scsi-cd without drive property for empty drive 2016-09-05 19:06:47 +02:00
sd sd: free timer 2016-09-08 18:05:22 +04:00
sh4
smbios
sparc trace-events: fix first line comment in trace-events 2016-08-12 10:36:01 +01:00
sparc64
ssi ast2400: pretend DMAs are done for U-boot 2016-07-14 16:51:38 +01:00
timer trace-events: fix first line comment in trace-events 2016-08-12 10:36:01 +01:00
tpm
tricore
unicore32
usb trace-events: fix first line comment in trace-events 2016-08-12 10:36:01 +01:00
vfio trace-events: fix first line comment in trace-events 2016-08-12 10:36:01 +01:00
virtio virtio: zero vq->inuse in virtio_reset() 2016-09-09 20:58:34 +03:00
watchdog
xen Xen: fix converity warning of xen_pt_config_init() 2016-08-12 16:38:18 -07:00
xenpv xen: use a common function for pv and hvm guest backend register calls 2016-08-03 14:52:11 +02:00
xtensa target-xtensa: xtfpga: fix FLASH interface width 2016-07-14 13:59:44 +03:00
Makefile.objs