mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-28 14:00:44 +00:00
8449bcf949
There is a race condition during hotplug when iothread is used. It occurs because virtio-scsi may be processing command queues in the iothread while the monitor performs SCSI device hotplug. When a SCSI device is hotplugged the HotplugHandler->plug() callback is invoked and virtio-scsi emits a rescan event to the guest. If the guest submits a SCSI command at this point then it may be cancelled before hotplug completes. This happens because ->reset() is called by hw/core/qdev.c:device_set_realized() after HotplugHandler->plug() has been called and hw/scsi/scsi-disk.c:scsi_disk_reset() purges all requests. This patch uses the new HotplugHandler->post_plug() callback to emit the rescan event after ->reset(). This eliminates the race conditions where requests could be cancelled. Reported-by: l00284672 <lizhengui@huawei.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Fam Zheng <famz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20180716083732.3347-3-stefanha@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> |
||
---|---|---|
.. | ||
esp-pci.c | ||
esp.c | ||
lsi53c895a.c | ||
Makefile.objs | ||
megasas.c | ||
mfi.h | ||
mpi.h | ||
mptconfig.c | ||
mptendian.c | ||
mptsas.c | ||
mptsas.h | ||
scsi-bus.c | ||
scsi-disk.c | ||
scsi-generic.c | ||
spapr_vscsi.c | ||
srp.h | ||
trace-events | ||
vhost-scsi-common.c | ||
vhost-scsi.c | ||
vhost-user-scsi.c | ||
viosrp.h | ||
virtio-scsi-dataplane.c | ||
virtio-scsi.c | ||
vmw_pvscsi.c | ||
vmw_pvscsi.h |