mbox series

[0/6] Acquire the AioContext during _realize()

Message ID cover.1547132561.git.berto@igalia.com (mailing list archive)
Headers show
Series Acquire the AioContext during _realize() | expand

Message

Alberto Garcia Jan. 10, 2019, 3:03 p.m. UTC
As discussed yesterday, this series acquires the AioContext in the
_realize() functions of several devices before making use of their
block backends. This fixes at least a couple of crashes (in virtio-blk
and scsi).

Berto

Alberto Garcia (6):
  block: Acquire the AioContext in virtio_blk_device_realize()
  block: Acquire the AioContext in scsi_*_realize()
  block: Acquire the AioContext in floppy_drive_realize()
  block: Acquire the AioContext in nvme_realize()
  block: Acquire the AioContext in ide_dev_initfn()
  block: Acquire the AioContext in usb_msd_storage_realize()

 hw/block/fdc.c        | 15 +++++++++++----
 hw/block/nvme.c       | 13 ++++++++++---
 hw/block/virtio-blk.c | 22 +++++++++++++++-------
 hw/ide/qdev.c         | 17 ++++++++++++-----
 hw/scsi/scsi-disk.c   | 24 +++++++++++++++++++-----
 hw/usb/dev-storage.c  |  5 +++++
 6 files changed, 72 insertions(+), 24 deletions(-)

Comments

Markus Armbruster Jan. 11, 2019, 1:20 p.m. UTC | #1
For what it's worth, this series seems to fix assertion failures related
to AioContext acquire/release I've seen.
Kevin Wolf Jan. 11, 2019, 3:09 p.m. UTC | #2
Am 10.01.2019 um 16:03 hat Alberto Garcia geschrieben:
> As discussed yesterday, this series acquires the AioContext in the
> _realize() functions of several devices before making use of their
> block backends. This fixes at least a couple of crashes (in virtio-blk
> and scsi).

Apart from the incomplete scsi-block fix, this looks good. Of course,
I think patches 3-6 are completely optional because none of these
devices actually support iothreads, so we can't hit a bug. But it might
be nicer to add it there as well anyway.

For patches 1 and 2, which actually fix bugs, it would be nice to have
an accompanying test case.

Kevin
Alberto Garcia Jan. 11, 2019, 3:13 p.m. UTC | #3
On Fri 11 Jan 2019 04:09:17 PM CET, Kevin Wolf wrote:
> Am 10.01.2019 um 16:03 hat Alberto Garcia geschrieben:
>> As discussed yesterday, this series acquires the AioContext in the
>> _realize() functions of several devices before making use of their
>> block backends. This fixes at least a couple of crashes (in virtio-blk
>> and scsi).
>
> Apart from the incomplete scsi-block fix, this looks good. Of course,
> I think patches 3-6 are completely optional because none of these
> devices actually support iothreads, so we can't hit a bug. But it
> might be nicer to add it there as well anyway.
>
> For patches 1 and 2, which actually fix bugs, it would be nice to have
> an accompanying test case.

Ok, I'll prepare v2 with your suggestions.

Berto