All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>,
	qemu-devel@nongnu.org, qemu-block@nongnu.org,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 2/5] virtio-blk: disable scsi passthrough for 1.0 device
Date: Mon, 13 Jul 2015 11:56:51 +0200	[thread overview]
Message-ID: <20150713095651.GA5893@noname.redhat.com> (raw)
In-Reply-To: <55A37E43.6060403@redhat.com>

Am 13.07.2015 um 11:00 hat Jason Wang geschrieben:
> 
> 
> On 07/13/2015 03:46 PM, Michael S. Tsirkin wrote:
> > On Mon, Jul 13, 2015 at 01:46:48PM +0800, Jason Wang wrote:
> >> VIRTIO_BLK_F_SCSI was no longer supported in 1.0. So disable it.
> >>
> >> Cc: Stefan Hajnoczi <stefanha@redhat.com>
> >> Cc: Kevin Wolf <kwolf@redhat.com>
> >> Cc: qemu-block@nongnu.org
> >> Signed-off-by: Jason Wang <jasowang@redhat.com>
> > Interesting, I noticed we have a field scsi - see
> > 	commit 1ba1f2e319afdcb485963cd3f426fdffd1b725f2
> > 	Author: Paolo Bonzini <pbonzini@redhat.com>
> > 	Date:   Fri Dec 23 15:39:03 2011 +0100
> >
> > 	    virtio-blk: refuse SG_IO requests with scsi=off
> >
> > but it doesn't seem to be propagated to guest features in
> > any way.
> >
> > Maybe we should fix that, making that flag AutoOnOff?
> 
> Looks ok but auto may need some compat work since default is true.
> 
> > Then, if user explicitly requested scsi=on with a modern
> > interface then we can error out cleanly.
> >
> > Given scsi flag is currently ignored, I think
> > this can be a patch on top.
> 
> Looks like virtio_blk_handle_scsi_req() check this:
> 
>     if (!blk->conf.scsi) {
>         status = VIRTIO_BLK_S_UNSUPP;
>         goto fail;
>     }

So we should be checking the same condition for the feature flag and
error out in the init function if we have a VERSION_1 device and
blk->conf.scsi is set.

> >> diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
> >> index 6aefda4..f30ad25 100644
> >> --- a/hw/block/virtio-blk.c
> >> +++ b/hw/block/virtio-blk.c
> >> @@ -730,7 +730,8 @@ static uint64_t virtio_blk_get_features(VirtIODevice *vdev, uint64_t features)
> >>      virtio_add_feature(&features, VIRTIO_BLK_F_GEOMETRY);
> >>      virtio_add_feature(&features, VIRTIO_BLK_F_TOPOLOGY);
> >>      virtio_add_feature(&features, VIRTIO_BLK_F_BLK_SIZE);
> >> -    virtio_add_feature(&features, VIRTIO_BLK_F_SCSI);
> >> +    if (!__virtio_has_feature(features, VIRTIO_F_VERSION_1))
> >> +        virtio_add_feature(&features, VIRTIO_BLK_F_SCSI);

Coding style: Braces are needed here. (Same in the other patch you CCed
me on).

Kevin

  reply	other threads:[~2015-07-13  9:57 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-13  5:46 [Qemu-devel] [PATCH 1/5] virtio-pci: ignore unaligned read/write in virtio_address_space_read()/write() Jason Wang
2015-07-13  5:46 ` [Qemu-devel] [PATCH 2/5] virtio-blk: disable scsi passthrough for 1.0 device Jason Wang
2015-07-13  7:46   ` Michael S. Tsirkin
2015-07-13  9:00     ` Jason Wang
2015-07-13  9:56       ` Kevin Wolf [this message]
2015-07-13 11:51         ` Cornelia Huck
2015-07-13 12:22           ` Michael S. Tsirkin
2015-07-13 12:30             ` Cornelia Huck
2015-07-13 12:36               ` Michael S. Tsirkin
2015-07-13 13:20                 ` Cornelia Huck
2015-07-13 14:34                   ` Paolo Bonzini
2015-07-13 14:41                     ` Cornelia Huck
2015-07-13 15:13                       ` Paolo Bonzini
2015-07-13 15:35                   ` Michael S. Tsirkin
2015-07-14 17:43                     ` Cornelia Huck
2015-07-15 10:59                       ` Michael S. Tsirkin
2015-07-15 11:46                         ` Cornelia Huck
2015-07-15 12:01                           ` Michael S. Tsirkin
2015-07-15 12:43                             ` Cornelia Huck
2015-07-15 13:16                               ` Michael S. Tsirkin
2015-07-15 13:40                                 ` Cornelia Huck
2015-07-15 14:11                                   ` Michael S. Tsirkin
2015-07-15 14:30                                     ` Cornelia Huck
2015-07-15 14:39                                       ` Michael S. Tsirkin
2015-07-15 15:38                                         ` Cornelia Huck
2015-07-15 18:51                                           ` Michael S. Tsirkin
2015-07-16 12:37                                             ` Cornelia Huck
2015-07-16 12:47                                               ` Michael S. Tsirkin
2015-07-16 17:22                                                 ` Paolo Bonzini
2015-07-17  7:18                                                   ` Cornelia Huck
2015-07-13 11:27       ` Michael S. Tsirkin
2015-07-13  5:46 ` [Qemu-devel] [PATCH 3/5] virtio-blk: set VIRTIO_F_ANY_LAYOUT when 1.0 is supported Jason Wang
2015-07-13  5:46 ` [Qemu-devel] [PATCH 4/5] Revert "virtio-net: enable virtio 1.0" Jason Wang
2015-07-13  6:16   ` Cornelia Huck
2015-07-13  7:22     ` Michael S. Tsirkin
2015-07-13  8:46       ` Cornelia Huck
2015-07-13  8:29     ` Jason Wang
2015-07-13  5:46 ` [Qemu-devel] [PATCH 5/5] virtio-net: unbreak any layout Jason Wang
2015-07-13  6:50   ` Paolo Bonzini
2015-07-13  8:30     ` Jason Wang
2015-07-13  7:24   ` Michael S. Tsirkin
2015-07-13  8:22     ` Michael S. Tsirkin
2015-07-13 10:54       ` Greg Kurz
2015-07-13 11:13         ` Michael S. Tsirkin
2015-07-13  8:30     ` Jason Wang
2015-07-13  7:36 ` [Qemu-devel] [PATCH 1/5] virtio-pci: ignore unaligned read/write in virtio_address_space_read()/write() Michael S. Tsirkin
2015-07-13  7:53   ` Gerd Hoffmann
2015-07-13  8:00     ` Michael S. Tsirkin
2015-07-13  8:39       ` Gerd Hoffmann
2015-07-13  8:37   ` Jason Wang

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=20150713095651.GA5893@noname.redhat.com \
    --to=kwolf@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-block@nongnu.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.