From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47590) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SYBYo-0006wx-Q8 for qemu-devel@nongnu.org; Sat, 26 May 2012 03:37:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SYBYn-0004kK-6i for qemu-devel@nongnu.org; Sat, 26 May 2012 03:37:14 -0400 Received: from plane.gmane.org ([80.91.229.3]:43164) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SYBYm-0004k6-Vi for qemu-devel@nongnu.org; Sat, 26 May 2012 03:37:13 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SYBYi-0002RH-E2 for qemu-devel@nongnu.org; Sat, 26 May 2012 09:37:08 +0200 Received: from 93-34-182-16.ip50.fastwebnet.it ([93.34.182.16]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 26 May 2012 09:37:08 +0200 Received: from pbonzini by 93-34-182-16.ip50.fastwebnet.it with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 26 May 2012 09:37:08 +0200 From: Paolo Bonzini Date: Sat, 26 May 2012 09:36:55 +0200 Message-ID: References: <1338008201-29078-1-git-send-email-ronniesahlberg@gmail.com> <1338008201-29078-5-git-send-email-ronniesahlberg@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit In-Reply-To: <1338008201-29078-5-git-send-email-ronniesahlberg@gmail.com> Subject: Re: [Qemu-devel] [PATCH 4/4] ISCSI: If the device we open is a SMC device, then force the use of sg. We dont have any medium changer emulation so only passthrough via real sg or scsi-generic via iscsi would work anyway. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Il 26/05/2012 06:56, Ronnie Sahlberg ha scritto: > Forcing sg also makes qemu skip trying to read from the device to guess the image format by reading from the device (find_image_format()). > SMC devices do not implement READ6/10/12/16 so it is noit possible to read from them. > > With this patch I can successfully manage a SMC device wiht iscsi in passthrough mode. > > Signed-off-by: Ronnie Sahlberg > --- > block/iscsi.c | 9 +++++++++ > 1 files changed, 9 insertions(+), 0 deletions(-) > > diff --git a/block/iscsi.c b/block/iscsi.c > index a015a52..9ce38b5 100644 > --- a/block/iscsi.c > +++ b/block/iscsi.c > @@ -1032,6 +1032,15 @@ static int iscsi_open(BlockDriverState *bs, const char *filename, int flags) > if (iscsi_url != NULL) { > iscsi_destroy_url(iscsi_url); > } > + > + /* Medium changer. We dont have any emulation for this so this must > + be sg ioctl compatible. We force it to be sg, otherwise qemu will try > + to read from the device to guess the image format. > + */ > + if (iscsilun->type == TYPE_MEDIUM_CHANGER) { > + bs->sg = 1; > + } > + > return 0; > > failed: Modified to also do the same for tapes, applied to scsi-next branch for 1.2. Paolo