summary refs log tree commit diff stats
path: root/hw/scsi/virtio-scsi.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/scsi/virtio-scsi.c')
-rw-r--r--hw/scsi/virtio-scsi.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
index 8547ea0475..a1725b8f48 100644
--- a/hw/scsi/virtio-scsi.c
+++ b/hw/scsi/virtio-scsi.c
@@ -16,6 +16,7 @@
 #include "hw/virtio/virtio-scsi.h"
 #include "qemu/error-report.h"
 #include "qemu/iov.h"
+#include "sysemu/block-backend.h"
 #include <hw/scsi/scsi.h>
 #include <block/scsi.h>
 #include <hw/virtio/virtio-bus.h>
@@ -236,9 +237,9 @@ static int virtio_scsi_do_tmf(VirtIOSCSI *s, VirtIOSCSIReq *req)
     int target;
     int ret = 0;
 
-    if (s->dataplane_started && bdrv_get_aio_context(d->conf.bs) != s->ctx) {
+    if (s->dataplane_started && blk_get_aio_context(d->conf.blk) != s->ctx) {
         aio_context_acquire(s->ctx);
-        bdrv_set_aio_context(d->conf.bs, s->ctx);
+        blk_set_aio_context(d->conf.blk, s->ctx);
         aio_context_release(s->ctx);
     }
     /* Here VIRTIO_SCSI_S_OK means "FUNCTION COMPLETE".  */
@@ -522,9 +523,9 @@ bool virtio_scsi_handle_cmd_req_prepare(VirtIOSCSI *s, VirtIOSCSIReq *req)
         virtio_scsi_complete_cmd_req(req);
         return false;
     }
-    if (s->dataplane_started && bdrv_get_aio_context(d->conf.bs) != s->ctx) {
+    if (s->dataplane_started && blk_get_aio_context(d->conf.blk) != s->ctx) {
         aio_context_acquire(s->ctx);
-        bdrv_set_aio_context(d->conf.bs, s->ctx);
+        blk_set_aio_context(d->conf.blk, s->ctx);
         aio_context_release(s->ctx);
     }
     req->sreq = scsi_req_new(d, req->req.cmd.tag,
@@ -539,7 +540,7 @@ bool virtio_scsi_handle_cmd_req_prepare(VirtIOSCSI *s, VirtIOSCSIReq *req)
         return false;
     }
     scsi_req_ref(req->sreq);
-    bdrv_io_plug(d->conf.bs);
+    blk_io_plug(d->conf.blk);
     return true;
 }
 
@@ -549,7 +550,7 @@ void virtio_scsi_handle_cmd_req_submit(VirtIOSCSI *s, VirtIOSCSIReq *req)
     if (scsi_req_enqueue(sreq)) {
         scsi_req_continue(sreq);
     }
-    bdrv_io_unplug(sreq->dev->conf.bs);
+    blk_io_unplug(sreq->dev->conf.blk);
     scsi_req_unref(sreq);
 }
 
@@ -832,7 +833,7 @@ static void virtio_scsi_migration_state_changed(Notifier *notifier, void *data)
         if (s->dataplane_started) {
             return;
         }
-        bdrv_drain_all(); /* complete in-flight non-dataplane requests */
+        blk_drain_all(); /* complete in-flight non-dataplane requests */
         s->dataplane_disabled = false;
     }
 }