Received: from eggs.gnu.org ([2001:4830:134:3::10]:35211) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8Q1l-0000iO-Bc for qemu-devel@nongnu.org; Fri, 26 Jun 2015 05:34:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z8Q1i-0001vu-3q for qemu-devel@nongnu.org; Fri, 26 Jun 2015 05:34:29 -0400 Date: Fri, 26 Jun 2015 10:34:22 +0100 From: Stefan Hajnoczi Message-ID: <20150626093422.GE15457@stefanha-thinkpad.redhat.com> References: <3B3C7431-1003-4AAA-90AF-0E1A154DFBE2@gmail.com> <5589A026.5020800@redhat.com> <455CF92B-58FA-446D-9EB0-42661C23B739@gmail.com> <20150625133106.GL4419@stefanha-thinkpad.redhat.com> <831C3655-C8DD-412C-AE88-42AC9B419F0C@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="HeFlAV5LIbMFYYuh" Content-Disposition: inline In-Reply-To: <831C3655-C8DD-412C-AE88-42AC9B419F0C@gmail.com> Subject: Re: [Qemu-devel] [Qemu-block] [PATCH] block.c: fix real cdrom detection List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Programmingkid Cc: Kevin Wolf , Peter Maydell , John Snow , qemu-devel qemu-devel , Qemu-block --HeFlAV5LIbMFYYuh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 25, 2015 at 11:11:24AM -0400, Programmingkid wrote: > On Jun 25, 2015, at 9:31 AM, Stefan Hajnoczi wrote: > > On Tue, Jun 23, 2015 at 02:26:51PM -0400, Programmingkid wrote: > >> On Jun 23, 2015, at 2:06 PM, John Snow wrote: > >>> So what's the issue that this patch attempts to fix and how did you > >>> determine that the fix was needed here? It doesn't look like it respe= cts > >>> proper abstraction at a glance. > >>=20 > >> Without the patch, QEMU would just quit when the "-cdrom /dev/cdrom" o= ption is given. > >=20 > > Why does it quit? >=20 > Because of a bug. This is what it prints: "Could not read image for deter= mining its format: Invalid argument". The bdrv_pread() failure is what need you need to investigate. In the other sub-thread there have been hints about adding CD-ROM passthrough support on Mac OS X by filling in the missing parts in block/raw-posix.c. That should help you get to the bottom of the problem. > This message seems to indicate that QEMU thinks the real cdrom drive is a= n image file.=20 If the -drive format=3D option is not given, QEMU will try to detect the image format. That's the purpose of the find_image_format() function. QEMU does not make a distinction between image files and block devices because there are valid use cases where a block device uses an image format. For example, a disk or partition can contain qcow2 data (there is no partition table or file system, just qcow2). --HeFlAV5LIbMFYYuh Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVjRyeAAoJEJykq7OBq3PI3n4H/R9DnPvEVoMt9xIxWTPC3YEp B00TnpzThmAzt61tqdpTk28EO9POr53hR72ITnTGHgqavJkJUuRs8hz/gKwcVNlr syNgYhlEGL/NoO9Pz+ycRMKT94BP1aMozhgxyuCz0oseZjNuvVqIABvV1mqh3+KA NVEZ8qj/08smKYHonPGYEVeLCOF9vHbxXupNuAYg7MrwJBkFJNf+Zoc6cEvO3x3d K9IpVDsjRJnVPRSaKAvE8um7CS9FI7mnkEnY5g5RXpResD0EUnJ9GLev+x37JthL 4792iPWxDA1SbECHrOBDLb31LrT3h+ynsQNZP/TIjBPGHcfEP7X16DoQD95a7Ps= =FclS -----END PGP SIGNATURE----- --HeFlAV5LIbMFYYuh--