mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michael Holzheu <holzheu@de.ibm.com>
To: akpm@osdl.org
Cc: ioe-lkml@rameria.de, joern@wohnheim.fh-wedel.de,
	linux-kernel@vger.kernel.org, mschwid2@de.ibm.com,
	penberg@cs.helsinki.fi, greg@kroah.com
Subject: [PATCH 2/3] Add /sys/hypervisor subsystem
Date: Thu, 4 May 2006 16:01:43 +0200	[thread overview]
Message-ID: <20060504160143.2af57564.holzheu@de.ibm.com> (raw)

To have a home for all hypervisors, this patch
creates /sys/hypervisor.

Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Michael Holzheu <holzheu@de.ibm.com>

---

 include/linux/kobject.h |    2 ++
 kernel/ksysfs.c         |   26 +++++++++++++++++++++-----

diff -urpN linux-2.6.16-hypfs-2006-04-28-update2/include/linux/kobject.h linux-2.6.16-hypfs-2006-04-28-update3/include/linux/kobject.h
--- linux-2.6.16-hypfs-2006-04-28-update2/include/linux/kobject.h	2006-05-04 10:22:37.000000000 +0200
+++ linux-2.6.16-hypfs-2006-04-28-update3/include/linux/kobject.h	2006-05-04 10:29:47.000000000 +0200
@@ -186,6 +186,8 @@ struct subsystem _varname##_subsys = { \
 
 /* The global /sys/kernel/ subsystem for people to chain off of */
 extern struct subsystem kernel_subsys;
+/* The global /sys/hypervisor/ subsystem  */
+extern struct subsystem hypervisor_subsys;
 
 /**
  * Helpers for setting the kset of registered objects.
diff -urpN linux-2.6.16-hypfs-2006-04-28-update2/kernel/ksysfs.c linux-2.6.16-hypfs-2006-04-28-update3/kernel/ksysfs.c
--- linux-2.6.16-hypfs-2006-04-28-update2/kernel/ksysfs.c	2006-05-04 10:22:38.000000000 +0200
+++ linux-2.6.16-hypfs-2006-04-28-update3/kernel/ksysfs.c	2006-05-04 10:30:03.000000000 +0200
@@ -53,6 +53,8 @@ KERNEL_ATTR_RW(uevent_helper);
 
 decl_subsys(kernel, NULL, NULL);
 EXPORT_SYMBOL_GPL(kernel_subsys);
+decl_subsys(hypervisor, NULL, NULL);
+EXPORT_SYMBOL_GPL(hypervisor_subsys);
 
 static struct attribute * kernel_attrs[] = {
 #ifdef CONFIG_HOTPLUG
@@ -68,12 +70,26 @@ static struct attribute_group kernel_att
 
 static int __init ksysfs_init(void)
 {
-	int error = subsystem_register(&kernel_subsys);
-	if (!error)
-		error = sysfs_create_group(&kernel_subsys.kset.kobj,
-					   &kernel_attr_group);
+	int rc;
 
-	return error;
+	rc = subsystem_register(&hypervisor_subsys);
+	if (rc)
+		goto fail_hyp;
+	rc = subsystem_register(&kernel_subsys);
+	if (rc)
+		goto fail_kernel;
+	rc = sysfs_create_group(&kernel_subsys.kset.kobj,
+				&kernel_attr_group);
+	if (rc)
+		goto fail_group;
+	return 0;
+
+fail_group:
+	subsystem_unregister(&kernel_subsys);
+fail_kernel:
+	subsystem_unregister(&hypervisor_subsys);
+fail_hyp:
+	return rc;
 }
 
 core_initcall(ksysfs_init);

                 reply	other threads:[~2006-05-04 14:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20060504160143.2af57564.holzheu@de.ibm.com \
    --to=holzheu@de.ibm.com \
    --cc=akpm@osdl.org \
    --cc=greg@kroah.com \
    --cc=ioe-lkml@rameria.de \
    --cc=joern@wohnheim.fh-wedel.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mschwid2@de.ibm.com \
    --cc=penberg@cs.helsinki.fi \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®