Received: from eggs.gnu.org ([2001:4830:134:3::10]:45661) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y75OD-0002Dd-S8 for qemu-devel@nongnu.org; Fri, 02 Jan 2015 11:47:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y75OA-0004XD-JG for qemu-devel@nongnu.org; Fri, 02 Jan 2015 11:47:53 -0500 Received: from mail-qa0-x22d.google.com ([2607:f8b0:400d:c00::22d]:62076) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y75OA-0004WW-FK for qemu-devel@nongnu.org; Fri, 02 Jan 2015 11:47:50 -0500 Received: by mail-qa0-f45.google.com with SMTP id f12so11471068qad.32 for ; Fri, 02 Jan 2015 08:47:49 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Programmingkid In-Reply-To: <20150102143830.GN10823@stefanha-thinkpad.redhat.com> Date: Fri, 2 Jan 2015 11:47:46 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <2F302FFC-B4D9-430F-B340-0268DCA134F5@gmail.com> References: <96FCDECA-CC6E-4E30-A812-40FA3CA78C31@gmail.com> <20150102143830.GN10823@stefanha-thinkpad.redhat.com> Subject: Re: [Qemu-devel] [PATCH v3] block/raw-posix.c: Fixes raw_getlength() on Mac OS X so that it reports the correct length of a real CD List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel qemu-devel On Jan 2, 2015, at 9:38 AM, Stefan Hajnoczi wrote: > On Sun, Dec 28, 2014 at 04:18:38PM -0500, Programmingkid wrote: >=20 > Suggestion for concise subject line: >=20 > block/raw-posix: fix raw_getlength() for host CD-ROMs on Mac >=20 >> This patch fixes the problem with raw_getlength() on Mac OS X so that = it actually calculates the correct size of a volume. It has been updated = to fix certain coding style issues. Booting and using a real CD in QEMU = works again.=20 >=20 > Plain text emails are usually wrapped at 72 characters. It makes it > easier to read the git log if you wrap lines. On my email program, the lines just wrap at the width of the window they = are in.=20 Maybe there is a feature in your email program to wrap lines. >=20 > Good job braving the nasty nest of #ifdefs in raw_getlength() :). The > code change looks good. Minor changes below - normally I'd make them > while merging your patch but I don't compile QEMU on Mac so I can't > compile test it. Please send a new version of this patch. Thank you for the kind remarks. I can't believe some of the code in that = file was=20 actually committed. I think someone should remove most of the #ifdefs = and=20 pretty up the file. I would probably do something like = mac_raw_getlength(),=20 windows_raw_getlength(), linux_raw_getlength(), sun_raw_getlength()... Then just use the correct function for the host.=20 >=20 >>=20 >> signed-off-by: John Arbuckle >=20 > Not sure if tags are case-sensistive but it is usually written as > "Signed-off-by:". The git -s option does this for you, that's usually > more convenient than typing it out manually. Ok, that will be easy to fix. >=20 >> diff --git a/block/raw-posix.c b/block/raw-posix.c >> index e51293a..a090c9c 100644 >> --- a/block/raw-posix.c >> +++ b/block/raw-posix.c >> @@ -1312,7 +1312,24 @@ again: >> if (size =3D=3D 0) >> #endif >> #if defined(__APPLE__) && defined(__MACH__) >> - size =3D LLONG_MAX; >> + { >> + uint64_t sectors =3D 0; >> + uint32_t sectorSize =3D 0; >=20 > Please follow QEMU coding style and use lower_case_with_underscore > variable names. Fixed. >=20 >> + int ret; >=20 > No need to shadow the local variable that was already declared at the > top of the function. Please drop this. Done. Thank you for reviewing my patch.