kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <michael@ellerman.id.au>
To: Asias He <asias.hejun@gmail.com>
Cc: penberg@kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH 2/2] kvm tools: Check for unknown parameters in network option handling
Date: Mon, 13 Aug 2012 13:31:59 +1000	[thread overview]
Message-ID: <1344828719.7376.1.camel@concordia> (raw)
In-Reply-To: <CAFO3S40zuXWoixBm5UH8EO7vi++i9UX3uDZ12hGzarn9uOvQZA@mail.gmail.com>

On Sat, 2012-08-11 at 08:21 +0800, Asias He wrote:
> On Fri, Aug 10, 2012 at 1:38 PM, Michael Ellerman
> <michael@ellerman.id.au> wrote:
> > Currently the parsing of network command line parameters doesn't check
> > for unknown parameters.
> >
> > For example "-n mod=none" will cause kvmtool to setup TAP networking.
> >
> > Save users from their typos by checking for unknown parameters and bailing.
> >
> > Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
> > ---
> >  tools/kvm/builtin-run.c |    3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c
> > index a36bd00..9e5c1d4 100644
> > --- a/tools/kvm/builtin-run.c
> > +++ b/tools/kvm/builtin-run.c
> > @@ -257,7 +257,8 @@ static int set_net_param(struct virtio_net_params *p, const char *param,
> >                 p->vhost = atoi(val);
> >         } else if (strcmp(param, "fd") == 0) {
> >                 p->fd = atoi(val);
> > -       }
> > +       } else
> > +               die("Unknown network parameter %s", param);
> 
> we need braces here:

We don't _need_ braces, but I assume you mean you'd prefer braces?

cheers


  reply	other threads:[~2012-08-13  3:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-10  5:38 [PATCH 1/2] kvm tools: Fix formatting of error message in TAP handling Michael Ellerman
2012-08-10  5:38 ` [PATCH 2/2] kvm tools: Check for unknown parameters in network option handling Michael Ellerman
2012-08-11  0:21   ` Asias He
2012-08-13  3:31     ` Michael Ellerman [this message]
2012-08-13  7:27       ` Pekka Enberg
2012-08-14  1:27         ` Asias He
2012-08-10 23:58 ` [PATCH 1/2] kvm tools: Fix formatting of error message in TAP handling Asias He

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=1344828719.7376.1.camel@concordia \
    --to=michael@ellerman.id.au \
    --cc=asias.hejun@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=penberg@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).