Bastian Blank
2006-Oct-26 12:22 UTC
[Pkg-xen-changes] r368 - in trunk/xen-3.0/debian: . patches
Author: waldi Date: Thu Oct 26 12:21:52 2006 New Revision: 368 Added: trunk/xen-3.0/debian/patches/not-reinvent-udev.dpatch (contents, props changed) Modified: trunk/xen-3.0/debian/changelog trunk/xen-3.0/debian/patches/00list Log: * debian/changelog: Update. * debian/patches/00list: Add not-reinvent-udev. * debian/patches/not-reinvent-udev.dpatch: Add. Modified: trunk/xen-3.0/debian/changelog =============================================================================--- trunk/xen-3.0/debian/changelog (original) +++ trunk/xen-3.0/debian/changelog Thu Oct 26 12:21:52 2006 @@ -1,3 +1,9 @@ +xen-3.0 (3.0.3-0-2) UNRELEASED; urgency=low + + * Remove device recreate code. + + -- Bastian Blank <waldi@debian.org> Thu, 26 Oct 2006 11:54:01 +0000 + xen-3.0 (3.0.3-0-1) unstable; urgency=low * New upstream version. Modified: trunk/xen-3.0/debian/patches/00list =============================================================================--- trunk/xen-3.0/debian/patches/00list (original) +++ trunk/xen-3.0/debian/patches/00list Thu Oct 26 12:21:52 2006 @@ -7,3 +7,4 @@ qemu-arch blktap-disable path-relative +not-reinvent-udev Added: trunk/xen-3.0/debian/patches/not-reinvent-udev.dpatch =============================================================================--- (empty file) +++ trunk/xen-3.0/debian/patches/not-reinvent-udev.dpatch Thu Oct 26 12:21:52 2006 @@ -0,0 +1,108 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## not-reinvent-udev.dpatch by Bastian Blank <waldi@debian.org> +## +## All lines beginning with `## DP:'' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad xen-3.0~/tools/libxc/xc_linux.c xen-3.0/tools/libxc/xc_linux.c +--- xen-3.0~/tools/libxc/xc_linux.c 2006-10-20 10:26:02.000000000 +0000 ++++ xen-3.0/tools/libxc/xc_linux.c 2006-10-26 12:16:12.835625388 +0000 +@@ -133,97 +133,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; + }