From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:45412) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2rhn-0007bj-IH for qemu-devel@nongnu.org; Sat, 18 Aug 2012 18:41:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T2rhm-0004JB-OX for qemu-devel@nongnu.org; Sat, 18 Aug 2012 18:41:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58483) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2rhm-0004J3-Gl for qemu-devel@nongnu.org; Sat, 18 Aug 2012 18:41:18 -0400 Message-ID: <50301A09.2060503@redhat.com> Date: Sun, 19 Aug 2012 00:41:13 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1345170981-7738-1-git-send-email-ronniesahlberg@gmail.com> <1345170981-7738-3-git-send-email-ronniesahlberg@gmail.com> <50300FF1.7070109@redhat.com> <50301431.6090904@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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: ronnie sahlberg Cc: kwolf@redhat.com, qemu-devel@nongnu.org Il 19/08/2012 00:19, ronnie sahlberg ha scritto: >> > Yeah, I think in this case find_image_format should just use raw. > Ok, so that is basically what the patch does. It forces bs->sg==true > so that we pick "raw" right there instead of trying to read from the > device. > > So you are happy with the patch ? No, the solution should be the same that allows "touch ff + qemu-kvm -hda ff" to work. This is implemented here: if (ret >= 0 && ret < aiocb->aio_nbytes && aiocb->common.bs->growable) { /* A short read means that we have reached EOF. Pad the buffer * with zeros for bytes after EOF. */ iov_memset(aiocb->aio_iov, aiocb->aio_niov, ret, 0, aiocb->aio_nbytes - ret); ret = aiocb->aio_nbytes; } and block/iscsi.c should do the same. Paolo