[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [XENSTORE] Fix xenstore-ls program to connect via kernel xenbus



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Node ID 9b65a87f140f570286c0ccdbaae54e21dca4bdd2
# Parent  0b8f79563bcd400821636ae7a980900718a8042e
[XENSTORE] Fix xenstore-ls program to connect via kernel xenbus
connection by default, like all other client utils.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 tools/xenstore/xsls.c |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diff -r 0b8f79563bcd -r 9b65a87f140f tools/xenstore/xsls.c
--- a/tools/xenstore/xsls.c     Thu Nov 09 13:18:58 2006 +0000
+++ b/tools/xenstore/xsls.c     Thu Nov 09 13:25:47 2006 +0000
@@ -94,14 +94,8 @@ int main(int argc, char *argv[])
 int main(int argc, char *argv[])
 {
     struct winsize ws;
-    int ret;
-    int c;
-    int show_perm = 0;
-
-    struct xs_handle *xsh = xs_daemon_open();
-
-    if (xsh == NULL)
-        err(1, "xs_daemon_open");
+    int ret, c, socket = 0, show_perm = 0;
+    struct xs_handle *xsh;
 
 #define PAD 2
 
@@ -110,11 +104,14 @@ int main(int argc, char *argv[])
     if (!ret)
         max_width = ws.ws_col - PAD;
 
-    while (0 < (c = getopt(argc, argv, "p"))) {
+    while (0 < (c = getopt(argc, argv, "ps"))) {
         switch (c) {
         case 'p':
             show_perm = 1;
             max_width -= 16;
+            break;
+        case 's':
+            socket = 1;
             break;
         case ':':
         case '?':
@@ -124,6 +121,10 @@ int main(int argc, char *argv[])
         }
     }
 
+    xsh = socket ? xs_daemon_open() : xs_domain_open();
+    if (xsh == NULL)
+        err(1, socket ? "xs_daemon_open" : "xs_domain_open");
+
     print_dir(xsh, (argc - optind) == 1 ? argv[optind] : "/", 0, show_perm);
 
     return 0;

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.