From: Konrad Rzeszutek Wilk Subject: Re: [PATCH 1/5] xen/sys/hypervisor: Export guest_properties/is_initial_domain Date: Mon, 28 Nov 2011 14:14:39 -0400 Message-ID: <20111128181439.GB21369@andromeda.dapyr.net> References: <1322431628-21760-1-git-send-email-waldi@debian.org> <1322431628-21760-2-git-send-email-waldi@debian.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1322431628-21760-2-git-send-email-waldi@debian.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Bastian Blank Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Sun, Nov 27, 2011 at 11:07:04PM +0100, Bastian Blank wrote: > Signed-off-by: Bastian Blank > --- > drivers/xen/sys-hypervisor.c | 35 +++++++++++++++++++++++++++++++++++ You also need a patch to the Documentation ABI (sysfs something). > 1 files changed, 35 insertions(+), 0 deletions(-) > > diff --git a/drivers/xen/sys-hypervisor.c b/drivers/xen/sys-hypervisor.c > index 1e0fe01..d0916e8 100644 > --- a/drivers/xen/sys-hypervisor.c > +++ b/drivers/xen/sys-hypervisor.c > @@ -355,6 +355,35 @@ static void xen_properties_destroy(void) > sysfs_remove_group(hypervisor_kobj, &xen_properties_group); > } > > +/* xen guest properties info */ Properties is plural, but this is a single attribute. The 'guest_properties' does not tell _what_ type of property this is? Nor its purpose. Perhaps the name 'is_initial_domain' would be a better name? What is the purpose of this attribute? Who/what tools benefit from this? Is there a corresponding patch in the Xen tool stack to utilize this? Thanks! > + > +static ssize_t is_initial_domain_show(struct hyp_sysfs_attr *attr, char *buffer) > +{ > + return sprintf(buffer, "%d\n", xen_initial_domain()); > +} > + > +HYPERVISOR_ATTR_RO(is_initial_domain); > + > +static struct attribute *xen_guest_properties_attrs[] = { > + &is_initial_domain_attr.attr, > + NULL > +}; > + > +static struct attribute_group xen_guest_properties_group = { > + .name = "guest_properties", > + .attrs = xen_guest_properties_attrs, > +}; > + > +static int __init xen_guest_properties_init(void) > +{ > + return sysfs_create_group(hypervisor_kobj, &xen_guest_properties_group); > +} > + > +static void xen_guest_properties_destroy(void) > +{ > + sysfs_remove_group(hypervisor_kobj, &xen_guest_properties_group); > +} > + > static int __init hyper_sysfs_init(void) > { > int ret; > @@ -377,9 +406,14 @@ static int __init hyper_sysfs_init(void) > ret = xen_properties_init(); > if (ret) > goto prop_out; > + ret = xen_guest_properties_init(); > + if (ret) > + goto gprop_out; > > goto out; > > +gprop_out: > + xen_properties_destroy(); > prop_out: > xen_sysfs_uuid_destroy(); > uuid_out: > @@ -394,6 +428,7 @@ out: > > static void __exit hyper_sysfs_exit(void) > { > + xen_guest_properties_destroy(); > xen_properties_destroy(); > xen_compilation_destroy(); > xen_sysfs_uuid_destroy(); > -- > 1.7.7.3 > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel