[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/2] ISCSI: Force scsi-generic for MMC with blank di
From: |
Ronnie Sahlberg |
Subject: |
[Qemu-devel] [PATCH 2/2] ISCSI: Force scsi-generic for MMC with blank disks |
Date: |
Fri, 17 Aug 2012 12:36:21 +1000 |
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 <address@hidden>
---
block/iscsi.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/block/iscsi.c b/block/iscsi.c
index fb420ea..ca53afa 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -1017,10 +1017,19 @@ static int iscsi_open(BlockDriverState *bs, const char
*filename, int flags)
/* Medium changer or tape. 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.
+ * MMC device with no blocks contain a blank disk so force them to use sg
+ * too.
*/
- if (iscsilun->type == TYPE_MEDIUM_CHANGER ||
- iscsilun->type == TYPE_TAPE) {
+ switch (iscsilun->type) {
+ case TYPE_ROM:
+ if (iscsilun->num_blocks > 0) {
+ break;
+ }
+ case TYPE_MEDIUM_CHANGER:
+ case TYPE_TAPE:
bs->sg = 1;
+ default:
+ break;
}
ret = 0;
--
1.7.3.1
- [Qemu-devel] [PATCH] Two trivial patches for iSCSI and blank DVDs, Ronnie Sahlberg, 2012/08/16
- [Qemu-devel] [PATCH 1/2] ISCSI: Set number of blocks to 0 for blank CDROM devices, Ronnie Sahlberg, 2012/08/16
- [Qemu-devel] [PATCH 2/2] ISCSI: Force scsi-generic for MMC with blank disks,
Ronnie Sahlberg <=
- Re: [Qemu-devel] [PATCH 2/2] ISCSI: Force scsi-generic for MMC with blank disks, Blue Swirl, 2012/08/18
- Re: [Qemu-devel] [PATCH 2/2] ISCSI: Force scsi-generic for MMC with blank disks, Paolo Bonzini, 2012/08/18
- Re: [Qemu-devel] [PATCH 2/2] ISCSI: Force scsi-generic for MMC with blank disks, ronnie sahlberg, 2012/08/18
- Re: [Qemu-devel] [PATCH 2/2] ISCSI: Force scsi-generic for MMC with blank disks, ronnie sahlberg, 2012/08/18
- Re: [Qemu-devel] [PATCH 2/2] ISCSI: Force scsi-generic for MMC with blank disks, Paolo Bonzini, 2012/08/18
- Re: [Qemu-devel] [PATCH 2/2] ISCSI: Force scsi-generic for MMC with blank disks, ronnie sahlberg, 2012/08/18
- Re: [Qemu-devel] [PATCH 2/2] ISCSI: Force scsi-generic for MMC with blank disks, Paolo Bonzini, 2012/08/18
- Re: [Qemu-devel] [PATCH 2/2] ISCSI: Force scsi-generic for MMC with blank disks, Paolo Bonzini, 2012/08/18
- Re: [Qemu-devel] [PATCH 2/2] ISCSI: Force scsi-generic for MMC with blank disks, ronnie sahlberg, 2012/08/18
- Re: [Qemu-devel] [PATCH 2/2] ISCSI: Force scsi-generic for MMC with blank disks, Paolo Bonzini, 2012/08/19