All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bastian Blank <waldi@debian.org>
To: xen-devel@lists.xensource.com
Cc: Bastian Blank <waldi@debian.org>
Subject: [PATCH 1/5] xen/sys/hypervisor: Export guest_properties/is_initial_domain
Date: Sun, 27 Nov 2011 23:07:04 +0100	[thread overview]
Message-ID: <1322431628-21760-2-git-send-email-waldi@debian.org> (raw)
In-Reply-To: <1322431628-21760-1-git-send-email-waldi@debian.org>

Signed-off-by: Bastian Blank <waldi@debian.org>
---
 drivers/xen/sys-hypervisor.c |   35 +++++++++++++++++++++++++++++++++++
 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 */
+
+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

  reply	other threads:[~2011-11-27 22:07 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-27 22:07 [PATCH 0/5] Move stuff out of xenfs Bastian Blank
2011-11-27 22:07 ` Bastian Blank [this message]
2011-11-28 18:14   ` [PATCH 1/5] xen/sys/hypervisor: Export guest_properties/is_initial_domain Konrad Rzeszutek Wilk
2011-11-28 18:38     ` Bastian Blank
2011-11-29 23:24       ` Konrad Rzeszutek Wilk
2011-11-27 22:07 ` [PATCH 2/5] xen: Add privcmd device driver Bastian Blank
2011-11-28 16:26   ` Ian Campbell
2011-11-28 17:39     ` Bastian Blank
2011-11-28 18:00       ` Ian Campbell
2011-11-28 18:23         ` Bastian Blank
2011-11-28 19:13           ` Ian Campbell
2011-11-28 18:22   ` Konrad Rzeszutek Wilk
2011-11-28 18:46     ` Bastian Blank
2011-11-27 22:07 ` [PATCH 3/5] xen/privcmd: Remove unused support for arch specific privcmp mmap Bastian Blank
2011-11-27 22:07 ` [PATCH 4/5] xen: Add xenbus device driver Bastian Blank
2011-11-28 18:10   ` Konrad Rzeszutek Wilk
2011-11-27 22:07 ` [PATCH 5/5] xen: Add xenbusd " Bastian Blank
2011-11-28 18:37   ` Konrad Rzeszutek Wilk
2011-11-28 18:52     ` Bastian Blank
2011-11-28 19:12       ` Daniel De Graaf
2011-11-28 19:42         ` Bastian Blank
2011-11-28  9:03 ` [PATCH 0/5] Move stuff out of xenfs Christoph Egger
2011-11-28  9:31   ` Ian Campbell
2011-11-28  9:39     ` Christoph Egger
2011-11-28  9:51       ` Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1322431628-21760-2-git-send-email-waldi@debian.org \
    --to=waldi@debian.org \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.