From: kfraser@localhost.localdomain Date: Thu, 9 Nov 2006 13:25:47 +0000 (+0000) Subject: [XENSTORE] Fix xenstore-ls program to connect via kernel xenbus X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15567^2~40 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=625b3409d281f27b1caf673c23d32778baa834c1;p=xen.git [XENSTORE] Fix xenstore-ls program to connect via kernel xenbus connection by default, like all other client utils. Signed-off-by: Keir Fraser --- diff --git a/tools/xenstore/xsls.c b/tools/xenstore/xsls.c index 7667752546..cf5ff6e7e6 100644 --- a/tools/xenstore/xsls.c +++ b/tools/xenstore/xsls.c @@ -94,14 +94,8 @@ void usage(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,12 +104,15 @@ 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 '?': default: @@ -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;