From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50758) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2sh6-0005x3-Qw for qemu-devel@nongnu.org; Sat, 18 Aug 2012 19:44:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T2sh5-0003DF-Qf for qemu-devel@nongnu.org; Sat, 18 Aug 2012 19:44:40 -0400 Received: from mail-ob0-f173.google.com ([209.85.214.173]:56591) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2sh5-0003D8-Ls for qemu-devel@nongnu.org; Sat, 18 Aug 2012 19:44:39 -0400 Received: by obbta14 with SMTP id ta14so7116291obb.4 for ; Sat, 18 Aug 2012 16:44:38 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <5030153C.5000005@redhat.com> References: <1345170981-7738-1-git-send-email-ronniesahlberg@gmail.com> <1345170981-7738-3-git-send-email-ronniesahlberg@gmail.com> <50300FF1.7070109@redhat.com> <5030153C.5000005@redhat.com> Date: Sun, 19 Aug 2012 09:44:38 +1000 Message-ID: From: ronnie sahlberg Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [Qemu-devel] [PATCH 2/2] ISCSI: Force scsi-generic for MMC with blank disks List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, qemu-devel@nongnu.org On Sun, Aug 19, 2012 at 8:20 AM, Paolo Bonzini wrote: > Il 19/08/2012 00:02, ronnie sahlberg ha scritto: >> On Sun, Aug 19, 2012 at 7:58 AM, Paolo Bonzini wrote: >>> Il 17/08/2012 04:36, Ronnie Sahlberg ha scritto: >>>> There is no bdrv_* API for the commands for burning a blank MMC disk >>>> so when iSCSI LUNs are specified and the LUN is a MMC device with >>>> 0 available blocks. This is a blank disk so force scsi generic. >>>> >>>> This allows the guest to talk directly to the target to burn data on >>>> the disk. >>>> >>>> Signed-off-by: Ronnie Sahlberg >>> >>> What happens without the patch? It's ok that scsi-{hd,cd} does not >>> work, but do scsi-{block,generic} work without the patch? >>> >> >> Neither of them work, basically because in >> block.c:find_image_format() >> >> if bs->sg is not set in >> >> if (bs->sg || !bdrv_is_inserted(bs)) { >> >> then we continue to >> >> ret = bdrv_pread(bs, 0, buf, sizeof(buf)); >> >> which fails with an error. >> So this patch is basically to prevent find_image_format() from trying >> to read from a blank disk. >> >> Maybe there is a better way to do this? > > Ah, BTW does using -drive ...,format=raw work, or does it hiccup later > again on something else? > format=raw works ! That then begs the question if would it be possible to force format=raw always for iscsi devices? A iscsi device as far as I can see would always just be a raw block device and there would never be a "header" on such devices so maybe that would be a solution? regards ronnie sahlberg