Skip to content

v6 Decouple block device removal from device removal

Ryan Harper qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 9 repliesIn review

Changes since v5 from the cover letter

- Removed dangling pointers in guest and host state. This ensures things like info block no longer displays the deleted drive; though info pci will continue to display the pci device until the guest responds to the removal request.
- Renamed drive_unplug -> drive_del

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2Fix Block Hotplug race with drive_del()block.c block.h blockdev.c +2 more+63 -08 replies
2/2Add qmp version of drive_delqmp-commands.hx+29 -00 replies

Reviews trailers per patch

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

PatchMichael S. Tsirkin
SeriesA-b
1/2
2/2

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

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 0/2] v6 Decouple block device removal from device removal

After *much* discussion, here's version 6.

This patch series decouples the detachment of a block device from the removal of the backing pci-device. Removal of a hotplugged pci device requires the guest to respond before qemu tears down the block device. In some cases, the guest may not respond leaving the guest with continued access to the block device.

The new monitor command, drive_del, will revoke a guests access to the block device independently of the removal of the pci device.

The first patch implements drive_del and bdrv_unplug, the second patch implements the qmp version of the monitor command.

Changes since v5:
- Removed dangling pointers in guest and host state. This ensures things like info block no longer displays the deleted drive; though info pci will continue to display the pci device until the guest responds to the removal request.
- Renamed drive_unplug -> drive_del
Changes since v4:
- Droppped drive_get_by_id patch and use bdrv_find() instead
- Added additional details about drive_unplug to hmp/qmp interface

Changes since v3:
- Moved QMP command for drive_unplug() to separate patch

Changes since v2:
- Added QMP command for drive_unplug()

Changes since v1:
- CodingStyle fixes
- Added qemu_aio_flush() to bdrv_unplug()