From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36599) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEYRN-0000tN-Uk for qemu-devel@nongnu.org; Mon, 13 Jul 2015 03:46:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZEYRM-0006Nf-Va for qemu-devel@nongnu.org; Mon, 13 Jul 2015 03:46:17 -0400 Date: Mon, 13 Jul 2015 10:46:07 +0300 From: "Michael S. Tsirkin" Message-ID: <20150713104051-mutt-send-email-mst@redhat.com> References: <1436766411-29144-1-git-send-email-jasowang@redhat.com> <1436766411-29144-2-git-send-email-jasowang@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1436766411-29144-2-git-send-email-jasowang@redhat.com> Subject: Re: [Qemu-devel] [PATCH 2/5] virtio-blk: disable scsi passthrough for 1.0 device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jason Wang Cc: Kevin Wolf , qemu-block@nongnu.org, qemu-devel@nongnu.org, Stefan Hajnoczi 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 > Cc: Kevin Wolf > Cc: qemu-block@nongnu.org > Signed-off-by: Jason Wang Interesting, I noticed we have a field scsi - see commit 1ba1f2e319afdcb485963cd3f426fdffd1b725f2 Author: Paolo Bonzini 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? 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. > --- > hw/block/virtio-blk.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > 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); > > if (s->conf.config_wce) { > virtio_add_feature(&features, VIRTIO_BLK_F_CONFIG_WCE); > -- > 2.1.4