Received: from eggs.gnu.org ([2001:4830:134:3::10]:33630) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEcSI-0006o1-GK for qemu-devel@nongnu.org; Mon, 13 Jul 2015 08:03:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZEcSF-0005G3-UZ for qemu-devel@nongnu.org; Mon, 13 Jul 2015 08:03:30 -0400 Received: from e06smtp17.uk.ibm.com ([195.75.94.113]:60713) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEcSF-0005F2-M1 for qemu-devel@nongnu.org; Mon, 13 Jul 2015 08:03:27 -0400 Received: from /spool/local by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 13 Jul 2015 13:03:22 +0100 Date: Mon, 13 Jul 2015 13:51:56 +0200 From: Cornelia Huck Message-ID: <20150713135156.0d32ef1e.cornelia.huck@de.ibm.com> In-Reply-To: <20150713095651.GA5893@noname.redhat.com> References: <1436766411-29144-1-git-send-email-jasowang@redhat.com> <1436766411-29144-2-git-send-email-jasowang@redhat.com> <20150713104051-mutt-send-email-mst@redhat.com> <55A37E43.6060403@redhat.com> <20150713095651.GA5893@noname.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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: Kevin Wolf Cc: Jason Wang , qemu-block@nongnu.org, qemu-devel@nongnu.org, Stefan Hajnoczi , "Michael S. Tsirkin" On Mon, 13 Jul 2015 11:56:51 +0200 Kevin Wolf wrote: > 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 > > >> 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? > > > > 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. Hm, I wonder how this plays with transports that want to make the virtio-1 vs. legacy decision post-init? For virtio-ccw, I basically only want to offer VERSION_1 if the driver negotiated revision >= 1. I'd need to check for !scsi as well before I can add this feature bit then? Have the init function set a blocker for VERSION_1 so that the driver may only negotiate revision 0?