qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] cdrom disc type - is this patch correct? (unbreaks recent FreeBSD guest's -cdrom access)
@ 2007-11-13 21:22 Juergen Lock
  2007-11-14 12:02 ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Juergen Lock @ 2007-11-13 21:22 UTC (permalink / raw)
  To: qemu-devel

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;
                     buf[3] = 0;
                     buf[4] = 0;
                     buf[5] = 0;
@@ -1347,7 +1351,7 @@
 
                     buf[8] = 0x2a;
                     buf[9] = 0x12;
-                    buf[10] = 0x00;
+                    buf[10] = 0x08;
                     buf[11] = 0x00;
                     
                     buf[12] = 0x70;

 Thanx,
	Juergen

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-11-19  9:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2007-11-18 23:37   ` Juergen Lock
2007-11-19  9:21     ` Jens Axboe

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).