All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Xen-devel <xen-devel@lists.xensource.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [PATCH 1/3] xl: fix network-attach command line parsing
Date: Wed, 02 Jun 2010 16:09:48 -0700	[thread overview]
Message-ID: <4C06E4BC.9090708@goop.org> (raw)

Command line arguments start at argv[2].

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>

diff -r 8e9db04e9d40 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Tue Jun 01 15:19:38 2010 -0700
+++ b/tools/libxl/xl_cmdimpl.c	Wed Jun 02 11:34:39 2010 -0700
@@ -3308,11 +3308,11 @@
     int i;
     unsigned int val;
 
-    if ((argc < 2) || (argc > 11)) {
+    if ((argc < 3) || (argc > 11)) {
         help("network-attach");
         exit(0);
     }
-    while ((opt = getopt(argc, argv, "hl")) != -1) {
+    while ((opt = getopt(argc, argv, "h")) != -1) {
         switch (opt) {
         case 'h':
             help("network-attach");
@@ -3323,12 +3323,12 @@
         }
     }
 
-    if (domain_qualifier_to_domid(argv[1], &domid, 0) < 0) {
-        fprintf(stderr, "%s is an invalid domain identifier\n", argv[1]);
+    if (domain_qualifier_to_domid(argv[2], &domid, 0) < 0) {
+        fprintf(stderr, "%s is an invalid domain identifier\n", argv[2]);
         exit(1);
     }
     init_nic_info(&nic, -1);
-    for (argv += 2, argc -= 2; argc > 0; ++argv, --argc) {
+    for (argv += 3, argc -= 3; argc > 0; ++argv, --argc) {
         if (!strncmp("type=", *argv, 5)) {
             if (!strncmp("vif", (*argv) + 5, 4)) {
                 nic.nictype = NICTYPE_VIF;

                 reply	other threads:[~2010-06-02 23:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4C06E4BC.9090708@goop.org \
    --to=jeremy@goop.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /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.