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: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] xenstore-stat
From: Frank Pan <frankpzh@xxxxxxxxx>
Date: Wed, 30 Mar 2011 20:03:07 +0800
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>, Stefano Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>
Delivery-date: Wed, 30 Mar 2011 05:05:24 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=ETxt3nFKzjzWv9oIme6ZjQ7Z26aMYRMlZ+TRrH6Lmqk=; b=qIT8xcMxyYEdnkojldevkMvqZvIL/GFAgCtMYpCG8lofSAYgP0T6tu9NP6zzIdJLHs YMU9UYzfzI6v6L0nHbuoe8WYRwJvi/UFX06UnBDu7O1zxiRAEcnQdm65UMPZN4vYjPCJ 8EopehD7Hq/hzO1PPgi+2eI52JaoxZJCROwqc=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=Mw7T+cStIA+o5o88bohdbQpUB2UNK0yDWhguR8F/mp+4ismpR7SLAkVRB6dkVAQBvX kLeOo7r83w84eu783n9ci8qeg06GB2VkLVo30u3TXz7XrGl0Q6CgbXkGwJOa8DViENN0 qT9dRd6ECLw/QOjevRpmKozzX6WfMxRmWpbTk=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1301478810.27123.71.camel@xxxxxxxxxxxxxxxxxxxxxx>
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>
References: <AANLkTimZHOtrN48ipU__tA-u0WJNHdTBPVN+PaKTDzvd@xxxxxxxxxxxxxx> <1301478810.27123.71.camel@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
> You can sort of get this from "xenstore-ls -p" but a stat option seems
> like a worthwhile addition.

Didn't know this before. :(

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

Good idea.

>> +    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.

Sure, xenstore-stat can accept multiple keys.

>> +static const char *
>> +perm_type_str(int perm_type)
>> +{
>
> Can you use xs_perm_to_string here instead?

I'd like to make it more similar to unix permissions. ("-rwx")
I think it's more straightforward than "w/r/b/n".
Is this a good idea?

> Unused parameter?

Yes. My compiler did not complain, weird.

-- 
潘震皓, Frank Pan

Computer Science and Technology
Tsinghua University

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