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-devel

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

To: Frank Pan <frankpzh@xxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] xenstore-stat
From: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Date: Wed, 30 Mar 2011 10:53:30 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>, Stefano Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>
Delivery-date: Wed, 30 Mar 2011 02:54:23 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <AANLkTimZHOtrN48ipU__tA-u0WJNHdTBPVN+PaKTDzvd@xxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: Citrix Systems, Inc.
References: <AANLkTimZHOtrN48ipU__tA-u0WJNHdTBPVN+PaKTDzvd@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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