From: Juergen Gross <juergen.gross@ts.fujitsu.com>
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: [Patch] xl: correct vcpu-pin and vcpu-list parameter checking
Date: Wed, 08 Sep 2010 09:35:19 +0200 [thread overview]
Message-ID: <4C873CB7.8020202@ts.fujitsu.com> (raw)
[-- 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
reply other threads:[~2010-09-08 7:35 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=4C873CB7.8020202@ts.fujitsu.com \
--to=juergen.gross@ts.fujitsu.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.