aboutsummaryrefslogtreecommitdiff
path: root/hw/block/dataplane/virtio-blk.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/block/dataplane/virtio-blk.c')
-rw-r--r--hw/block/dataplane/virtio-blk.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c
index 217992b666..c10b7b70fb 100644
--- a/hw/block/dataplane/virtio-blk.c
+++ b/hw/block/dataplane/virtio-blk.c
@@ -204,6 +204,15 @@ static void do_flush_cmd(VirtIOBlockDataPlane *s, VirtQueueElement *elem,
bdrv_aio_flush(s->blk->conf.bs, complete_flush, req);
}
+static void do_scsi_cmd(VirtIOBlockDataPlane *s, VirtQueueElement *elem,
+ QEMUIOVector *inhdr)
+{
+ int status;
+
+ status = virtio_blk_handle_scsi_req(VIRTIO_BLK(s->vdev), elem);
+ complete_request_early(s, elem, inhdr, status);
+}
+
static int process_request(VirtIOBlockDataPlane *s, VirtQueueElement *elem)
{
struct iovec *iov = elem->out_sg;
@@ -252,8 +261,7 @@ static int process_request(VirtIOBlockDataPlane *s, VirtQueueElement *elem)
return 0;
case VIRTIO_BLK_T_SCSI_CMD:
- /* TODO support SCSI commands */
- complete_request_early(s, elem, inhdr, VIRTIO_BLK_S_UNSUPP);
+ do_scsi_cmd(s, elem, inhdr);
return 0;
case VIRTIO_BLK_T_FLUSH:
@@ -330,12 +338,6 @@ void virtio_blk_data_plane_create(VirtIODevice *vdev, VirtIOBlkConf *blk,
return;
}
- if (blk->scsi) {
- error_setg(errp,
- "device is incompatible with x-data-plane, use scsi=off");
- return;
- }
-
/* If dataplane is (re-)enabled while the guest is running there could be
* block jobs that can conflict.
*/