All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-trivial@nongnu.org, peter.maydell@linaro.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-trivial] [PATCH for-1.4 v2 6/6] vl: Exit unsuccessfully on option argument syntax error
Date: Fri, 8 Feb 2013 16:00:58 -0200	[thread overview]
Message-ID: <20130208160058.1988648f@redhat.com> (raw)
In-Reply-To: <1360340232-4670-7-git-send-email-armbru@redhat.com>

On Fri,  8 Feb 2013 17:17:12 +0100
Markus Armbruster <armbru@redhat.com> wrote:

> We exit successfully after reporting syntax error for argument of
> --sandbox and --add-fd.
> 
> We continue undaunted after reporting it for argument of --option-rom
> and --object then.
> 
> Change all four to exit unsuccessfully, like the other options.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>

What about qemu_opts_parse() call in QEMU_OPTION_boot?

> ---
>  vl.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/vl.c b/vl.c
> index 73122d8..4245ccc 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -3623,6 +3623,9 @@ int main(int argc, char **argv, char **envp)
>  		    exit(1);
>  		}
>                  opts = qemu_opts_parse(qemu_find_opts("option-rom"), optarg, 1);
> +                if (!opts) {
> +                    exit(1);
> +                }
>                  option_rom[nb_option_roms].name = qemu_opt_get(opts, "romfile");
>                  option_rom[nb_option_roms].bootindex =
>                      qemu_opt_get_number(opts, "bootindex", -1);
> @@ -3780,14 +3783,14 @@ int main(int argc, char **argv, char **envp)
>              case QEMU_OPTION_sandbox:
>                  opts = qemu_opts_parse(qemu_find_opts("sandbox"), optarg, 1);
>                  if (!opts) {
> -                    exit(0);
> +                    exit(1);
>                  }
>                  break;
>              case QEMU_OPTION_add_fd:
>  #ifndef _WIN32
>                  opts = qemu_opts_parse(qemu_find_opts("add-fd"), optarg, 0);
>                  if (!opts) {
> -                    exit(0);
> +                    exit(1);
>                  }
>  #else
>                  error_report("File descriptor passing is disabled on this "
> @@ -3797,6 +3800,9 @@ int main(int argc, char **argv, char **envp)
>                  break;
>              case QEMU_OPTION_object:
>                  opts = qemu_opts_parse(qemu_find_opts("object"), optarg, 1);
> +                if (!opts) {
> +                    exit(1);
> +                }
>                  break;
>              default:
>                  os_parse_cmd_args(popt->index, optarg);



  reply	other threads:[~2013-02-08 18:14 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-08 16:17 [Qemu-trivial] [PATCH for-1.4 v2 0/6] Error reporting fixes Markus Armbruster
2013-02-08 16:17 ` [Qemu-trivial] [PATCH for-1.4 v2 1/6] error: Clean up error strings with embedded newlines Markus Armbruster
2013-02-08 17:41   ` Luiz Capitulino
2013-02-08 18:56     ` Markus Armbruster
2013-02-08 19:13       ` Luiz Capitulino
2013-02-08 19:48         ` Markus Armbruster
2013-02-13 19:28           ` Luiz Capitulino
2013-02-08 16:17 ` [Qemu-trivial] [PATCH for-1.4 v2 2/6] error: Clean up abuse of error_report() for help Markus Armbruster
2013-02-08 16:17 ` [Qemu-trivial] [PATCH for-1.4 v2 3/6] error: Strip trailing '\n' from error string arguments (again) Markus Armbruster
2013-02-08 17:45   ` Luiz Capitulino
2013-02-08 16:17 ` [Qemu-trivial] [PATCH for-1.4 v2 4/6] qemu-option: Disable two helpful messages that got broken recently Markus Armbruster
2013-02-08 17:53   ` Luiz Capitulino
2013-02-08 18:58     ` Markus Armbruster
2013-02-08 19:16       ` Luiz Capitulino
2013-02-08 19:34         ` Markus Armbruster
2013-02-13 19:20           ` Luiz Capitulino
2013-02-08 16:17 ` [Qemu-trivial] [PATCH for-1.4 v2 5/6] vl: Drop redundant "parse error" reports Markus Armbruster
2013-02-08 17:54   ` Luiz Capitulino
2013-02-08 16:17 ` [Qemu-trivial] [PATCH for-1.4 v2 6/6] vl: Exit unsuccessfully on option argument syntax error Markus Armbruster
2013-02-08 18:00   ` Luiz Capitulino [this message]
2013-02-08 18:30     ` Markus Armbruster
2013-02-08 18:59 ` [Qemu-trivial] [PATCH for-1.4 v2 0/6] Error reporting fixes Markus Armbruster
2013-02-08 19:16   ` Luiz Capitulino

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130208160058.1988648f@redhat.com \
    --to=lcapitulino@redhat.com \
    --cc=armbru@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.