[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [Qemu-devel] [PATCH 13/34] qemu-io: Add command 'reopen
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-block] [Qemu-devel] [PATCH 13/34] qemu-io: Add command 'reopen' |
Date: |
Wed, 13 May 2015 10:37:40 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
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 <address@hidden>
> > ---
> > qemu-io-cmds.c | 71
> > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > 1 file changed, 71 insertions(+)
> >
>
> > +
> > + while ((c = getopt(argc, argv, "c:o:r")) != 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.
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);
>
> 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 :)
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
pgpvVhsoCBVe9.pgp
Description: PGP signature
- Re: [Qemu-block] [Qemu-devel] [PATCH 11/34] block: Allow references for backing files, (continued)
[Qemu-block] [PATCH 13/34] qemu-io: Add command 'reopen', Kevin Wolf, 2015/05/08
[Qemu-block] [PATCH 12/34] block: Allow specifying driver-specific options to reopen, Kevin Wolf, 2015/05/08
[Qemu-block] [PATCH 14/34] qcow2: Factor out qcow2_update_options(), Kevin Wolf, 2015/05/08
Re: [Qemu-block] [PATCH 14/34] qcow2: Factor out qcow2_update_options(), Max Reitz, 2015/05/13
Re: [Qemu-block] [PATCH 14/34] qcow2: Factor out qcow2_update_options(), Max Reitz, 2015/05/13
[Qemu-block] [PATCH 15/34] qcow2: Move qcow2_update_options() call up, Kevin Wolf, 2015/05/08