From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59995) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnN3A-0007oL-N1 for qemu-devel@nongnu.org; Thu, 22 May 2014 03:04:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WnN31-00078b-KD for qemu-devel@nongnu.org; Thu, 22 May 2014 03:04:24 -0400 Received: from mail-ee0-x234.google.com ([2a00:1450:4013:c00::234]:49445) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnN31-00078R-DL for qemu-devel@nongnu.org; Thu, 22 May 2014 03:04:15 -0400 Received: by mail-ee0-f52.google.com with SMTP id e53so2288230eek.11 for ; Thu, 22 May 2014 00:04:14 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <537DA169.1090801@redhat.com> Date: Thu, 22 May 2014 09:04:09 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1400740589-3655-1-git-send-email-famz@redhat.com> <1400740589-3655-3-git-send-email-famz@redhat.com> In-Reply-To: <1400740589-3655-3-git-send-email-famz@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/2] dataplane: Support VIRTIO_BLK_T_SCSI_CMD List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , qemu-devel@nongnu.org Cc: Stefan Hajnoczi Il 22/05/2014 08:36, Fam Zheng ha scritto: > Signed-off-by: Fam Zheng > --- > hw/block/dataplane/virtio-blk.c | 19 +++++++++++-------- > 1 file changed, 11 insertions(+), 8 deletions(-) > > diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c > index 46a6824..6a66196 100644 > --- a/hw/block/dataplane/virtio-blk.c > +++ b/hw/block/dataplane/virtio-blk.c > @@ -201,6 +201,16 @@ 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(s->blk->conf.bs, elem); > + complete_request_early(s, elem, inhdr, status); > + > +} > + > static int process_request(VirtIOBlockDataPlane *s, VirtQueueElement *elem) > { > struct iovec *iov = elem->out_sg; > @@ -249,8 +259,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: > @@ -326,12 +335,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. > */ > Reviewed-by: Paolo Bonzini