* Re: [Qemu-devel] [Qemu-ppc] real cdrom access failure
[not found] ` <069A6C85-FB1D-4B86-BC98-5BA2455A0135@gmail.com>
@ 2013-06-10 13:41 ` Alexander Graf
2013-06-10 14:22 ` Andreas Färber
0 siblings, 1 reply; 5+ messages in thread
From: Alexander Graf @ 2013-06-10 13:41 UTC (permalink / raw)
To: Programmingkid; +Cc: qemu-devel@nongnu.org, Andreas Färber
On 06/10/2013 03:39 PM, Programmingkid wrote:
> On Jun 9, 2013, at 12:34 PM, Alexander Graf wrote:
>
>> On 09.06.2013, at 18:28, Programmingkid wrote:
>>
>>> I am trying to access the cdrom drive in QEMU 1.5.0, but can't. This is the error I see: qemu-system-ppc: -cdrom /dev/cdrom: could not open disk image /dev/cdrom: No such file or directory. I think this is a bug with version 1.5.0 on Mac OS X. Anybody else notice this problem?
>> Mac OS X doesn't provide a /dev/cdrom link. You have to point it directly to the target device. To get a list of available devices, try
>>
>> $ diskutil list
>>
>> Also make sure that all partitions and file systems on top of the CD-ROM are unmounted (diskutil unmount or just umount), as OSX won't allow direct access to /dev/disk1 otherwise.
>>
>>
>> Alex
>>
>
> The -cdrom /dev/cdrom option always worked in the past. Just not with version 1.5.0.
Hrm. CC'ing Andreas and Peter. They're the best matches to people
knowing their way around OSX host support :). Also Changing qemu-ppc@ to
qemu-devel@, as this is 100% unrelated to the ppc target.
Alex
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] real cdrom access failure
2013-06-10 13:41 ` [Qemu-devel] [Qemu-ppc] real cdrom access failure Alexander Graf
@ 2013-06-10 14:22 ` Andreas Färber
2013-06-10 14:33 ` Kevin Wolf
0 siblings, 1 reply; 5+ messages in thread
From: Andreas Färber @ 2013-06-10 14:22 UTC (permalink / raw)
To: Kevin Wolf, Stefan Hajnoczi
Cc: Programmingkid, Alexander Graf, qemu-devel@nongnu.org
Am 10.06.2013 15:41, schrieb Alexander Graf:
> On 06/10/2013 03:39 PM, Programmingkid wrote:
>> On Jun 9, 2013, at 12:34 PM, Alexander Graf wrote:
>>
>>> On 09.06.2013, at 18:28, Programmingkid wrote:
>>>
>>>> I am trying to access the cdrom drive in QEMU 1.5.0, but can't. This
>>>> is the error I see: qemu-system-ppc: -cdrom /dev/cdrom: could not
>>>> open disk image /dev/cdrom: No such file or directory. I think this
>>>> is a bug with version 1.5.0 on Mac OS X. Anybody else notice this
>>>> problem?
>>> Mac OS X doesn't provide a /dev/cdrom link. You have to point it
>>> directly to the target device. To get a list of available devices, try
>>>
>>> $ diskutil list
>>>
>>> Also make sure that all partitions and file systems on top of the
>>> CD-ROM are unmounted (diskutil unmount or just umount), as OSX won't
>>> allow direct access to /dev/disk1 otherwise.
>>>
>>>
>>> Alex
>>>
>>
>> The -cdrom /dev/cdrom option always worked in the past. Just not with
>> version 1.5.0.
>
> Hrm. CC'ing Andreas and Peter. They're the best matches to people
> knowing their way around OSX host support :).
The translation of /dev/cdrom happens in block/raw-posix.c:hdev_open().
For v1.5.0 a filename parameter was dropped from the block API, so
currently the Mac OS X code is changing the local variable so the
modified filename variable never makes it into the QDict *options. :/
Andreas
> Also Changing qemu-ppc@ to
> qemu-devel@, as this is 100% unrelated to the ppc target.
>
>
> Alex
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] real cdrom access failure
2013-06-10 14:22 ` Andreas Färber
@ 2013-06-10 14:33 ` Kevin Wolf
2013-06-10 14:45 ` Andreas Färber
0 siblings, 1 reply; 5+ messages in thread
From: Kevin Wolf @ 2013-06-10 14:33 UTC (permalink / raw)
To: Andreas Färber
Cc: qemu-devel@nongnu.org, Stefan Hajnoczi, Alexander Graf,
Programmingkid
Am 10.06.2013 um 16:22 hat Andreas Färber geschrieben:
> Am 10.06.2013 15:41, schrieb Alexander Graf:
> > On 06/10/2013 03:39 PM, Programmingkid wrote:
> >> On Jun 9, 2013, at 12:34 PM, Alexander Graf wrote:
> >>
> >>> On 09.06.2013, at 18:28, Programmingkid wrote:
> >>>
> >>>> I am trying to access the cdrom drive in QEMU 1.5.0, but can't. This
> >>>> is the error I see: qemu-system-ppc: -cdrom /dev/cdrom: could not
> >>>> open disk image /dev/cdrom: No such file or directory. I think this
> >>>> is a bug with version 1.5.0 on Mac OS X. Anybody else notice this
> >>>> problem?
> >>> Mac OS X doesn't provide a /dev/cdrom link. You have to point it
> >>> directly to the target device. To get a list of available devices, try
> >>>
> >>> $ diskutil list
> >>>
> >>> Also make sure that all partitions and file systems on top of the
> >>> CD-ROM are unmounted (diskutil unmount or just umount), as OSX won't
> >>> allow direct access to /dev/disk1 otherwise.
> >>>
> >>>
> >>> Alex
> >>>
> >>
> >> The -cdrom /dev/cdrom option always worked in the past. Just not with
> >> version 1.5.0.
> >
> > Hrm. CC'ing Andreas and Peter. They're the best matches to people
> > knowing their way around OSX host support :).
>
> The translation of /dev/cdrom happens in block/raw-posix.c:hdev_open().
>
> For v1.5.0 a filename parameter was dropped from the block API, so
> currently the Mac OS X code is changing the local variable so the
> modified filename variable never makes it into the QDict *options. :/
Oh nice, magic filenames. Whoever thought this was a good idea...
It's easy enough to fix, just put the string back to the QDict in the
end. It feels wrong to do something like this, but if we have been doing
it before, I guess we must keep doing so.
Kevin
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] real cdrom access failure
2013-06-10 14:33 ` Kevin Wolf
@ 2013-06-10 14:45 ` Andreas Färber
2013-06-10 15:15 ` Kevin Wolf
0 siblings, 1 reply; 5+ messages in thread
From: Andreas Färber @ 2013-06-10 14:45 UTC (permalink / raw)
To: Kevin Wolf
Cc: qemu-devel@nongnu.org, Stefan Hajnoczi, Alexander Graf,
Programmingkid
Am 10.06.2013 16:33, schrieb Kevin Wolf:
> Am 10.06.2013 um 16:22 hat Andreas Färber geschrieben:
>> Am 10.06.2013 15:41, schrieb Alexander Graf:
>>> On 06/10/2013 03:39 PM, Programmingkid wrote:
>>>> On Jun 9, 2013, at 12:34 PM, Alexander Graf wrote:
>>>>> On 09.06.2013, at 18:28, Programmingkid wrote:
>>>>>
>>>>>> I am trying to access the cdrom drive in QEMU 1.5.0, but can't. This
>>>>>> is the error I see: qemu-system-ppc: -cdrom /dev/cdrom: could not
>>>>>> open disk image /dev/cdrom: No such file or directory. I think this
>>>>>> is a bug with version 1.5.0 on Mac OS X. Anybody else notice this
>>>>>> problem?
>>>>> Mac OS X doesn't provide a /dev/cdrom link. You have to point it
>>>>> directly to the target device. To get a list of available devices, try
>>>>>
>>>>> $ diskutil list
>>>>>
>>>>> Also make sure that all partitions and file systems on top of the
>>>>> CD-ROM are unmounted (diskutil unmount or just umount), as OSX won't
>>>>> allow direct access to /dev/disk1 otherwise.
>>>>
>>>> The -cdrom /dev/cdrom option always worked in the past. Just not with
>>>> version 1.5.0.
>>>
>>> Hrm. CC'ing Andreas and Peter. They're the best matches to people
>>> knowing their way around OSX host support :).
>>
>> The translation of /dev/cdrom happens in block/raw-posix.c:hdev_open().
>>
>> For v1.5.0 a filename parameter was dropped from the block API, so
>> currently the Mac OS X code is changing the local variable so the
>> modified filename variable never makes it into the QDict *options. :/
>
> Oh nice, magic filenames. Whoever thought this was a good idea...
>
> It's easy enough to fix, just put the string back to the QDict in the
> end. It feels wrong to do something like this, but if we have been doing
> it before, I guess we must keep doing so.
block.c: * Detect host devices. By convention, /dev/cdrom[N] is always
block/raw-posix.c: if (strstart(filename, "/dev/cdrom", NULL))
block/raw-posix.c: if (strstart(filename, "/dev/cdrom", NULL)) {
block/raw-win32.c: if (strstart(filename, "/dev/cdrom", NULL))
block/raw-win32.c: if (strstart(filename, "/dev/cdrom", NULL)) {
I happened to know about this issue because we have similar downstream
block drivers that need to translate the filename and broke with v1.5.
I'll look into fixing this if no one beats me to it. We'll probably need
a g_strdup() since bsdPath[] is on the stack.
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] real cdrom access failure
2013-06-10 14:45 ` Andreas Färber
@ 2013-06-10 15:15 ` Kevin Wolf
0 siblings, 0 replies; 5+ messages in thread
From: Kevin Wolf @ 2013-06-10 15:15 UTC (permalink / raw)
To: Andreas Färber
Cc: qemu-devel@nongnu.org, Stefan Hajnoczi, Alexander Graf,
Programmingkid
Am 10.06.2013 um 16:45 hat Andreas Färber geschrieben:
> Am 10.06.2013 16:33, schrieb Kevin Wolf:
> > Am 10.06.2013 um 16:22 hat Andreas Färber geschrieben:
> >> Am 10.06.2013 15:41, schrieb Alexander Graf:
> >>> On 06/10/2013 03:39 PM, Programmingkid wrote:
> >>>> On Jun 9, 2013, at 12:34 PM, Alexander Graf wrote:
> >>>>> On 09.06.2013, at 18:28, Programmingkid wrote:
> >>>>>
> >>>>>> I am trying to access the cdrom drive in QEMU 1.5.0, but can't. This
> >>>>>> is the error I see: qemu-system-ppc: -cdrom /dev/cdrom: could not
> >>>>>> open disk image /dev/cdrom: No such file or directory. I think this
> >>>>>> is a bug with version 1.5.0 on Mac OS X. Anybody else notice this
> >>>>>> problem?
> >>>>> Mac OS X doesn't provide a /dev/cdrom link. You have to point it
> >>>>> directly to the target device. To get a list of available devices, try
> >>>>>
> >>>>> $ diskutil list
> >>>>>
> >>>>> Also make sure that all partitions and file systems on top of the
> >>>>> CD-ROM are unmounted (diskutil unmount or just umount), as OSX won't
> >>>>> allow direct access to /dev/disk1 otherwise.
> >>>>
> >>>> The -cdrom /dev/cdrom option always worked in the past. Just not with
> >>>> version 1.5.0.
> >>>
> >>> Hrm. CC'ing Andreas and Peter. They're the best matches to people
> >>> knowing their way around OSX host support :).
> >>
> >> The translation of /dev/cdrom happens in block/raw-posix.c:hdev_open().
> >>
> >> For v1.5.0 a filename parameter was dropped from the block API, so
> >> currently the Mac OS X code is changing the local variable so the
> >> modified filename variable never makes it into the QDict *options. :/
> >
> > Oh nice, magic filenames. Whoever thought this was a good idea...
> >
> > It's easy enough to fix, just put the string back to the QDict in the
> > end. It feels wrong to do something like this, but if we have been doing
> > it before, I guess we must keep doing so.
>
> block.c: * Detect host devices. By convention, /dev/cdrom[N] is always
> block/raw-posix.c: if (strstart(filename, "/dev/cdrom", NULL))
> block/raw-posix.c: if (strstart(filename, "/dev/cdrom", NULL)) {
> block/raw-win32.c: if (strstart(filename, "/dev/cdrom", NULL))
> block/raw-win32.c: if (strstart(filename, "/dev/cdrom", NULL)) {
>
> I happened to know about this issue because we have similar downstream
> block drivers that need to translate the filename and broke with v1.5.
>
> I'll look into fixing this if no one beats me to it. We'll probably need
> a g_strdup() since bsdPath[] is on the stack.
Not necessary, qstring_from_str() creates a copy anyway. I can't test
it, but does the following work for you?
Kevin
diff --git a/block/raw-posix.c b/block/raw-posix.c
index c0ccf27..90ce9f8 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -1350,6 +1350,7 @@ static int hdev_open(BlockDriverState *bs, QDict *options, int flags)
qemu_close(fd);
}
filename = bsdPath;
+ qdict_put(options, "filename", qstring_from_str(filename));
}
if ( mediaIterator )
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-06-10 15:15 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <mailman.30226.1370762837.22519.qemu-ppc@nongnu.org>
[not found] ` <4E830D81-854D-4697-9BCC-4C51D852D132@gmail.com>
[not found] ` <12387A41-C7DA-474B-AB20-820779E8FDC2@suse.de>
[not found] ` <069A6C85-FB1D-4B86-BC98-5BA2455A0135@gmail.com>
2013-06-10 13:41 ` [Qemu-devel] [Qemu-ppc] real cdrom access failure Alexander Graf
2013-06-10 14:22 ` Andreas Färber
2013-06-10 14:33 ` Kevin Wolf
2013-06-10 14:45 ` Andreas Färber
2013-06-10 15:15 ` Kevin Wolf
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).