From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:57244) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2CQK-0002iz-4n for qemu-devel@nongnu.org; Thu, 16 Aug 2012 22:36:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T2CQJ-0005W3-7B for qemu-devel@nongnu.org; Thu, 16 Aug 2012 22:36:32 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:55211) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2CQI-0005Vz-Vz for qemu-devel@nongnu.org; Thu, 16 Aug 2012 22:36:31 -0400 Received: by pbbrp12 with SMTP id rp12so2601939pbb.4 for ; Thu, 16 Aug 2012 19:36:29 -0700 (PDT) From: Ronnie Sahlberg Date: Fri, 17 Aug 2012 12:36:19 +1000 Message-Id: <1345170981-7738-1-git-send-email-ronniesahlberg@gmail.com> Subject: [Qemu-devel] [PATCH] Two trivial patches for iSCSI and blank DVDs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: kwolf@redhat.com, qemu-devel@nongnu.org, pbonzini@redhat.com Kevin, List, Paolo Please find two trivial patches to the iscsi block driver. 1, If the LUN contains a blank disk then the readcapacity10 data will contain a ReturnedLogicalBlockAddress of 0. For this case this does not mean that the device contains one readable block and can be read from. This is a special case for a blank disk that contains no readable blocks at all. This change makes bdrv_getlength()/iscsi_getlength() now rerurn a size of 0 for iSCSI LUNs that contain a blank disk. 2, If the iSCSI LUN contains a blank disk then we can not read or write to it using bdrv_*() functions since there is no bdrv api for writeable mmc devices. For this case with a blank disk force the use of scsi-generic just like we do for tape and mediachanger devices. This allows the guest to talk directly to the target LUN and write to/burn the disk. I have confirmed that dvdrecord -dao -ignsize -overburn dev=/dev/sg1 .iso works from a qemu guest to burn an iSCSI cdrom with these patches. regards ronnie sahlberg