qemu-e2k/hw
Pan Nengyuan dd958f9ef4 virtio-scsi: delete vqs in unrealize to avoid memleaks
This patch fix memleaks when attaching/detaching virtio-scsi device, the
memory leak stack is as follow:

Direct leak of 21504 byte(s) in 3 object(s) allocated from:
  #0 0x7f491f2f2970 (/lib64/libasan.so.5+0xef970)  ??:?
  #1 0x7f491e94649d (/lib64/libglib-2.0.so.0+0x5249d)  ??:?
  #2 0x564d0f3919fa (./x86_64-softmmu/qemu-system-x86_64+0x2c3e9fa)  /mnt/sdb/qemu/hw/virtio/virtio.c:2333
  #3 0x564d0f2eca55 (./x86_64-softmmu/qemu-system-x86_64+0x2b99a55)  /mnt/sdb/qemu/hw/scsi/virtio-scsi.c:912
  #4 0x564d0f2ece7b (./x86_64-softmmu/qemu-system-x86_64+0x2b99e7b)  /mnt/sdb/qemu/hw/scsi/virtio-scsi.c:924
  #5 0x564d0f39ee47 (./x86_64-softmmu/qemu-system-x86_64+0x2c4be47)  /mnt/sdb/qemu/hw/virtio/virtio.c:3531
  #6 0x564d0f980224 (./x86_64-softmmu/qemu-system-x86_64+0x322d224)  /mnt/sdb/qemu/hw/core/qdev.c:865

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Pan Nengyuan <pannengyuan@huawei.com>
Message-Id: <20200117075547.60864-2-pannengyuan@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
2020-01-22 00:23:07 -05:00
..
9pfs virtio-9p-device: convert to new virtio_delete_queue 2020-01-22 00:23:07 -05:00
acpi acpi: cpuhp: add CPHP_GET_CPU_ID_CMD command 2020-01-22 00:23:07 -05:00
adc
alpha hw: replace hw/i386/pc.h with a header just for the i8259 2019-12-17 19:33:49 +01:00
arm migration: Define VMSTATE_INSTANCE_ID_ANY 2020-01-20 09:10:23 +01:00
audio hda-codec: fix recording rate control 2020-01-06 08:47:16 +01:00
block * Compat machines fix (Denis) 2020-01-10 17:16:49 +00:00
bt Remove the core bluetooth code 2019-12-17 09:01:14 +01:00
char * Compat machines fix (Denis) 2020-01-10 17:16:49 +00:00
core migration: Define VMSTATE_INSTANCE_ID_ANY 2020-01-20 09:10:23 +01:00
cpu
cris cris: improve passing PIC interrupt vector to the CPU 2020-01-07 17:24:29 +04:00
display migration: Define VMSTATE_INSTANCE_ID_ANY 2020-01-20 09:10:23 +01:00
dma lance: replace PROP_PTR with PROP_LINK 2020-01-07 17:24:29 +04:00
gpio omap-gpio: remove PROP_PTR 2020-01-07 17:24:29 +04:00
hppa hw: replace hw/i386/pc.h with a header just for the i8259 2019-12-17 19:33:49 +01:00
hyperv hyperv: Use auto rcu_read macros 2019-12-17 19:33:52 +01:00
i2c migration: Define VMSTATE_INSTANCE_ID_ANY 2020-01-20 09:10:23 +01:00
i386 q35: implement 128K SMRAM at default SMBASE address 2020-01-22 00:23:07 -05:00
ide vmstate: replace DeviceState with VMStateIf 2020-01-06 18:41:32 +04:00
input migration: Define VMSTATE_INSTANCE_ID_ANY 2020-01-20 09:10:23 +01:00
intc apic: Use 32bit APIC ID for migration instance ID 2020-01-20 09:10:23 +01:00
ipack
ipmi chardev: Use QEMUChrEvent enum in IOEventHandler typedef 2020-01-08 11:15:35 +01:00
isa hw/isa/isa-bus: cleanup irq functions 2019-12-17 19:33:51 +01:00
lm32
m68k Clean-ups: qom-ify serial and remove QDEV_PROP_PTR 2020-01-07 17:54:29 +00:00
mem memory-device: Fix memory pre-plug error API violations 2019-12-18 08:36:15 +01:00
microblaze
mips * Compat machines fix (Denis) 2020-01-10 17:16:49 +00:00
misc migration: Define VMSTATE_INSTANCE_ID_ANY 2020-01-20 09:10:23 +01:00
moxie
net migration: Define VMSTATE_INSTANCE_ID_ANY 2020-01-20 09:10:23 +01:00
nios2
nubus
nvram hw/nvram/Kconfig: Restrict CHRP NVRAM to machines using OpenBIOS or SLOF 2020-01-07 12:08:39 +01:00
openrisc
pci migration: Define VMSTATE_INSTANCE_ID_ANY 2020-01-20 09:10:23 +01:00
pci-bridge
pci-host q35: implement 128K SMRAM at default SMBASE address 2020-01-22 00:23:07 -05:00
pcmcia
ppc migration: Define VMSTATE_INSTANCE_ID_ANY 2020-01-20 09:10:23 +01:00
rdma
riscv chardev: Use QEMUChrEvent enum in IOEventHandler typedef 2020-01-08 11:15:35 +01:00
rtc hw/rtc/mc146818: Add missing dependency on ISA Bus 2020-01-07 12:23:10 +01:00
s390x vmstate: replace DeviceState with VMStateIf 2020-01-06 18:41:32 +04:00
scsi virtio-scsi: delete vqs in unrealize to avoid memleaks 2020-01-22 00:23:07 -05:00
sd hw/sd: drop extra whitespace in sdhci_sysbus_realize() header 2019-12-18 08:43:19 +01:00
semihosting semihosting: add qemu_semihosting_console_inc for SYS_READC 2020-01-09 11:41:29 +00:00
sh4 sm501: make SerialMM a child, export chardev property 2020-01-07 17:24:29 +04:00
smbios
sparc * Compat machines fix (Denis) 2020-01-10 17:16:49 +00:00
sparc64 hw/nvram/Kconfig: Restrict CHRP NVRAM to machines using OpenBIOS or SLOF 2020-01-07 12:08:39 +01:00
ssi
timer migration: Define VMSTATE_INSTANCE_ID_ANY 2020-01-20 09:10:23 +01:00
tpm migration: Define VMSTATE_INSTANCE_ID_ANY 2020-01-20 09:10:23 +01:00
tricore
unicore32
usb usb: bugfixes for xhci, usb pass-through and usb redirection. 2020-01-13 14:19:57 +00:00
vfio vfio/pci: Don't remove irqchip notifier if not registered 2020-01-06 14:19:42 -07:00
virtio virtio: reset region cache when on queue deletion 2020-01-06 12:04:51 -05:00
watchdog
xen xen: convert "-machine igd-passthru" to an accelerator property 2019-12-17 19:32:27 +01:00
xenpv
xtensa
Kconfig Remove the core bluetooth code 2019-12-17 09:01:14 +01:00
Makefile.objs Remove the core bluetooth code 2019-12-17 09:01:14 +01:00