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

Re: [Xen-devel] [PATCH] xenstore-stat



On Wed, 2011-03-30 at 10:33 +0100, Frank Pan wrote:
> The entries in xenstore have permission attributes. The
> attributes can be easily altered by xenstore-chmod, however,
> I cannot find an easy way to view them.
> 
> I've modified xenstore_client.c to raise a new utility.
> The utility checks the permission and makes an easy-to-look output.

You can sort of get this from "xenstore-ls -p" but a stat option seems
like a worthwhile addition.

> Please tell me any suggestions.

I think I'd suggest pulling the core of the new functionality out of
perform() and into a new function do_stat().

> +    case MODE_stat:
> +        mstr = incl_mode ? "stat " : "";
> +        errx(1, "Usage: %s %s[-h] [-s] key [...]", progname, mstr);

Does it deal with multiple key names as a paramter? If not then I guess
the [...] can be dropped, or else the necessary support added.

> +static const char *
> +perm_type_str(int perm_type)
> +{

Can you use xs_perm_to_string here instead?

> @@ -459,6 +480,34 @@ perform(enum mode mode, int optind, int argc,
[...]
> +            output("Owner:\t\t\t%d\n", perms[0].id);
> +            output("Default permission:\t%s\n", 
> perm_type_str(perms[0].perms));
> +            output("Permissions:\t\t", perms[0].id);

Unused parameter?

Ian.



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


 


Rackspace

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