mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
virtio-scsi: Catch BDS-BB removal/insertion
Make use of the BDS-BB removal and insertion notifiers to remove or set up, respectively, virtio-scsi's op blockers. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
1b1e0659a4
commit
5b9e0e4693
2 changed files with 65 additions and 0 deletions
|
@ -76,6 +76,13 @@ typedef struct VirtIOSCSICommon {
|
|||
VirtQueue **cmd_vqs;
|
||||
} VirtIOSCSICommon;
|
||||
|
||||
typedef struct VirtIOSCSIBlkChangeNotifier {
|
||||
Notifier n;
|
||||
struct VirtIOSCSI *s;
|
||||
SCSIDevice *sd;
|
||||
QTAILQ_ENTRY(VirtIOSCSIBlkChangeNotifier) next;
|
||||
} VirtIOSCSIBlkChangeNotifier;
|
||||
|
||||
typedef struct VirtIOSCSI {
|
||||
VirtIOSCSICommon parent_obj;
|
||||
|
||||
|
@ -86,6 +93,9 @@ typedef struct VirtIOSCSI {
|
|||
/* Fields for dataplane below */
|
||||
AioContext *ctx; /* one iothread per virtio-scsi-pci for now */
|
||||
|
||||
QTAILQ_HEAD(, VirtIOSCSIBlkChangeNotifier) insert_notifiers;
|
||||
QTAILQ_HEAD(, VirtIOSCSIBlkChangeNotifier) remove_notifiers;
|
||||
|
||||
/* Vring is used instead of vq in dataplane code, because of the underlying
|
||||
* memory layer thread safety */
|
||||
VirtIOSCSIVring *ctrl_vring;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue