[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 3/7] atapi: guessing if the cdrom device is a scsi d
From: |
Ian Jackson |
Subject: |
[Qemu-devel] [PATCH 3/7] atapi: guessing if the cdrom device is a scsi device. |
Date: |
Tue, 11 Aug 2009 16:36:21 +0100 |
ATAPI pass through code is enabled when the block device is a scsi
device. So we have to guess if the block device is a scsi device in
cdrom_open().
Signed-off-by: Alexandre Bique <address@hidden>
---
block/raw-posix.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/block/raw-posix.c b/block/raw-posix.c
index bdee07f..ebb13d4 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -1305,6 +1305,14 @@ static int cdrom_open(BlockDriverState *bs, const char
*filename, int flags)
s->type = FTYPE_CD;
/* open will not fail even if no CD is inserted, so add O_NONBLOCK */
+#if defined(__linux__) && defined(CONFIG_AIO)
+ if (strstart(filename, "/dev/sg", NULL) ||
+ strstart(filename, "/dev/cd", NULL) ||
+ strstart(filename, "/dev/dvd", NULL) ||
+ strstart(filename, "/dev/sr", NULL)) {
+ bs->sg = 1;
+ }
+#endif
return raw_open_common(bs, filename, flags, O_NONBLOCK);
}
--
1.4.4.4
- [Qemu-devel] [PATCH 0/7] ATAPI CDROM passthrough v5, Ian Jackson, 2009/08/12
- [Qemu-devel] [PATCH 3/7] atapi: guessing if the cdrom device is a scsi device.,
Ian Jackson <=
- [Qemu-devel] [PATCH 1/7] atapi: fix up a few comments, Ian Jackson, 2009/08/12
- [Qemu-devel] [PATCH 2/7] atapi: protocol define updates, Ian Jackson, 2009/08/12
- [Qemu-devel] [PATCH 4/7] atapi: adds header guards to hw/pcmia.h, Ian Jackson, 2009/08/12
- [Qemu-devel] [PATCH 5/7] atapi: adds header guards to hw/mac_dbdma.h, Ian Jackson, 2009/08/12
- [Qemu-devel] [PATCH 7/7] atapi: introducing atapi pass through, Ian Jackson, 2009/08/12
- [Qemu-devel] [PATCH 6/7] atapi: made some part of ide.c public and moved some part to atapi., Ian Jackson, 2009/08/12
- [Qemu-devel] Re: [PATCH 0/7] ATAPI CDROM passthrough v5, Ian Jackson, 2009/08/12
- Re: [Qemu-devel] [PATCH 0/7] ATAPI CDROM passthrough v5, Christoph Hellwig, 2009/08/12
- Re: [Qemu-devel] [PATCH 0/7] ATAPI CDROM passthrough v5, Anthony Liguori, 2009/08/24