[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 21/27] block: Assume raw for drives without media
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 21/27] block: Assume raw for drives without media |
Date: |
Fri, 4 Jun 2010 18:33:09 +0200 |
qemu -cdrom /dev/cdrom with an empty CD-ROM drive doesn't work any more because
we try to guess the format and when this fails (because there is no medium) we
exit with an error message.
This patch should restore the old behaviour by assuming raw format for such
drives.
Signed-off-by: Kevin Wolf <address@hidden>
---
block.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/block.c b/block.c
index 9c43332..ecd9867 100644
--- a/block.c
+++ b/block.c
@@ -331,8 +331,8 @@ static BlockDriver *find_image_format(const char *filename)
if (ret < 0)
return NULL;
- /* Return the raw BlockDriver * to scsi-generic devices */
- if (bs->sg) {
+ /* Return the raw BlockDriver * to scsi-generic devices or empty drives */
+ if (bs->sg || !bdrv_is_inserted(bs)) {
bdrv_delete(bs);
return bdrv_find_format("raw");
}
--
1.6.6.1
- [Qemu-devel] [PATCH 09/27] ide: Remove useless IDEDeviceInfo members unit, drive, (continued)
- [Qemu-devel] [PATCH 09/27] ide: Remove useless IDEDeviceInfo members unit, drive, Kevin Wolf, 2010/06/04
- [Qemu-devel] [PATCH 17/27] ide: Fix info qtree for ide-drive.ver, Kevin Wolf, 2010/06/04
- [Qemu-devel] [PATCH 18/27] scsi: Turn drive serial into a qdev property scsi-disk.serial, Kevin Wolf, 2010/06/04
- [Qemu-devel] [PATCH 19/27] scsi: Fix info qtree for scsi-disk.ver, Kevin Wolf, 2010/06/04
- [Qemu-devel] [PATCH 27/27] block: Fix serial number assignment, Kevin Wolf, 2010/06/04
- [Qemu-devel] [PATCH 20/27] Fix error message in drive_init, Kevin Wolf, 2010/06/04
- [Qemu-devel] [PATCH 24/27] blockdev: Hide QEMUMachine from drive_init(), Kevin Wolf, 2010/06/04
- [Qemu-devel] [PATCH 23/27] block: call the snapshot handlers of the protocol drivers, Kevin Wolf, 2010/06/04
- [Qemu-devel] [PATCH 25/27] qdev: Move declaration of qdev_init_bdrv() into qdev.h, Kevin Wolf, 2010/06/04
- [Qemu-devel] [PATCH 22/27] close all the block drivers before the qemu process exits, Kevin Wolf, 2010/06/04
- [Qemu-devel] [PATCH 21/27] block: Assume raw for drives without media,
Kevin Wolf <=
- [Qemu-devel] [PATCH 26/27] blockdev: Collect block device code in new blockdev.c, Kevin Wolf, 2010/06/04