From: Jens Axboe <qemu@kernel.dk>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] cdrom disc type - is this patch correct? (unbreaks recent FreeBSD guest's -cdrom access)
Date: Wed, 14 Nov 2007 13:02:04 +0100 [thread overview]
Message-ID: <20071114120203.GD5064@kernel.dk> (raw)
In-Reply-To: <20071113212248.GA18957@saturn.kn-bremen.de>
On Tue, Nov 13 2007, Juergen Lock wrote:
> Hi!
>
> Yesterday I learned that FreeBSD 7.0-BETA2 guests will no longer
> read from the emulated cd drive, apparently because of this commit:
> http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/dev/ata/atapi-cd.c.diff?r1=1.193;r2=1.193.2.1
> The following patch file added to the qemu-devel port fixes the issue
> for me, is it also correct? (making the guest see a dvd in the drive
> when it is inserted, previously it saw the drive as empty.)
>
> The second hunk is already in qemu cvs so remove it if you want to
> test on that. ISO used for testing:
> ftp://ftp.freebsd.org:/pub/FreeBSD/ISO-IMAGES-i386/7.0/7.0-BETA2-i386-disc1.iso
> (test by either selecting fixit->cdrom or by trying to install, just
> booting it will always work because that goes thru the bios.)
>
> Index: qemu/hw/ide.c
> @@ -1339,6 +1341,8 @@
> case 0x2a:
> cpu_to_ube16(&buf[0], 28 + 6);
> buf[2] = 0x70;
> + if (bdrv_is_inserted(s->bs))
> + buf[2] = 0x40;
medium type code has been obsoleted since at least 1999. Looking back at
even older docs, 0x70 is 'door closed, no disc present'. 0x40 is a
reserved value though, I would not suggest using that. Given that
freebsd breaks, my suggest change would be the below - keep the 0x70 for
when no disc is really inserted, but don't set anything if there is.
diff --git a/hw/ide.c b/hw/ide.c
index 5f76c27..52d4c78 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -1344,7 +1344,10 @@ static void ide_atapi_cmd(IDEState *s)
break;
case 0x2a:
cpu_to_ube16(&buf[0], 28 + 6);
- buf[2] = 0x70;
+ if (!bdrv_is_inserted(s->bs))
+ buf[2] = 0x70;
+ else
+ buf[2] = 0;
buf[3] = 0;
buf[4] = 0;
buf[5] = 0;
--
Jens Axboe
next prev parent reply other threads:[~2007-11-14 12:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-13 21:22 [Qemu-devel] cdrom disc type - is this patch correct? (unbreaks recent FreeBSD guest's -cdrom access) Juergen Lock
2007-11-14 12:02 ` Jens Axboe [this message]
2007-11-18 23:37 ` Juergen Lock
2007-11-19 9:21 ` Jens Axboe
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=20071114120203.GD5064@kernel.dk \
--to=qemu@kernel.dk \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.