Received: from eggs.gnu.org ([2001:4830:134:3::10]:55047) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8Vtm-0007OC-9b for qemu-devel@nongnu.org; Fri, 26 Jun 2015 11:50:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z8Vti-0002wu-74 for qemu-devel@nongnu.org; Fri, 26 Jun 2015 11:50:38 -0400 Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Programmingkid In-Reply-To: <20150626093422.GE15457@stefanha-thinkpad.redhat.com> Date: Fri, 26 Jun 2015 11:50:31 -0400 Content-Transfer-Encoding: quoted-printable Message-Id: <0B891055-9551-41F9-8BA7-70455CDA7AAB@gmail.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> <20150626093422.GE15457@stefanha-thinkpad.redhat.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: Stefan Hajnoczi Cc: Kevin Wolf , Peter Maydell , John Snow , qemu-devel qemu-devel , Qemu-block On Jun 26, 2015, at 5:34 AM, Stefan Hajnoczi wrote: > 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 = respects >>>>> proper abstraction at a glance. >>>>=20 >>>> Without the patch, QEMU would just quit when the "-cdrom = /dev/cdrom" option is given. >>>=20 >>> Why does it quit? >>=20 >> Because of a bug. This is what it prints: "Could not read image for = determining its format: Invalid argument". >=20 > 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. >=20 >> This message seems to indicate that QEMU thinks the real cdrom drive = is an image file.=20 >=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. >=20 > 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). So what you are saying is if the user enters "-cdrom /dev/cdrom", QEMU = is suppose to call find_image_format. If everything goes right, the = first if statement should be skipped. Then the bdrv_pread() function = should succeed and so should the bdrv_probe_all() function. Is that how = it is suppose to work?