On Fri, Jul 24, 2015 at 3:22 PM, Stefan Hajnoczi <stefa...@gmail.com> wrote: > On Mon, Jul 20, 2015 at 5:17 PM, Programmingkid > <programmingk...@gmail.com> wrote: >> >> On Jul 20, 2015, at 8:46 AM, Laurent Vivier wrote: >> >>> -----BEGIN PGP SIGNED MESSAGE----- >>> Hash: SHA1 >>> >>> >>> >>> On 20/07/2015 12:48, Stefan Hajnoczi wrote: >>>> On Fri, Jul 17, 2015 at 03:24:34PM -0400, Programmingkid wrote: >>>>> >>>>> On Jul 17, 2015, at 9:41 AM, Stefan Hajnoczi wrote: >>>>> >>>>>> On Thu, Jul 16, 2015 at 04:46:07PM -0400, Programmingkid >>>>>> wrote: >>>>>>> @@ -2014,7 +2015,9 @@ kern_return_t GetBSDPath( io_iterator_t >>>>>>> mediaIterator, char *bsdPath, CFIndex ma if ( >>>>>>> bsdPathAsCFString ) { size_t devPathLength; strcpy( bsdPath, >>>>>>> _PATH_DEV ); - strcat( bsdPath, "r" ); + >>>>>>> if (flags & BDRV_O_NOCACHE) { + >>>>>>> strcat(bsdPath, "r"); + } devPathLength = strlen( >>>>>>> bsdPath ); if ( CFStringGetCString( bsdPathAsCFString, >>>>>>> bsdPath + devPathLength, maxPathSize - devPathLength, >>>>>>> kCFStringEncodingASCII ) ) { kernResult = KERN_SUCCESS; >>>>>> >>>>>> Is this the fix that makes CD-ROM passthrough work for you? >>>>>> >>>>>> Does the guest boot successfully when you do: >>>>>> >>>>>> -drive if=ide,media=cdrom,cache=none,file=/dev/cdrom >>>>> >>>>> The guest fails during the boot process with the above command >>>>> line. >>>> >>>> That means the issue you originally hit hasn't been solved yet. >>>> >>>> Take a look at s->needs_alignment and raw_probe_alignment(). In >>>> the -drive cache=none case raw-posix needs to detect the correct >>>> alignment (probably 2 KB for CD-ROMs). >>> >>> As raw_open_common() sets needs_alignment to true on BDRV_O_NOCACHE >>> (cache="none") and raw_probe_alignment() detects alignment if >>> needs_alignment is true, I don't understand why it doesn't work. >>> >>> Could you explain ? >> >> >> I just did several tests with real CD-ROM discs and it does work. I first >> booted up Mac OS 10.2 with Stefan's command options using a professionally >> made CD, and it worked. I then did the same test again using a burned CD-R >> disc and it also worked. The last test I did was just listing the files from >> OpenBIOS using this: qemu-system-ppc -drive >> if=ide,media=cdrom,cache=none,file=/dev/cdrom. All tests were a success. >> >> Mac OS 10.2 panicked while booting in the original test using Stefan's >> command. I remember the panic happened about a minute into the boot process, >> so it could have been a guest issue rather than a QEMU issue. Either way >> everything is working now. > > I don't see what your patch changed to make -drive > if=ide,media=cdrom,cache=none,file=/dev/cdrom work?
Sorry for the confusion, I understand now. When you said the guest fails, I thought you meant that bdrv_read() is still failing and the guest won't boot. But you meant that the guest kernel paniced (which is fine, not necessarily a CD-ROM problem). Laurent's comment also clarifies that the BDRV_O_NOCACHE enables probing, and therefore bdrv_read() will work correctly! So I'm satisfied with why cache=none works now. Thanks, Stefan