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: block-attach command line parsing

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xl: block-attach command line parsing
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sun, 06 Jun 2010 23:55:17 -0700
Delivery-date: Sun, 06 Jun 2010 23:56:24 -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 Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1275891182 -3600
# Node ID aaef5d82344df4d94e46f73a4f2284ceb081e99e
# Parent  62447b8e0f2653aef259530c72504b1773135e66
xl: block-attach command line parsing

Command line arguments start at argv[2].

Signed-off-by: Eric Chanudet <eric.chanudet@xxxxxxxxxx>
---
 tools/libxl/xl_cmdimpl.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff -r 62447b8e0f26 -r aaef5d82344d tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Mon Jun 07 07:12:20 2010 +0100
+++ b/tools/libxl/xl_cmdimpl.c  Mon Jun 07 07:13:02 2010 +0100
@@ -3637,7 +3637,7 @@ int main_blockattach(int argc, char **ar
     uint32_t fe_domid, be_domid = 0;
     libxl_device_disk disk = { 0 };
 
-    if ((argc < 4) || (argc > 6)) {
+    if ((argc < 5) || (argc > 7)) {
         help("block-attach");
         exit(0);
     }
@@ -3652,7 +3652,7 @@ int main_blockattach(int argc, char **ar
         }
     }
 
-    tok = strtok(argv[2], ":");
+    tok = strtok(argv[3], ":");
     if (!strcmp(tok, "phy")) {
         disk.phystype = PHYSTYPE_PHY;
     } else if (!strcmp(tok, "file")) {
@@ -3680,17 +3680,17 @@ int main_blockattach(int argc, char **ar
         fprintf(stderr, "Error: missing path to disk image.\n");
         exit(1);
     }
-    disk.virtpath = argv[3];
+    disk.virtpath = argv[4];
     disk.unpluggable = 1;
-    disk.readwrite = (argc <= 4 || argv[4][0] == 'w') ? 1 : 0;
-
-    if (domain_qualifier_to_domid(argv[1], &fe_domid, 0) < 0) {
-        fprintf(stderr, "%s is an invalid domain identifier\n", argv[1]);
+    disk.readwrite = ((argc <= 4) || (argv[5][0] == 'w'));
+
+    if (domain_qualifier_to_domid(argv[2], &fe_domid, 0) < 0) {
+        fprintf(stderr, "%s is an invalid domain identifier\n", argv[2]);
         exit(1);
     }
-    if (argc == 6) {
-        if (domain_qualifier_to_domid(argv[5], &be_domid, 0) < 0) {
-            fprintf(stderr, "%s is an invalid domain identifier\n", argv[5]);
+    if (argc == 7) {
+        if (domain_qualifier_to_domid(argv[6], &be_domid, 0) < 0) {
+            fprintf(stderr, "%s is an invalid domain identifier\n", argv[6]);
             exit(1);
         }
     }

_______________________________________________
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: block-attach command line parsing, Xen patchbot-unstable <=