[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Remove unneeded /proc/xen/grant and its libxc wrapper.



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID d8232e9f7988d39031a2ac3b551cee8382b2f839
# Parent  2cb434a12bba15377b3e69466440e4d88a1067bc
Remove unneeded /proc/xen/grant and its libxc wrapper.

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r 2cb434a12bba -r d8232e9f7988 
linux-2.6-xen-sparse/arch/xen/kernel/gnttab.c
--- a/linux-2.6-xen-sparse/arch/xen/kernel/gnttab.c     Wed Jan 25 23:10:03 2006
+++ b/linux-2.6-xen-sparse/arch/xen/kernel/gnttab.c     Wed Jan 25 23:17:06 2006
@@ -14,7 +14,6 @@
 #include <asm-xen/xen-public/xen.h>
 #include <asm/fixmap.h>
 #include <asm/uaccess.h>
-#include <asm-xen/xen_proc.h>
 #include <asm-xen/linux-public/privcmd.h>
 #include <asm-xen/gnttab.h>
 #include <asm/synch_bitops.h>
@@ -340,81 +339,6 @@
        spin_unlock_irqrestore(&gnttab_list_lock, flags);
 }
 
-/*
- * ProcFS operations
- */
-
-#ifdef CONFIG_PROC_FS
-
-static struct proc_dir_entry *grant_pde;
-static struct file_operations grant_file_ops;
-
-static int
-grant_read(char *page, char **start, off_t off, int count, int *eof,
-          void *data)
-{
-       int             len;
-       unsigned int    i;
-       grant_entry_t  *gt;
-
-       gt = (grant_entry_t *)shared;
-       len = 0;
-
-       for (i = 0; i < NR_GRANT_ENTRIES; i++) {
-               if (len > (PAGE_SIZE - 200)) {
-                       len += sprintf( page + len, "Truncated.\n");
-                       break;
-               }
-       }
-
-       if (gt[i].flags) {
-               len += sprintf(page + len,
-                              "Grant: ref (0x%x) flags (0x%hx) "
-                              "dom (0x%hx) frame (0x%x)\n", 
-                              i,
-                              gt[i].flags,
-                              gt[i].domid,
-                              gt[i].frame );
-       }
-
-       *eof = 1;
-       return len;
-}
-
-static int
-grant_write(struct file *file, const char __user *buffer, unsigned long count,
-           void *data)
-{
-       /* TODO: implement this */
-       return -ENOSYS;
-}
-
-static int __init
-gnttab_proc_init(void)
-{
-       /*
-        *  /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");
-               return -1;
-       }
-
-       grant_file_ops.read   = grant_pde->proc_fops->read;
-       grant_file_ops.write  = grant_pde->proc_fops->write;
-
-       grant_pde->proc_fops  = &grant_file_ops;
-
-       grant_pde->read_proc  = &grant_read;
-       grant_pde->write_proc = &grant_write;
-
-       return 0;
-}
-
-device_initcall(gnttab_proc_init);
-
-#endif /* CONFIG_PROC_FS */
-
 int
 gnttab_resume(void)
 {
diff -r 2cb434a12bba -r d8232e9f7988 tools/libxc/Makefile
--- a/tools/libxc/Makefile      Wed Jan 25 23:10:03 2006
+++ b/tools/libxc/Makefile      Wed Jan 25 23:17:06 2006
@@ -17,7 +17,6 @@
 SRCS       += xc_core.c
 SRCS       += xc_domain.c
 SRCS       += xc_evtchn.c
-SRCS       += xc_gnttab.c
 SRCS       += xc_misc.c
 SRCS       += xc_physdev.c
 SRCS       += xc_private.c
diff -r 2cb434a12bba -r d8232e9f7988 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h     Wed Jan 25 23:10:03 2006
+++ b/tools/libxc/xenctrl.h     Wed Jan 25 23:17:06 2006
@@ -13,7 +13,6 @@
 #include <sys/ptrace.h>
 #include <xen/xen.h>
 #include <xen/dom0_ops.h>
-#include <xen/grant_table.h>
 #include <xen/version.h>
 #include <xen/event_channel.h>
 #include <xen/sched.h>
@@ -467,63 +466,6 @@
                           int num, unsigned long *arr);
 
 
-/*\
- *  GRANT TABLE FUNCTIONS
-\*/ 
-
-/**
- * This function opens a handle to the more restricted grant table hypervisor
- * interface. This may be used where the standard interface is not
- * available because the domain is not privileged.
- * This function can  be called multiple times within a single process.
- * Multiple processes can have an open hypervisor interface at the same time.
- *
- * Each call to this function should have a corresponding call to
- * xc_grant_interface_close().
- *
- * This function can fail if a Xen-enabled kernel is not currently running.
- *
- * @return a handle to the hypervisor grant table interface or -1 on failure
- */
-int xc_grant_interface_open(void);
-
-/**
- * This function closes an open grant table hypervisor interface.
- *
- * This function can fail if the handle does not represent an open interface or
- * if there were problems closing the interface.
- *
- * @parm xc_handle a handle to an open grant table hypervisor interface
- * @return 0 on success, -1 otherwise.
- */
-int xc_grant_interface_close(int xc_handle);
-
-int xc_gnttab_map_grant_ref(int      xc_handle,
-                            uint64_t host_virt_addr,
-                            uint32_t dom,
-                            grant_ref_t ref,
-                            uint16_t flags,
-                            int16_t *status,
-                            grant_handle_t *handle,
-                            uint64_t *dev_bus_addr);
-
-int xc_gnttab_unmap_grant_ref(int  xc_handle,
-                              uint64_t  host_virt_addr,
-                              uint64_t  dev_bus_addr,
-                              grant_handle_t handle,
-                              int16_t *status);
-
-int xc_gnttab_setup_table(int        xc_handle,
-                          uint32_t   dom,
-                          uint16_t   nr_frames,
-                          int16_t   *status,
-                          unsigned long **frame_list);
-
-/* Grant debug builds only: */
-int xc_gnttab_dump_table(int        xc_handle,
-                         uint32_t   dom,
-                         int16_t   *status);
-
 /* Get current total pages allocated to a domain. */
 long xc_get_tot_pages(int xc_handle, uint32_t domid);
 
diff -r 2cb434a12bba -r d8232e9f7988 tools/libxc/xc_gnttab.c
--- a/tools/libxc/xc_gnttab.c   Wed Jan 25 23:10:03 2006
+++ /dev/null   Wed Jan 25 23:17:06 2006
@@ -1,142 +0,0 @@
-/******************************************************************************
- * xc_gnttab.c
- * 
- * API for manipulating and accessing grant tables
- * 
- * Copyright (c) 2005 Christopher Clark
- * based on xc_evtchn.c Copyright (c) 2004, K A Fraser.
- */
-
-#include "xc_private.h"
-#include "xen/grant_table.h"
-
-static int
-do_gnttab_op(int xc_handle,
-             unsigned long cmd,
-             void *op,
-             unsigned long count)
-{
-    int ret = -1;
-    DECLARE_HYPERCALL;
-
-    hypercall.op     = __HYPERVISOR_grant_table_op;
-    hypercall.arg[0] = cmd;
-    hypercall.arg[1] = (unsigned long)op;
-    hypercall.arg[2] = count;
-
-    if ( mlock(op, 64) )
-    {
-        PERROR("do_gnttab_op: op mlock failed");
-        goto out;
-    }
-
-    if ( (ret = do_xen_hypercall(xc_handle, &hypercall)) < 0 )
-        ERROR("do_gnttab_op: HYPERVISOR_grant_table_op failed: %d", ret);
-
-    safe_munlock(op, 64);
- out:
-    return ret;
-}
-
-
-int xc_gnttab_map_grant_ref(int         xc_handle,
-                            uint64_t    host_virt_addr,
-                            uint32_t    dom,
-                            grant_ref_t ref,
-                            uint16_t    flags,
-                            int16_t    *status,
-                            grant_handle_t *handle,
-                            uint64_t   *dev_bus_addr)
-{
-    struct gnttab_map_grant_ref op;
-    int rc;
-
-    op.host_addr      = host_virt_addr;
-    op.dom            = (domid_t)dom;
-    op.ref            = ref;
-    op.flags          = flags;
- 
-    if ( (rc = do_gnttab_op(xc_handle, GNTTABOP_map_grant_ref,
-                            &op, 1)) == 0 )
-    {
-        *status         = op.status;
-        *handle         = op.handle;
-        *dev_bus_addr   = op.dev_bus_addr;
-    }
-
-    return rc;
-}
-
-
-int xc_gnttab_unmap_grant_ref(int       xc_handle,
-                              uint64_t  host_virt_addr,
-                              uint64_t  dev_bus_addr,
-                              grant_handle_t handle,
-                              int16_t  *status)
-{
-    struct gnttab_unmap_grant_ref op;
-    int rc;
-
-    op.host_addr      = host_virt_addr;
-    op.dev_bus_addr   = dev_bus_addr;
-    op.handle         = handle;
- 
-    if ( (rc = do_gnttab_op(xc_handle, GNTTABOP_unmap_grant_ref,
-                            &op, 1)) == 0 )
-    {
-        *status = op.status;
-    }
-
-    return rc;
-}
-
-int xc_gnttab_setup_table(int        xc_handle,
-                          uint32_t   dom,
-                          uint16_t   nr_frames,
-                          int16_t   *status,
-                          unsigned long **frame_list)
-{
-    struct gnttab_setup_table op;
-    int rc, i;
-
-    op.dom       = (domid_t)dom;
-    op.nr_frames = nr_frames;
- 
-    if ( (rc = do_gnttab_op(xc_handle, GNTTABOP_setup_table, &op, 1)) == 0 )
-    {
-        *status = op.status;
-        for ( i = 0; i < nr_frames; i++ )
-            (*frame_list)[i] = op.frame_list[i];
-    }
-
-    return rc;
-}
-
-int xc_gnttab_dump_table(int        xc_handle,
-                         uint32_t   dom,
-                         int16_t   *status)
-{
-    struct gnttab_dump_table op;
-    int rc;
-
-    op.dom = (domid_t)dom;
-
-    if ( (rc = do_gnttab_op(xc_handle, GNTTABOP_dump_table, &op, 1)) == 0 )
-        *status = op.status;
-
-    return rc;
-}
-
-int xc_grant_interface_open(void)
-{
-    int fd = open("/proc/xen/grant", O_RDWR);
-    if ( fd == -1 )
-        PERROR("Could not obtain handle on grant command interface");
-    return fd;
-
-}
-
-int xc_grant_interface_close(int xc_grant_handle)
-{
-    return close(xc_grant_handle);
-}

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.