On 02/27/2015 10:11 AM, Max Reitz wrote: > s->blocker is really only used in hw/scsi/virtio-scsi.c; the only places > where it is used in hw/scsi/virtio-scsi-dataplane.c is when it is > allocated and when it is freed. That does not make a whole lot of sense > (and is actually wrong because this leads to s->blocker potentially > being NULL when blk_op_block_all() is called in virtio-scsi.c), so move > the allocation and destruction of s->blocker to the device realization > and unrealization in virtio-scsi.c, respectively. >
> > Signed-off-by: Max Reitz <mre...@redhat.com> > --- > v2: > - Put the reproducer into the commit message [Markus] and modified its > wording to be more fitting of a commit message ("Case in point" > instead of the imperative "Try"). > - As noted by Fam on my bdrv_close_all() series, there can be multiple > block devices per virtio-scsi bus; therefore, it's wrong to delete the > blocker if one of these is unplugged. Instead, just allocate the > blocker with the virtio-scsi device itself and free it when the device > is unrealized. > --- > hw/scsi/virtio-scsi-dataplane.c | 4 ---- > hw/scsi/virtio-scsi.c | 4 ++++ > 2 files changed, 4 insertions(+), 4 deletions(-) Reviewed-by: Eric Blake <ebl...@redhat.com> -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature