rpms/xen/F-12 xen-dev-create-cleanup.patch, NONE, 1.1 sources, 1.59, 1.60 xen.spec, 1.251, 1.252

myoung myoung at fedoraproject.org
Sun Jun 20 17:38:50 UTC 2010


Author: myoung

Update of /cvs/pkgs/rpms/xen/F-12
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv17058

Modified Files:
	sources xen.spec 
Added Files:
	xen-dev-create-cleanup.patch 
Log Message:
remove some old device creation code that doesn't work with the latest pvops kernels


xen-dev-create-cleanup.patch:
 blktap/drivers/blktapctrl_linux.c |   24 -------
 libxc/xc_linux.c                  |  122 --------------------------------------
 libxc/xc_minios.c                 |    6 -
 libxc/xenctrl.h                   |   10 ---
 4 files changed, 5 insertions(+), 157 deletions(-)

--- NEW FILE xen-dev-create-cleanup.patch ---

# HG changeset patch
# User Keir Fraser <keir.fraser at citrix.com>
# Date 1276160957 -3600
# Node ID 985dcbf87197e8f5517ccf8658393cd74a09398c
# Parent c4b9a16c20a2f8795d3be0b03387c2d2f7c02e4b
libxc: Remove obsolete xc_find_device_number() declaration.

Signed-off-by: Keir Fraser <keir.fraser at citrix.com>
xen-unstable changeset:   21528:d4a91417a023
xen-unstable date:        Fri Jun 04 10:46:32 2010 +0100


tools: assume that special Xen devices have been created by the platform

Remove all the magic surrounding the special Xen devices in Linux
specific code whereby we attempt to figure out what the correct
major:minor number is and check the the existing device has these
numbers etc. In 2010 we really should be able to trust that the
platform has created the devices correctly or provide correct
configuration settings such that they are without resorting to tearing
down the platform configured state and rebuilding it.

tools/hotplug/Linux/xen-backend.rules already contains the necessary
udev rules to create /dev/xen/evtchn and friends in the correct place.

Signed-off-by: Ian Campbell <ian.campbell at citrix.com>
xen-unstable changeset:   21507:a3bdee5a20da
xen-unstable date:        Wed Jun 02 10:54:32 2010 +0100

--- a/tools/blktap/drivers/blktapctrl_linux.c	Tue Jun 08 12:00:22 2010 +0100
+++ b/tools/blktap/drivers/blktapctrl_linux.c	Thu Jun 10 10:09:17 2010 +0100
@@ -79,31 +79,11 @@ int blktap_interface_create(int ctlfd, i
 
 int blktap_interface_open(void)
 {
-	char *devname;
-	int ret;
 	int ctlfd;
 
-	/* Attach to blktap0 */
-	if (asprintf(&devname,"%s/%s0", BLKTAP_DEV_DIR, BLKTAP_DEV_NAME) == -1)
-		goto open_failed;
-
-	ret = xc_find_device_number("blktap0");
-	if (ret < 0) {
-		DPRINTF("couldn't find device number for 'blktap0'\n");
-		goto open_failed;
-	}
-
-	blktap_major = major(ret);
-	make_blktap_dev(devname,blktap_major, 0);
-
-	ctlfd = open(devname, O_RDWR);
-	if (ctlfd == -1) {
+	ctlfd = open(BLKTAP_DEV_DIR "/" BLKTAP_DEV_NAME "0", O_RDWR);
+	if (ctlfd == -1)
 		DPRINTF("blktap0 open failed\n");
-		goto open_failed;
-	}
 
 	return ctlfd;
-
-open_failed:
-	return -1;
 }
--- a/tools/libxc/xc_linux.c	Tue Jun 08 12:00:22 2010 +0100
+++ b/tools/libxc/xc_linux.c	Thu Jun 10 10:09:17 2010 +0100
@@ -167,102 +167,11 @@ int do_xen_hypercall(int xc_handle, priv
                       (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"
+#define DEVXEN "/dev/xen/"
 
 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;
-    }
-
-    return fd;
+    return open(DEVXEN "evtchn", O_RDWR);
 }
 
 int xc_evtchn_close(int xce_handle)
@@ -376,34 +285,9 @@ void discard_file_cache(int fd, int flus
     errno = saved_errno;
 }
 
-#define GNTTAB_DEV_NAME "/dev/xen/gntdev"
-
 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;
-    }
-    
-    return fd;
+    return open(DEVXEN "gntdev", O_RDWR);
 }
 
 int xc_gnttab_close(int xcg_handle)
--- a/tools/libxc/xc_minios.c	Tue Jun 08 12:00:22 2010 +0100
+++ b/tools/libxc/xc_minios.c	Thu Jun 10 10:09:17 2010 +0100
@@ -126,12 +126,6 @@ int do_xen_hypercall(int xc_handle, priv
         return -1;
     }
     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)
--- a/tools/libxc/xenctrl.h	Tue Jun 08 12:00:22 2010 +0100
+++ b/tools/libxc/xenctrl.h	Thu Jun 10 10:09:17 2010 +0100
@@ -96,16 +96,6 @@ int xc_interface_close(int xc_handle);
 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
  */
 



Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/xen/F-12/sources,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -p -r1.59 -r1.60
--- sources	1 Jun 2010 20:44:48 -0000	1.59
+++ sources	20 Jun 2010 17:38:50 -0000	1.60
@@ -3,4 +3,4 @@ bf8f1f9e3ca83d732c00a79a6ef29bc4  newlib
 36cc57650cffda9a0269493be2a169bb  lwip-1.3.0.tar.gz
 cec05e7785497c5e19da2f114b934ffd  pciutils-2.2.9.tar.bz2
 debc62758716a169df9f62e6ab2bc634  zlib-1.2.3.tar.gz
-cbe84c44bc156ad1b4a20dc1c73464b8  xen-3.4.3.tar.gz
+f8d001eb9e08525c451d38deb93908b1  xen-3.4.3.tar.gz


Index: xen.spec
===================================================================
RCS file: /cvs/pkgs/rpms/xen/F-12/xen.spec,v
retrieving revision 1.251
retrieving revision 1.252
diff -u -p -r1.251 -r1.252
--- xen.spec	1 Jun 2010 20:44:49 -0000	1.251
+++ xen.spec	20 Jun 2010 17:38:50 -0000	1.252
@@ -6,11 +6,11 @@
 Summary: Xen is a virtual machine monitor
 Name:    xen
 Version: 3.4.3
-Release: 1%{?dist}
+Release: 2%{?dist}
 Group:   Development/Libraries
 License: GPLv2+ and LGPLv2+ and BSD
 URL:     http://xen.org/
-Source0: http://bits.xensource.com/oss-xen/release/3.4.0/xen-%{version}.tar.gz
+Source0: http://bits.xensource.com/oss-xen/release/3.4.3/xen-%{version}.tar.gz
 Source1: %{name}.modules
 Source2: %{name}.logrotate
 Source3: dom0-kernel.repo
@@ -37,6 +37,8 @@ Patch5: xen-net-disable-iptables-on-brid
 
 Patch10: xen-no-werror.patch
 
+Patch15: xen-dev-create-cleanup.patch
+
 Patch100: xen-configure-xend.patch
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
@@ -141,6 +143,8 @@ which manage Xen virtual machines.
 
 %patch10 -p1
 
+%patch15 -p1
+
 %patch100 -p1
 
 # stubdom sources
@@ -456,6 +460,11 @@ rm -rf %{buildroot}
 %{_libdir}/*.so
 
 %changelog
+* Sun Jun 20 2010 Michael Young <m.a.young at durham.ac.uk> - 3.4.3-2
+- add patch to remove some old device creation code that doesn't
+  work with the latest pvops kernels
+- use official xen-3.4.3.tar.gz now there is one
+
 * Tue Jun 1 2010 Michael Young <m.a.young at durham.ac.uk> - 3.4.3-1
 - update to 3.4.3 release including
     support for latest pv_ops kernels (possibly incomplete)



More information about the scm-commits mailing list