WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] xl: correct vcpu-pin and vcpu-list parame

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xl: correct vcpu-pin and vcpu-list parameter checking
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 09 Oct 2010 14:55:26 -0700
Delivery-date: Sat, 09 Oct 2010 15:07:05 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Juergen Gross <juergen.gross@xxxxxxxxxxxxxx>
# Date 1284658166 -3600
# Node ID d978675f3d53d48273eae0739d01b806ea9f1068
# Parent  4e47a7db9711818048ea2dd0d111286e8bcf1249
xl: correct vcpu-pin and vcpu-list parameter checking

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

Signed-off-by: Juergen Gross <juergen.gross@xxxxxxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 tools/libxl/xl_cmdimpl.c |   61 +++++++++++++++++++++++------------------------
 1 files changed, 31 insertions(+), 30 deletions(-)

diff -r 4e47a7db9711 -r d978675f3d53 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Thu Sep 16 18:02:40 2010 +0100
+++ b/tools/libxl/xl_cmdimpl.c  Thu Sep 16 18:29:26 2010 +0100
@@ -3402,7 +3402,7 @@ int main_vcpulist(int argc, char **argv)
         }
     }
 
-    vcpulist(argc - 2, argv + 2);
+    vcpulist(argc - optind, argv + optind);
     return 0;
 }
 
@@ -3491,22 +3491,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;
 }
 
@@ -3535,22 +3536,22 @@ int main_vcpuset(int argc, char **argv)
 {
     int opt;
 
-    if (argc != 4) {
+    while ((opt = getopt(argc, argv, "h")) != -1) {
+        switch (opt) {
+        case 'h':
         help("vcpu-set");
-        return 0;
-    }
-    while ((opt = getopt(argc, argv, "h")) != -1) {
-        switch (opt) {
-        case 'h':
+            return 0;
+        default:
+            fprintf(stderr, "option `%c' not supported.\n", opt);
+            break;
+        }
+    }
+
+    if (optind >= argc - 1) {
         help("vcpu-set");
-            return 0;
-        default:
-            fprintf(stderr, "option `%c' not supported.\n", opt);
-            break;
-        }
-    }
-
-    vcpuset(argv[2], argv[3]);
+        return 2;
+    }
+    vcpuset(argv[optind], argv[optind+1]);
     return 0;
 }
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xl: correct vcpu-pin and vcpu-list parameter checking, Xen patchbot-unstable <=