qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Fam Zheng <famz@redhat.com>, qemu-devel@nongnu.org
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 2/2] dataplane: Support VIRTIO_BLK_T_SCSI_CMD
Date: Thu, 22 May 2014 09:04:09 +0200	[thread overview]
Message-ID: <537DA169.1090801@redhat.com> (raw)
In-Reply-To: <1400740589-3655-3-git-send-email-famz@redhat.com>

Il 22/05/2014 08:36, Fam Zheng ha scritto:
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>  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 <pbonzini@redhat.com>

  reply	other threads:[~2014-05-22  7:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-22  6:36 [Qemu-devel] [PATCH 0/2] dataplane: Enable "scsi=on" Fam Zheng
2014-05-22  6:36 ` [Qemu-devel] [PATCH 1/2] virtio-blk: Factor out virtio_blk_handle_scsi_req from virtio_blk_handle_scsi Fam Zheng
2014-05-22  7:03   ` Paolo Bonzini
2014-05-22  7:11     ` Fam Zheng
2014-05-22  6:36 ` [Qemu-devel] [PATCH 2/2] dataplane: Support VIRTIO_BLK_T_SCSI_CMD Fam Zheng
2014-05-22  7:04   ` Paolo Bonzini [this message]
2014-05-22  7:06 ` [Qemu-devel] [PATCH 0/2] dataplane: Enable "scsi=on" Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=537DA169.1090801@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=famz@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).