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

[Xen-devel] [PATCH] move /proc/xen to /proc/sys/xen in xen linux

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] move /proc/xen to /proc/sys/xen in xen linux
From: "Mike D. Day" <ncmike@xxxxxxxxxx>
Date: Wed, 16 Nov 2005 10:48:31 -0500
Delivery-date: Wed, 16 Nov 2005 15:48:27 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla Thunderbird 1.0.7 (Macintosh/20050923)

--

Mike D. Day
STSM and Architect, Open Virtualization
IBM Linux Technology Center
ncmike@xxxxxxxxxx
# HG changeset patch
# User mdday@xxxxxxxxxxxxxxxxxxxxx
# Node ID 133b58ab5a8ff2a5b00a342de402588d0e2fd36b
# Parent  9bf6f907b3ff0261902f06d261f76c1bd12af9f5
Move /proc/xen to /proc/sys/xen

signed-off-by: Mike Day <ncmike@xxxxxxxxxx>

diff -r 9bf6f907b3ff -r 133b58ab5a8f 
linux-2.6-xen-sparse/arch/xen/kernel/gnttab.c
--- a/linux-2.6-xen-sparse/arch/xen/kernel/gnttab.c     Wed Nov 16 10:29:52 2005
+++ b/linux-2.6-xen-sparse/arch/xen/kernel/gnttab.c     Wed Nov 16 15:34:49 2005
@@ -442,7 +442,7 @@
         *  /proc/xen/grant : used by libxc to access grant tables
         */
        if ((grant_pde = create_xen_proc_entry("grant", 0600)) == NULL) {
-               WPRINTK("Unable to create grant xen proc entry\n");
+               WPRINTK("Unable to create /proc/sys/xen/grant_pde.\n");
                return -1;
        }
 
diff -r 9bf6f907b3ff -r 133b58ab5a8f 
linux-2.6-xen-sparse/arch/xen/kernel/xen_proc.c
--- a/linux-2.6-xen-sparse/arch/xen/kernel/xen_proc.c   Wed Nov 16 10:29:52 2005
+++ b/linux-2.6-xen-sparse/arch/xen/kernel/xen_proc.c   Wed Nov 16 15:34:49 2005
@@ -8,8 +8,9 @@
 struct proc_dir_entry *create_xen_proc_entry(const char *name, mode_t mode)
 {
        if ( xen_base == NULL )
-               if ( (xen_base = proc_mkdir("xen", &proc_root)) == NULL )
+               if ( (xen_base = proc_mkdir("sys/xen", NULL)) == NULL ) {
                        panic("Couldn't create /proc/xen");
+               }
        return create_proc_entry(name, mode, xen_base);
 }
 
diff -r 9bf6f907b3ff -r 133b58ab5a8f 
linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c
--- a/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c        Wed Nov 16 
10:29:52 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c        Wed Nov 16 
15:34:49 2005
@@ -470,7 +470,7 @@
        balloon_timer.function = balloon_alarm;
     
        if ((balloon_pde = create_xen_proc_entry("balloon", 0644)) == NULL) {
-               WPRINTK("Unable to create /proc/xen/balloon.\n");
+               WPRINTK("Unable to create /proc/sys/xen/balloon.\n");
                return -1;
        }
 
diff -r 9bf6f907b3ff -r 133b58ab5a8f 
linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c
--- a/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c        Wed Nov 16 
10:29:52 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c        Wed Nov 16 
15:34:49 2005
@@ -38,6 +38,8 @@
 #endif
 
 static struct proc_dir_entry *privcmd_intf;
+#define WPRINTK(fmt, args...) \
+       printk(KERN_WARNING "xen_privcmd: " fmt, ##args)
 
 static int privcmd_ioctl(struct inode *inode, struct file *file,
                          unsigned int cmd, unsigned long data)
@@ -254,10 +256,11 @@
 
 static int __init privcmd_init(void)
 {
-       privcmd_intf = create_xen_proc_entry("privcmd", 0400);
-       if (privcmd_intf != NULL)
-               privcmd_intf->proc_fops = &privcmd_file_ops;
-
+       if ((privcmd_intf = create_xen_proc_entry("privcmd", 0400)) == NULL ) {
+               WPRINTK("Unable to create /proc/sys/xen/privcmd.\n");
+               return -1;      
+       }
+       privcmd_intf->proc_fops = &privcmd_file_ops;
        return 0;
 }
 
diff -r 9bf6f907b3ff -r 133b58ab5a8f 
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c
--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c      Wed Nov 16 
10:29:52 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c      Wed Nov 16 
15:34:49 2005
@@ -44,6 +44,9 @@
 #include <asm-xen/xenbus.h>
 #include <asm-xen/xen_proc.h>
 #include <asm/hypervisor.h>
+
+#define WPRINTK(fmt, args...) \
+       printk(KERN_WARNING "xenbus: " fmt, ##args)
 
 struct xenbus_dev_transaction {
        struct list_head list;
@@ -221,10 +224,11 @@
 static int __init
 xenbus_dev_init(void)
 {
-       xenbus_dev_intf = create_xen_proc_entry("xenbus", 0400);
-       if (xenbus_dev_intf)
-               xenbus_dev_intf->proc_fops = &xenbus_dev_file_ops;
-
+       if((xenbus_dev_intf = create_xen_proc_entry("xenbus", 0400)) == NULL) {
+               WPRINTK("Unable to create /proc/sys/xen/xenbus.\n");
+               return -1;      
+       }
+       xenbus_dev_intf->proc_fops = &xenbus_dev_file_ops;
        return 0;
 }
 
diff -r 9bf6f907b3ff -r 133b58ab5a8f 
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c
--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c    Wed Nov 16 
10:29:52 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c    Wed Nov 16 
15:34:49 2005
@@ -58,6 +58,8 @@
 extern struct semaphore xenwatch_mutex;
 
 #define streq(a, b) (strcmp((a), (b)) == 0)
+#define WPRINTK(fmt, args...) \
+       printk(KERN_WARNING "xenbus_probe: " fmt, ##args)
 
 static struct notifier_block *xenstore_chain;
 
@@ -964,10 +966,17 @@
                xen_start_info->store_evtchn = op.u.alloc_unbound.port;
 
                /* And finally publish the above info in /proc/xen */
-               if((xsd_mfn_intf = create_xen_proc_entry("xsd_mfn", 0400)))
-                       xsd_mfn_intf->read_proc = xsd_mfn_read; 
-               if((xsd_port_intf = create_xen_proc_entry("xsd_port", 0400)))
-                       xsd_port_intf->read_proc = xsd_port_read;
+               if((xsd_mfn_intf = create_xen_proc_entry("xsd_mfn", 0400)) == 
NULL ) {
+                       WPRINTK("Unable to create /proc/sys/xen/xsd_mfn.\n");
+                       return -1;      
+               }
+               xsd_mfn_intf->read_proc = xsd_mfn_read; 
+               
+               if((xsd_port_intf = create_xen_proc_entry("xsd_port", 0400)) == 
NULL ) {
+                       WPRINTK("Unable to create /proc/sys/xen/xsd_port.\n");
+                       return -1;      
+               }
+               xsd_port_intf->read_proc = xsd_port_read;
        }
 
        /* Initialize the interface to xenstore. */
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel