diff options
author | Fam Zheng <famz@redhat.com> | 2014-05-22 16:22:43 +0800 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2014-06-04 09:56:12 +0200 |
commit | c9f87b20b996b1005b646281195d61412ba2b844 (patch) | |
tree | 28b0cdb1960f7b3bb5e9ffea54a563eeb3b2aed0 | |
parent | 5a05cbeeaaa2ec463d48c0026e8e6be243ea0bab (diff) | |
download | qemu-c9f87b20b996b1005b646281195d61412ba2b844.zip qemu-c9f87b20b996b1005b646281195d61412ba2b844.tar.gz qemu-c9f87b20b996b1005b646281195d61412ba2b844.tar.bz2 |
dataplane: Support VIRTIO_BLK_T_SCSI_CMD
Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
-rw-r--r-- | hw/block/dataplane/virtio-blk.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c index 217992b..c10b7b7 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. */ |