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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xl: fix block-attach command parsing
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 21 May 2010 08:25:15 -0700
Delivery-date: Fri, 21 May 2010 08:27: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 1274451910 -3600
# Node ID 3480444bdf376979f3e566cf8cc400de8fe6b791
# Parent  a7fcf2e35d32709315741079d2867882935b04f9
xl: fix block-attach command parsing

Fix two command-line parsing problems:
 - the argc check is wrong: it must be provided with the frontend
 device
 - the ro/rw mode is optional, so default to rw if it is absent

Also, update the usage message accordingly.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>
---
 tools/libxl/xl_cmdimpl.c  |    4 ++--
 tools/libxl/xl_cmdtable.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff -r a7fcf2e35d32 -r 3480444bdf37 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Thu May 20 17:22:15 2010 +0100
+++ b/tools/libxl/xl_cmdimpl.c  Fri May 21 15:25:10 2010 +0100
@@ -3444,7 +3444,7 @@ int main_blockattach(int argc, char **ar
     uint32_t fe_domid, be_domid = 0;
     libxl_device_disk disk = { 0 };
 
-    if ((argc < 3) || (argc > 6)) {
+    if ((argc < 4) || (argc > 6)) {
         help("block-attach");
         exit(0);
     }
@@ -3489,7 +3489,7 @@ int main_blockattach(int argc, char **ar
     }
     disk.virtpath = argv[3];
     disk.unpluggable = 1;
-    disk.readwrite = (argv[4][0] == 'w') ? 1 : 0;
+    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]);
diff -r a7fcf2e35d32 -r 3480444bdf37 tools/libxl/xl_cmdtable.c
--- a/tools/libxl/xl_cmdtable.c Thu May 20 17:22:15 2010 +0100
+++ b/tools/libxl/xl_cmdtable.c Fri May 21 15:25:10 2010 +0100
@@ -216,7 +216,7 @@ struct cmd_spec cmd_table[] = {
     { "block-attach",
       &main_blockattach,
       "Create a new virtual block device",
-      "<Domain> <BackDev> <FrontDev> <Mode> [BackDomain]",
+      "<Domain> <BackDev> <FrontDev> [<Mode>] [BackDomain]",
     },
     { "block-list",
       &main_blocklist,

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