Creates /sys/hypervisor/xen and populates that dir with xen version, changeset, compilation, and capabilities info. Intended for the xen merge tree and later upstream.
+ if( 0 == (err = subsystem_register(&hypervisor_subsys)) ) {
+ if( ! HYPERVISOR_xen_version(XENVER_extraversion, + extra_version) ) {
+ page[PAGE_SIZE - 1] = 0x00;
+ return snprintf(page, PAGE_SIZE - 1, + "xen-%ld.%ld%s\n",
+ major, minor, extra_version);
+/* xen compile info */
+static ssize_t xen_compile_show(struct kobject * kobj, + struct attribute * attr, + char * page)
+{
+ struct xen_compile_info info;
+ + if( 0 == HYPERVISOR_xen_version(XENVER_compile_info, &info) ) {
+ page[PAGE_SIZE - 1] = 0x00;
+ return snprintf(page, PAGE_SIZE - 1, + "compiled by %s, using %s, on %s\n", + info.compile_by, + info.compile_date, + info.compiler);
+ }
+ return 0;
+}
+int __init
+sysfs_xen_version_init(void)
+{
+ __label__ out;
+ + struct kset * parent = get_xen_kset();
+ if ( parent != NULL ) {
+ kobject_init(&xen_ver_obj);
+ xen_ver_obj.parent = &parent->kobj; + xen_ver_obj.dentry = parent->kobj.dentry;
+ kobject_get(&parent->kobj);
+ if ( sysfs_create_file(&xen_ver_obj, &xen_ver_attr.attr) )
+ goto out;