qemu/hw
Dr. David Alan Gilbert 394642a8d3 usbredir: Prevent recursion in usbredir_write
I've got a case where usbredir_write manages to call back into itself
via spice; this patch causes the recursion to fail (0 bytes) the write;
this seems to avoid the deadlock I was previously seeing.

I can't say I fully understand the interaction of usbredir and spice;
but there are a few similar guards in spice and usbredir
to catch other cases especially onces also related to spice_server_char_device_wakeup

This case seems to be triggered by repeated migration+repeated
reconnection of the viewer; but my debugging suggests the migration
finished before this hits.

The backtrace of the hang looks like:
  reds_handle_ticket
  reds_handle_other_links
  reds_channel_do_link
  red_channel_connect
  spicevmc_connect
  usbredir_create_parser
  usbredirparser_do_write
  usbredir_write
  qemu_chr_fe_write
  qemu_chr_write
  qemu_chr_write_buffer
  spice_chr_write
  spice_server_char_device_wakeup
  red_char_device_wakeup
  red_char_device_write_to_device
  vmc_write
  usbredirparser_do_write
  usbredir_write
  qemu_chr_fe_write
  qemu_chr_write
  qemu_chr_write_buffer
  qemu_mutex_lock_impl

and we fail as we lang through qemu_chr_write_buffer's lock
twice.

Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1752320

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20191218113012.13331-1-dgilbert@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-01-13 14:05:46 +01:00
..
9pfs 9pfs: make Error **errp const where it is appropriate 2019-12-18 08:43:19 +01:00
acpi hmat acpi: Build Memory Side Cache Information Structure(s) 2020-01-05 07:03:03 -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 omap-gpio: remove PROP_PTR 2020-01-07 17:24:29 +04:00
audio hda-codec: fix recording rate control 2020-01-06 08:47:16 +01:00
block virtio, pci, pc: fixes, features 2020-01-07 16:25:00 +00:00
bt Remove the core bluetooth code 2019-12-17 09:01:14 +01:00
char Clean-ups: qom-ify serial and remove QDEV_PROP_PTR 2020-01-07 17:54:29 +00:00
core usb-redir: remove 'remote wakeup' flag from configuration descriptor 2020-01-13 09:17:31 +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 sm501: make SerialMM a child, export chardev property 2020-01-07 17:24:29 +04: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 omap-i2c: remove PROP_PTR 2020-01-07 17:24:29 +04:00
i386 Testing fixes and semiconsole support: 2020-01-10 13:19:34 +00:00
ide vmstate: replace DeviceState with VMStateIf 2020-01-06 18:41:32 +04:00
input Clean-ups: qom-ify serial and remove QDEV_PROP_PTR 2020-01-07 17:54:29 +00:00
intc ppc patch queue 2020-01-08 2020-01-10 16:15:04 +00:00
ipack Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
ipmi hw/ipmi: Fix realize() error API violations 2019-12-18 08:36:15 +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 mips/cps: fix setting saar property 2020-01-07 17:24:29 +04:00
misc mos6522: remove anh register 2020-01-08 11:01:59 +11:00
moxie Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
net Clean-ups: qom-ify serial and remove QDEV_PROP_PTR 2020-01-07 17:54:29 +00: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 vmstate: replace DeviceState with VMStateIf 2020-01-06 18:41:32 +04:00
openrisc Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
pci hw/pci/pci_host: Let pci_data_[read/write] use unsigned 'size' argument 2020-01-05 07:03:03 -05:00
pci-bridge numa: move numa global variable nb_numa_nodes into MachineState 2019-09-03 11:26:55 -03:00
pci-host hw/pci-host: Add Kconfig entry to select the IGD Passthrough Host Bridge 2019-12-18 02:34:12 +01:00
pcmcia Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
ppc ppc/pnv: fix check on return value of blk_getlength() 2020-01-08 12:01:14 +11:00
rdma hw/rdma: Utilize ibv_reg_mr_iova for memory registration 2019-11-06 12:49:04 +02:00
riscv hw/riscv: Add optional symbol callback ptr to riscv_load_kernel() 2019-11-25 12:34:52 -08:00
rtc * microvm docs and fixes (Sergio, Liam) 2019-11-19 16:31:27 +00:00
s390x vmstate: replace DeviceState with VMStateIf 2020-01-06 18:41:32 +04:00
scsi virtio: make seg_max virtqueue size dependent 2020-01-06 12:04:43 -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 leon3: use qdev gpio facilities for the PIL 2020-01-07 17:24:29 +04:00
sparc64 hw: Move sun4v hypervisor RTC from hw/timer/ to hw/rtc/ subdirectory 2019-10-24 20:23:15 +02:00
ssi aspeed/smc: Add AST2600 timings registers 2019-12-16 10:46:34 +00:00
timer aspeed: Change the "scu" property definition 2019-12-16 10:46:34 +00:00
tpm hw/tpm: rename Error ** parameter to more common errp 2019-12-18 08:43:19 +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 usbredir: Prevent recursion in usbredir_write 2020-01-13 14:05:46 +01: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