[Pkg-xen-changes] r760 - in trunk/xen-3/debian: . patches

Bastian Blank waldi at alioth.debian.org
Fri May 28 09:10:27 UTC 2010


Author: waldi
Date: Fri May 28 09:10:19 2010
New Revision: 760

Log:
* debian/changelog: Update.
* debian/patches/series: Add new patch.
* debian/patches/tools-libxc-device.diff: Remove device creation support.

Added:
   trunk/xen-3/debian/patches/tools-libxc-device.diff
Modified:
   trunk/xen-3/debian/changelog
   trunk/xen-3/debian/patches/series

Modified: trunk/xen-3/debian/changelog
==============================================================================
--- trunk/xen-3/debian/changelog	Thu May 27 16:57:57 2010	(r759)
+++ trunk/xen-3/debian/changelog	Fri May 28 09:10:19 2010	(r760)
@@ -2,6 +2,7 @@
 
   * Disable blktap support, it is unusable with current kernels.
   * Disable libaio, was only used by blktap.
+  * Drop device creation support. (closes: #583283)
 
  -- Bastian Blank <waldi at debian.org>  Thu, 27 May 2010 18:40:37 +0200
 

Modified: trunk/xen-3/debian/patches/series
==============================================================================
--- trunk/xen-3/debian/patches/series	Thu May 27 16:57:57 2010	(r759)
+++ trunk/xen-3/debian/patches/series	Fri May 28 09:10:19 2010	(r760)
@@ -46,3 +46,5 @@
 tools-xentrace-install.diff
 
 tools-python-shebang.diff
+
+tools-libxc-device.diff

Added: trunk/xen-3/debian/patches/tools-libxc-device.diff
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/xen-3/debian/patches/tools-libxc-device.diff	Fri May 28 09:10:19 2010	(r760)
@@ -0,0 +1,163 @@
+diff -r d11bdc25b36d tools/libxc/xc_linux.c
+--- a/tools/libxc/xc_linux.c	Thu May 13 10:40:19 2010 +0100
++++ b/tools/libxc/xc_linux.c	Thu May 27 18:24:03 2010 +0200
+@@ -167,97 +167,14 @@
+                       (unsigned long)hypercall);
+ }
+ 
+-#define MTAB "/proc/mounts"
+-#define MAX_PATH 255
+-#define _STR(x) #x
+-#define STR(x) _STR(x)
+-
+-static int find_sysfsdir(char *sysfsdir)
+-{
+-    FILE *fp;
+-    char type[MAX_PATH + 1];
+-
+-    if ( (fp = fopen(MTAB, "r")) == NULL )
+-        return -1;
+-
+-    while ( fscanf(fp, "%*s %"
+-                   STR(MAX_PATH)
+-                   "s %"
+-                   STR(MAX_PATH)
+-                   "s %*s %*d %*d\n",
+-                   sysfsdir, type) == 2 )
+-    {
+-        if ( strncmp(type, "sysfs", 5) == 0 )
+-            break;
+-    }
+-
+-    fclose(fp);
+-
+-    return ((strncmp(type, "sysfs", 5) == 0) ? 0 : -1);
+-}
+-
+-int xc_find_device_number(const char *name)
+-{
+-    FILE *fp;
+-    int i, major, minor;
+-    char sysfsdir[MAX_PATH + 1];
+-    static char *classlist[] = { "xen", "misc" };
+-
+-    for ( i = 0; i < (sizeof(classlist) / sizeof(classlist[0])); i++ )
+-    {
+-        if ( find_sysfsdir(sysfsdir) < 0 )
+-            goto not_found;
+-
+-        /* <base>/class/<classname>/<devname>/dev */
+-        strncat(sysfsdir, "/class/", MAX_PATH);
+-        strncat(sysfsdir, classlist[i], MAX_PATH);
+-        strncat(sysfsdir, "/", MAX_PATH);
+-        strncat(sysfsdir, name, MAX_PATH);
+-        strncat(sysfsdir, "/dev", MAX_PATH);
+-
+-        if ( (fp = fopen(sysfsdir, "r")) != NULL )
+-            goto found;
+-    }
+-
+- not_found:
+-    errno = -ENOENT;
+-    return -1;
+-
+- found:
+-    if ( fscanf(fp, "%d:%d", &major, &minor) != 2 )
+-    {
+-        fclose(fp);
+-        goto not_found;
+-    }
+-
+-    fclose(fp);
+-
+-    return makedev(major, minor);
+-}
+-
+ #define EVTCHN_DEV_NAME  "/dev/xen/evtchn"
+ 
+ int xc_evtchn_open(void)
+ {
+-    struct stat st;
+     int fd;
+-    int devnum;
+ 
+-    devnum = xc_find_device_number("evtchn");
+-
+-    /* Make sure any existing device file links to correct device. */
+-    if ( (lstat(EVTCHN_DEV_NAME, &st) != 0) || !S_ISCHR(st.st_mode) ||
+-         (st.st_rdev != devnum) )
+-        (void)unlink(EVTCHN_DEV_NAME);
+-
+- reopen:
+     if ( (fd = open(EVTCHN_DEV_NAME, O_RDWR)) == -1 )
+     {
+-        if ( (errno == ENOENT) &&
+-            ((mkdir("/dev/xen", 0755) == 0) || (errno == EEXIST)) &&
+-             (mknod(EVTCHN_DEV_NAME, S_IFCHR|0600, devnum) == 0) )
+-            goto reopen;
+-
+         PERROR("Could not open event channel interface");
+         return -1;
+     }
+@@ -380,25 +297,10 @@
+ 
+ int xc_gnttab_open(void)
+ {
+-    struct stat st;
+     int fd;
+-    int devnum;
+     
+-    devnum = xc_find_device_number("gntdev");
+-    
+-    /* Make sure any existing device file links to correct device. */
+-    if ( (lstat(GNTTAB_DEV_NAME, &st) != 0) || !S_ISCHR(st.st_mode) ||
+-         (st.st_rdev != devnum) )
+-        (void)unlink(GNTTAB_DEV_NAME);
+-    
+-reopen:
+     if ( (fd = open(GNTTAB_DEV_NAME, O_RDWR)) == -1 )
+     {
+-        if ( (errno == ENOENT) &&
+-             ((mkdir("/dev/xen", 0755) == 0) || (errno == EEXIST)) &&
+-             (mknod(GNTTAB_DEV_NAME, S_IFCHR|0600, devnum) == 0) )
+-            goto reopen;
+-        
+         PERROR("Could not open grant table interface");
+         return -1;
+     }
+diff -r d11bdc25b36d tools/libxc/xc_minios.c
+--- a/tools/libxc/xc_minios.c	Thu May 13 10:40:19 2010 +0100
++++ b/tools/libxc/xc_minios.c	Thu May 27 18:24:03 2010 +0200
+@@ -128,12 +128,6 @@
+     return call.result;
+ }
+ 
+-int xc_find_device_number(const char *name)
+-{
+-    printf("xc_find_device_number(%s)\n", name);
+-    do_exit();
+-}
+-
+ int xc_evtchn_open(void)
+ {
+     int fd = alloc_fd(FTYPE_EVTCHN), i;
+diff -r d11bdc25b36d tools/libxc/xenctrl.h
+--- a/tools/libxc/xenctrl.h	Thu May 13 10:40:19 2010 +0100
++++ b/tools/libxc/xenctrl.h	Thu May 27 18:24:03 2010 +0200
+@@ -96,16 +96,6 @@
+ int xc_interface_close(int xc_handle);
+ 
+ /*
+- * KERNEL INTERFACES
+- */
+-
+-/*
+- * Resolve a kernel device name (e.g., "evtchn", "blktap0") into a kernel
+- * device number. Returns -1 on error (and sets errno).
+- */
+-int xc_find_device_number(const char *name);
+-
+-/*
+  * DOMAIN DEBUGGING FUNCTIONS
+  */
+ 



More information about the Pkg-xen-changes mailing list