[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 13/34] qemu-io: Add command 'reopen'
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 13/34] qemu-io: Add command 'reopen' |
Date: |
Tue, 12 May 2015 09:05:40 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 |
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.
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 :)
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH 07/34] block: Move flag inheritance to bdrv_open_inherited(), (continued)
- [Qemu-devel] [PATCH 08/34] block: Add list of children to BlockDriverState, Kevin Wolf, 2015/05/08
- [Qemu-devel] [PATCH 11/34] block: Allow references for backing files, Kevin Wolf, 2015/05/08
- [Qemu-devel] [PATCH 13/34] qemu-io: Add command 'reopen', Kevin Wolf, 2015/05/08
- [Qemu-devel] [PATCH 12/34] block: Allow specifying driver-specific options to reopen, Kevin Wolf, 2015/05/08
- [Qemu-devel] [PATCH 14/34] qcow2: Factor out qcow2_update_options(), Kevin Wolf, 2015/05/08
- Re: [Qemu-devel] [PATCH 14/34] qcow2: Factor out qcow2_update_options(), Max Reitz, 2015/05/13
- Re: [Qemu-devel] [PATCH 14/34] qcow2: Factor out qcow2_update_options(), Max Reitz, 2015/05/13