summary refs log tree commit diff stats
path: root/include/hw/virtio/virtio-scsi.h
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2016-01-29 16:36:05 +0100
committerMax Reitz <mreitz@redhat.com>2016-02-02 17:50:46 +0100
commit5b9e0e46935538bf2b24fcb70b65477f758413fd (patch)
tree9a984ae78a463a6bcf57fef3ae92424bb2e5a5d3 /include/hw/virtio/virtio-scsi.h
parent1b1e0659a4c8888fba559e8d41051339e0a3cd8a (diff)
downloadfocaccia-qemu-5b9e0e46935538bf2b24fcb70b65477f758413fd.tar.gz
focaccia-qemu-5b9e0e46935538bf2b24fcb70b65477f758413fd.zip
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>
Diffstat (limited to 'include/hw/virtio/virtio-scsi.h')
-rw-r--r--include/hw/virtio/virtio-scsi.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/hw/virtio/virtio-scsi.h b/include/hw/virtio/virtio-scsi.h
index 088fe9f4b9..0394eb23de 100644
--- a/include/hw/virtio/virtio-scsi.h
+++ b/include/hw/virtio/virtio-scsi.h
@@ -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;