From patchwork Mon Jun 10 15:15:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 250259 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 892232C008F for ; Tue, 11 Jun 2013 01:16:02 +1000 (EST) Received: from localhost ([::1]:45992 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Um3pA-0002S6-Bn for incoming@patchwork.ozlabs.org; Mon, 10 Jun 2013 11:16:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45606) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Um3of-0002Rl-Gr for qemu-devel@nongnu.org; Mon, 10 Jun 2013 11:15:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Um3oe-0000V2-6Z for qemu-devel@nongnu.org; Mon, 10 Jun 2013 11:15:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52856) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Um3od-0000Uo-Ud for qemu-devel@nongnu.org; Mon, 10 Jun 2013 11:15:28 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r5AFFQ9g030028 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 10 Jun 2013 11:15:26 -0400 Received: from dhcp-200-207.str.redhat.com (dhcp-192-246.str.redhat.com [10.33.192.246]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r5AFFOZh008774; Mon, 10 Jun 2013 11:15:25 -0400 Date: Mon, 10 Jun 2013 17:15:24 +0200 From: Kevin Wolf To: Andreas =?iso-8859-1?Q?F=E4rber?= Message-ID: <20130610151524.GM3636@dhcp-200-207.str.redhat.com> References: <4E830D81-854D-4697-9BCC-4C51D852D132@gmail.com> <12387A41-C7DA-474B-AB20-820779E8FDC2@suse.de> <069A6C85-FB1D-4B86-BC98-5BA2455A0135@gmail.com> <51B5D777.8060104@suse.de> <51B5E13B.4030907@suse.de> <20130610143355.GK3636@dhcp-200-207.str.redhat.com> <51B5E69D.8000002@suse.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <51B5E69D.8000002@suse.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id r5AFFQ9g030028 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: "qemu-devel@nongnu.org" , Stefan Hajnoczi , Alexander Graf , Programmingkid Subject: Re: [Qemu-devel] [Qemu-ppc] real cdrom access failure X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 )