All of lore.kernel.org
 help / color / mirror / Atom feed
* [Patch] xl: correct vcpu-pin and vcpu-list parameter checking
@ 2010-09-08  7:35 Juergen Gross
  0 siblings, 0 replies; only message in thread
From: Juergen Gross @ 2010-09-08  7:35 UTC (permalink / raw)
  To: xen-devel@lists.xensource.com

[-- Attachment #1: Type: text/plain, Size: 463 bytes --]

Hi,

attached patch corrects parameter checking of vcpu-pin and vcpu-list
sub-commands.

Juergen

-- 
Juergen Gross                 Principal Developer Operating Systems
TSP ES&S SWE OS6                       Telephone: +49 (0) 89 3222 2967
Fujitsu Technology Solutions              e-mail: juergen.gross@ts.fujitsu.com
Domagkstr. 28                           Internet: ts.fujitsu.com
D-80807 Muenchen                 Company details: ts.fujitsu.com/imprint.html

[-- Attachment #2: xl_argc.patch --]
[-- Type: text/x-patch, Size: 1243 bytes --]

diff -r 1831912d4109 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Sep 02 19:12:42 2010 +0100
+++ b/tools/libxl/xl_cmdimpl.c	Wed Sep 08 09:31:01 2010 +0200
@@ -3405,7 +3405,7 @@ int main_vcpulist(int argc, char **argv)
         }
     }
 
-    vcpulist(argc - 2, argv + 2);
+    vcpulist(argc - optind, argv + optind);
     return 0;
 }
 
@@ -3494,22 +3494,23 @@ int main_vcpupin(int argc, char **argv)
 {
     int opt;
 
-    if (argc != 5) {
+    while ((opt = getopt(argc, argv, "h")) != -1) {
+        switch (opt) {
+        case 'h':
+            help("vcpu-pin");
+            return 0;
+        default:
+            fprintf(stderr, "option `%c' not supported.\n", opt);
+            break;
+        }
+    }
+
+    if (optind != argc - 3) {
         help("vcpu-pin");
-        return 0;
-    }
-    while ((opt = getopt(argc, argv, "h")) != -1) {
-        switch (opt) {
-        case 'h':
-            help("vcpu-pin");
-            return 0;
-        default:
-            fprintf(stderr, "option `%c' not supported.\n", opt);
-            break;
-        }
-    }
-
-    vcpupin(argv[2], argv[3] , argv[4]);
+        return 2;
+    }
+
+    vcpupin(argv[optind], argv[optind+1] , argv[optind+2]);
     return 0;
 }
 

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-09-08  7:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-08  7:35 [Patch] xl: correct vcpu-pin and vcpu-list parameter checking Juergen Gross

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.