From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51963) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y73N7-0001Pr-Oz for qemu-devel@nongnu.org; Fri, 02 Jan 2015 09:38:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y73N3-0005EO-Kq for qemu-devel@nongnu.org; Fri, 02 Jan 2015 09:38:37 -0500 Received: from mail-wi0-x22f.google.com ([2a00:1450:400c:c05::22f]:35522) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y73N3-0005EI-E5 for qemu-devel@nongnu.org; Fri, 02 Jan 2015 09:38:33 -0500 Received: by mail-wi0-f175.google.com with SMTP id l15so27776182wiw.2 for ; Fri, 02 Jan 2015 06:38:32 -0800 (PST) Date: Fri, 2 Jan 2015 14:38:30 +0000 From: Stefan Hajnoczi Message-ID: <20150102143830.GN10823@stefanha-thinkpad.redhat.com> References: <96FCDECA-CC6E-4E30-A812-40FA3CA78C31@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IoFIGPN1N3g1Ryqz" Content-Disposition: inline In-Reply-To: <96FCDECA-CC6E-4E30-A812-40FA3CA78C31@gmail.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: Programmingkid Cc: Kevin Wolf , Peter Maydell , qemu-devel qemu-devel --IoFIGPN1N3g1Ryqz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Dec 28, 2014 at 04:18:38PM -0500, Programmingkid wrote: Suggestion for concise subject line: block/raw-posix: fix raw_getlength() for host CD-ROMs on Mac > 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 fi= x certain coding style issues. Booting and using a real CD in QEMU works ag= ain.=20 Plain text emails are usually wrapped at 72 characters. It makes it easier to read the git log if you wrap lines. 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. >=20 > signed-off-by: John Arbuckle 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. > 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; Please follow QEMU coding style and use lower_case_with_underscore variable names. > + int ret; No need to shadow the local variable that was already declared at the top of the function. Please drop this. --IoFIGPN1N3g1Ryqz Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJUpq1mAAoJEJykq7OBq3PIvSgH/0RAivoQ8ZKYZ+EDAa0vb3KR F+UdQ8z8Sq7l8jHz1+NdQ8E2XosX8cnRpPoIbvaROHvTrRuQ6IRVknpWRZKwObbT J99FQ++yo38Jg087+t6MFfJTP2a0ty23sG7q9A1yzByKziM+U7K2e+E0SZsJXZwW DAKh7B1UUrdlE9RC4AE2FGsZsJ7JXk7p01wGMKoCdMQDH7NnYv3UY0xt9W29mVEQ P1+uMmyV3WllHub4FSCgn6XZtL1eKgUsLU/tMeZwA5q5uzW4RpCMoWAgQ6qYeQ5E xFsnohpy54BSJ9tKb4ZdR/4awkw+RLGxFUp4GXgmfh9Wa2kvFms3meHgk8QLhkI= =eYs5 -----END PGP SIGNATURE----- --IoFIGPN1N3g1Ryqz--