From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43353) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YsBkt-0006xz-8S for qemu-devel@nongnu.org; Tue, 12 May 2015 11:06:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YsBkn-0004Bn-8q for qemu-devel@nongnu.org; Tue, 12 May 2015 11:05:59 -0400 Message-ID: <555216C4.1060604@redhat.com> Date: Tue, 12 May 2015 09:05:40 -0600 From: Eric Blake MIME-Version: 1.0 References: <1431105726-3682-1-git-send-email-kwolf@redhat.com> <1431105726-3682-14-git-send-email-kwolf@redhat.com> In-Reply-To: <1431105726-3682-14-git-send-email-kwolf@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="xpLlRBH9eLvo7SUGNuQsPDxMiRnpX2mWt" Subject: Re: [Qemu-devel] [PATCH 13/34] qemu-io: Add command 'reopen' List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-block@nongnu.org Cc: mreitz@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --xpLlRBH9eLvo7SUGNuQsPDxMiRnpX2mWt Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/08/2015 11:21 AM, Kevin Wolf wrote: > Signed-off-by: Kevin Wolf > --- > qemu-io-cmds.c | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++= ++++++++ > 1 file changed, 71 insertions(+) >=20 > + > + while ((c =3D getopt(argc, argv, "c:o:r")) !=3D EOF) { POSIX says getopt() returns -1 at conclusion, and allows EOF to have a value different than -1. Thus, this could inf-loop on weird platforms (does anyone know such a platform?) But I see you are copying from other bad examples in the file; so I'll post a trivial patch to fix all those in one go. http://pubs.opengroup.org/onlinepubs/9699919799/functions/getopt.html > + switch (c) { > + case 'c': > + if (bdrv_parse_cache_flags(optarg, &flags) < 0) { > + error_report("Invalid cache option: %s", optarg); > + return 0; > + } > + break; > + case 'o': > + if (!qemu_opts_parse(&reopen_opts, optarg, 0)) { > + printf("could not parse option list -- %s\n", optarg);= Messages usually have ':', not ' --', when displaying details about the message on the left. We aren't very consistent on whether to start messages with lower or upper case, so you added one of each :) --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --xpLlRBH9eLvo7SUGNuQsPDxMiRnpX2mWt Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVUhbEAAoJEKeha0olJ0NqqCQH/RfgYYRAAYsml+ApAc5ecXsM P0Wy31XIm4EVd8a93GTwZIEckzuWPM5rYWfZcnDfCRTwcyVGhn1CCWRhy19jTLet JIdlA2Wm+Klm0QZ318clwsgRj+bmxkQJ5juC/hZ893cgMWmZheaMQ8W5UC5xk6/0 zqKbt/wSraaeL9iKaxLZw2mYGuTla7OLYFoEjj6goldUI3BcimqXqF9yIjPuyiVt BjQq8YQOeLwZ8/avQ2eBIFHG4/Fp9n68M1aXjFffDFeAeTHLZAwGVC14882TYtjj bFBfJc740IzEVvwOH+EJ7a1FqXznGLpDmHmTjTot0ZhZ4ENE4LTAumYCjY7xkcg= =qox3 -----END PGP SIGNATURE----- --xpLlRBH9eLvo7SUGNuQsPDxMiRnpX2mWt--