From: Keir Fraser Date: Wed, 5 Dec 2007 11:07:12 +0000 (+0000) Subject: xenstore-ls -f for find(1)-like output X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14666 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=1bb3512f969b20f229cdc092e94afab888dac317;p=xen.git xenstore-ls -f for find(1)-like output The current output of xenstore-ls can be quite hard to read and it is not very intractable for postprocessing with sort|diff and the like. The patch below provides a -f option which produces output with the full key pathname on each line, and which disables the value truncation and the `.'-padding when used with -p (since these latter two aren't likely to be very useful when values are preceded by long pathnames). While I was at it I added the `-s' option to the usage message, where it was previously missing. The results looks like this: ... /local/domain/1 = "" /local/domain/1/vm = "/vm/8b5fd34a-e268-fab5-9cde-c06eda21df16" /local/domain/1/device = "" /local/domain/1/device/vbd = "" /local/domain/1/device/vbd/2049 = "" /local/domain/1/device/vbd/2049/virtual-device = "2049" /local/domain/1/device/vbd/2049/device-type = "disk" /local/domain/1/device/vbd/2049/protocol = "x86_32-abi" ... Signed-off-by: Ian Jackson --- diff --git a/tools/xenstore/xsls.c b/tools/xenstore/xsls.c index 061feebd57..cd8e3a9dac 100644 --- a/tools/xenstore/xsls.c +++ b/tools/xenstore/xsls.c @@ -11,6 +11,7 @@ #define STRING_MAX PATH_MAX static int max_width = 80; static int desired_width = 60; +static int show_whole_path = 0; #define TAG " = \"...\"" #define TAG_LEN strlen(TAG) @@ -36,23 +37,31 @@ void print_dir(struct xs_handle *h, char *path, int cur_depth, int show_perms) unsigned int nperms; int linewid; - /* Print indent and path basename */ - for (linewid=0; linewid