Skip to content

virtio-scsi: fix hotplug ->reset() vs event race

Stefan Hajnoczi qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 3 repliesIn review
  2. v12 patches 9 repliesSuperseded

Changes in v2 from the cover letter

* Drop Error **errp argument to post_plug() handler [Paolo]
* Move post_plug() call outside if (dev->hotplugged)

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2qdev: add HotplugHandler->post_plug() callbackhw/core/hotplug.c hw/core/qdev.c include/hw/hotplug.h+25 -00 replies
2/2virtio-scsi: fix hotplug ->reset() vs event racehw/scsi/virtio-scsi.c+10 -12 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchIgor MammedovMichael S. Tsirkin
SeriesR-b
1/2
2/2A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [Qemu-devel] [PATCH v2 0/2] virtio-scsi: fix hotplug ->reset() vs event race

v2:
* Drop Error **errp argument to post_plug() handler [Paolo]
* Move post_plug() call outside if (dev->hotplugged)

The virtio-scsi command virtqueues run during hotplug. This creates the possibility of race conditions since the guest can submit commands while the monitor is performing hotplug.

See Patch 2 for a fix for the ->reset() vs event race condition that Zhengui Li encountered.

Stefan Hajnoczi (2):
qdev: add HotplugHandler->post_plug() callback
virtio-scsi: fix hotplug ->reset() vs event race

 include/hw/hotplug.h  | 11 +++++++++++
 hw/core/hotplug.c     | 10 ++++++++++
 hw/core/qdev.c        |  4 ++++
 hw/scsi/virtio-scsi.c | 11 ++++++++++-
 4 files changed, 35 insertions(+), 1 deletion(-)
Signature · 1 line
2.17.1