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 Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
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 hw/core: Move cpu.c, cpu.h from qom/ to hw/core/ 2019-08-21 13:24:01 +02:00
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 Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
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 Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
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 microblaze: fix leak of fdevice tree blob 2019-10-04 18:49:16 +02:00
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 Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
net migration: Define VMSTATE_INSTANCE_ID_ANY 2020-01-20 09:10:23 +01:00
nios2 Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
nubus hw/m68k: add Nubus support 2019-10-28 19:06:47 +01:00
nvram hw/nvram/Kconfig: Restrict CHRP NVRAM to machines using OpenBIOS or SLOF 2020-01-07 12:08:39 +01:00
openrisc Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
pci migration: Define VMSTATE_INSTANCE_ID_ANY 2020-01-20 09:10:23 +01:00
pci-bridge numa: move numa global variable nb_numa_nodes into MachineState 2019-09-03 11:26:55 -03:00
pci-host q35: implement 128K SMRAM at default SMBASE address 2020-01-22 00:23:07 -05:00
pcmcia Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
ppc migration: Define VMSTATE_INSTANCE_ID_ANY 2020-01-20 09:10:23 +01:00
rdma hw/rdma: Utilize ibv_reg_mr_iova for memory registration 2019-11-06 12:49:04 +02:00
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 smbios:ipmi: Ignore IPMI devices with no fwinfo function 2019-09-20 14:08:10 -05:00
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 aspeed/smc: Add AST2600 timings registers 2019-12-16 10:46:34 +00:00
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 Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
unicore32 Include hw/irq.h a lot less 2019-08-16 13:31:52 +02:00
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 aspeed: Change the "scu" property definition 2019-12-16 10:46:34 +00:00
xen xen: convert "-machine igd-passthru" to an accelerator property 2019-12-17 19:32:27 +01:00
xenpv Include sysemu/sysemu.h a lot less 2019-08-16 13:31:53 +02:00
xtensa hw/xtensa: add virt machine 2019-10-18 20:38:10 -07:00
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