qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexandre Bique <alexandre.bique@citrix.com>
To: qemu-devel@nongnu.org
Cc: Alexandre Bique <alexandre.bique@citrix.com>
Subject: [Qemu-devel] [PATCH 3/7] atapi: guessing if the cdrom device is a scsi device.
Date: Fri, 7 Aug 2009 18:33:08 +0100	[thread overview]
Message-ID: <1249666392-31905-4-git-send-email-alexandre.bique@citrix.com> (raw)
In-Reply-To: <1249666392-31905-3-git-send-email-alexandre.bique@citrix.com>

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 <alexandre.bique@citrix.com>
---
 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.6.4

  reply	other threads:[~2009-08-07 17:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-07 17:33 [Qemu-devel] ATAPI pass throug v4 Alexandre Bique
2009-08-07 17:33 ` [Qemu-devel] [PATCH 1/7] atapi: fix up a few comments Alexandre Bique
2009-08-07 17:33   ` [Qemu-devel] [PATCH 2/7] atapi: protocol define updates Alexandre Bique
2009-08-07 17:33     ` Alexandre Bique [this message]
2009-08-07 17:33       ` [Qemu-devel] [PATCH 4/7] atapi: adds header guards to hw/pcmia.h Alexandre Bique
2009-08-07 17:33         ` [Qemu-devel] [PATCH 5/7] atapi: adds header guards to hw/mac_dbdma.h Alexandre Bique
2009-08-07 17:33           ` [Qemu-devel] [PATCH 6/7] atapi: made some part of ide.c public and moved some part to atapi Alexandre Bique
2009-08-07 17:33             ` [Qemu-devel] [PATCH 7/7] atapi: introducing atapi pass through Alexandre Bique
2009-08-10 20:09 ` [Qemu-devel] ATAPI pass throug v4 Anthony Liguori
     [not found] <<19074.63829.151234.423348@mariner.uk.xensource.com>
2009-08-11 15:36 ` [Qemu-devel] [PATCH 3/7] atapi: guessing if the cdrom device is a scsi device Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1249666392-31905-4-git-send-email-alexandre.bique@citrix.com \
    --to=alexandre.bique@citrix.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).