From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37317) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YsSAo-000327-2G for qemu-devel@nongnu.org; Wed, 13 May 2015 04:37:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YsSAn-0002di-2q for qemu-devel@nongnu.org; Wed, 13 May 2015 04:37:49 -0400 Date: Wed, 13 May 2015 10:37:40 +0200 From: Kevin Wolf Message-ID: <20150513083740.GB4263@noname.str.redhat.com> References: <1431105726-3682-1-git-send-email-kwolf@redhat.com> <1431105726-3682-14-git-send-email-kwolf@redhat.com> <555216C4.1060604@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3V7upXqbjpZ4EhLz" Content-Disposition: inline In-Reply-To: <555216C4.1060604@redhat.com> 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: Eric Blake Cc: mreitz@redhat.com, qemu-devel@nongnu.org, qemu-block@nongnu.org, armbru@redhat.com --3V7upXqbjpZ4EhLz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Am 12.05.2015 um 17:05 hat Eric Blake geschrieben: > 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 >=20 > > + > > + while ((c =3D getopt(argc, argv, "c:o:r")) !=3D EOF) { >=20 > 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. Thanks. And yes, almost everything in this patch is just copied from elsewhere. > > + 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); >=20 > Messages usually have ':', not ' --', when displaying details about the > message on the left. >=20 > We aren't very consistent on whether to start messages with lower or > upper case, so you added one of each :) Indeed. Copied from open_f() in qemu-io.c, Max is to blame. :-) I'll add a patch fixing qemu-io.c first to use upper case, colon and error_report() and then do the same here. Kevin --3V7upXqbjpZ4EhLz Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJVUw1UAAoJEH8JsnLIjy/WG1QP/2aD9xtS8oDb0NI4UpuVElNb hYOlRe4BGmRUyTYKQfyCNOIOrWnZdcdi8mfDAneKsSqA1pmN4bjNfaMFaYnQ/AKC FAIcC699Q4cxiczdvN6eWefiyjYwQfzJwBT20SYOE8mL9+0Gn5gTNkU/8HO4e6pY tffsBGI5N24xYkkCvPgDtDpE9SrJpiAA4Sw29XogQEcsvBcycgFbHtqZiOTFsLmg 8zoSTFU01mb3BAMg3v0+LMYMmkGgituo8anfk+oy3R5vX7zDazJQivH1MWjy/bi/ exXArmXEdL22xGNVbwUowvqFQaWnikRQTOuWO/7ntzWVelQO/2as2Uu3zrE4YF5F Pa2GWfq/oC4FXFkADKtdFLMXrGMZwWUSy1aFala3WjpAZLk8rakSJIFdL4PRRPdq TlqPhyPS/dcRnt6bszpFhwSsSQ/CjYZX6wgSz1u/ZSfE9uymoaW8zmP2pGA+8shP MITqnYROaxzbc/QQlmUBItGCK2rvUH0a2QNfAbGo6qJxqyHFWlnRHONq5hmNok1r 8zpmVAqZ0zwpyQjoAtrS8efMd7y8nsGV1fVz5XWQl/tGPK/PHVnbrPw1m6ALmZO6 nVUzwk3zJ3MyGkzagbgL5ZqpCFozptISBcq5E6epE5ELfmMJrezKKlY2BKknqx5V 3Ji1fWWd09gN4thPTC13 =W/hi -----END PGP SIGNATURE----- --3V7upXqbjpZ4EhLz--