diff -u kvm-79+dfsg/debian/rules kvm-79+dfsg/debian/rules --- kvm-79+dfsg/debian/rules +++ kvm-79+dfsg/debian/rules @@ -104,7 +104,7 @@ $(MAKE) -C qemu/pc-bios clean $(MAKE) -C vgabios clean $(MAKE) clean - rm -f qemu/pc-bios/*.bin extboot/*.o extboot/extboot.img extboot/extboot.bin extboot/signrom config.mak user/config.mak user/test/lib/.*.d user/test/lib/*/.*.d kernel/config.kbuild #vgabios/vbetables.h vgabios/vgabios.txt vgabios/vgabios.debug.txt vgabios/vgabios.cirrus.txt vgabios/vgabios.cirrus.debug.txt vgabios/*.bin vgabios/vbetables-gen vgabios/biossums + rm -f qemu/pc-bios/*.bin extboot/*.o extboot/extboot.img extboot/extboot.bin extboot/signrom config.mak user/config.mak user/test/lib/.*.d user/test/lib/*/.*.d kernel/config.kbuild vgabios/vbetables.h vgabios/vgabios.txt vgabios/vgabios.debug.txt vgabios/vgabios.cirrus.txt vgabios/vgabios.cirrus.debug.txt vgabios/*.bin vgabios/vbetables-gen vgabios/biossums dh_clean diff -u kvm-79+dfsg/debian/changelog kvm-79+dfsg/debian/changelog --- kvm-79+dfsg/debian/changelog +++ kvm-79+dfsg/debian/changelog @@ -1,3 +1,12 @@ +kvm (1:79+dfsg-0ubuntu5) jaunty; urgency=low + + * debian/patches/usb_sys.patch: Use /sys rather than /proc (LP: #156085) + * debian/patches/anon_inodes_fix.patch: Dropped, now upstream + * debian/patches/series: Updated accordingly + * debian/rules: clean up vgabios build bits + + -- Dustin Kirkland Thu, 18 Dec 2008 17:03:23 -0600 + kvm (1:79+dfsg-0ubuntu4) jaunty; urgency=low * Correctly rename kvm-nbd man page to match the binary's name. diff -u kvm-79+dfsg/debian/patches/series kvm-79+dfsg/debian/patches/series --- kvm-79+dfsg/debian/patches/series +++ kvm-79+dfsg/debian/patches/series @@ -13,3 +13,3 @@ -anon_inodes_fix.patch evdev_keycode_map.patch dkmsify.patch +usb_sys.patch reverted: --- kvm-79+dfsg/debian/patches/anon_inodes_fix.patch +++ kvm-79+dfsg.orig/debian/patches/anon_inodes_fix.patch @@ -1,28 +0,0 @@ -commit 5c646ce7bfb0eb0a108a09f08a3854a27c11cdaf -Author: Nikola Ciprich -Date: Wed Jul 30 18:10:47 2008 +0200 - - kvm: external module: anon_inodes compat for 2.6.26 - - Signed-off-by: Avi Kivity - -diff --git a/kernel/anon_inodes.c b/kernel/anon_inodes.c -index 6cf91ab..510303f 100644 ---- a/kernel/anon_inodes.c -+++ b/kernel/anon_inodes.c -@@ -245,6 +245,15 @@ int kvm_anon_inode_getfd(const char *name, - return fd; - } - -+#elif LINUX_VERSION_CODE == KERNEL_VERSION(2,6,26) -+ -+int kvm_anon_inode_getfd(const char *name, -+ const struct file_operations *fops, -+ void *priv, int flags) -+{ -+ return anon_inode_getfd(name, fops, priv); -+} -+ - #else - - int kvm_anon_inode_getfd(const char *name, only in patch2: unchanged: --- kvm-79+dfsg.orig/debian/patches/usb_sys.patch +++ kvm-79+dfsg/debian/patches/usb_sys.patch @@ -0,0 +1,221 @@ +# This patch fixes: +# https://bugs.edge.launchpad.net/ubuntu/+source/kvm/+bug/156085 +# It was obtained from: +# https://bugzilla.novell.com/show_bug.cgi?id=241950 +# And ported to Ubuntu by Dustin Kirkland + +diff -upr kvm-79+dfsg/qemu/usb-linux.c kvm-79+dfsg.new/qemu/usb-linux.c +--- kvm-79+dfsg/qemu/usb-linux.c 2008-11-12 05:48:01.000000000 -0600 ++++ kvm-79+dfsg.new/qemu/usb-linux.c 2008-12-18 15:43:27.000000000 -0600 +@@ -76,11 +76,12 @@ static int usb_host_find_device(int *pbu + #define dprintf printf + #else + #define dprintf(...) +-#endif ++#endif return (USBDevice *)dev; + + #define USBDBG_DEVOPENED "husb: opened %s/devices\n" + + #define USBPROCBUS_PATH "/proc/bus/usb" ++#define USBDEVFS_PATH "/dev/bus/usb" + #define PRODUCT_NAME_SZ 32 + #define MAX_ENDPOINTS 16 + #define USBDEVBUS_PATH "/dev/bus/usb" +@@ -1040,113 +1041,103 @@ int usb_host_device_close(const char *de + return -1; + } + +-static int get_tag_value(char *buf, int buf_size, +- const char *str, const char *tag, +- const char *stopchars) +-{ +- const char *p; +- char *q; +- p = strstr(str, tag); +- if (!p) +- return -1; +- p += strlen(tag); +- while (isspace(*p)) +- p++; +- q = buf; +- while (*p != '\0' && !strchr(stopchars, *p)) { +- if ((q - buf) < (buf_size - 1)) +- *q++ = *p; +- p++; +- } +- *q = '\0'; +- return q - buf; +-} +- + /* +- * Use /proc/bus/usb/devices or /dev/bus/usb/devices file to determine +- * host's USB devices. This is legacy support since many distributions +- * are moving to /sys/bus/usb ++ * Use /sys/bus/usb/devices or /dev/bus/usb/devices file to determine ++ * host's USB devices. + */ + static int usb_host_scan_dev(void *opaque, USBScanFunc *func) + { + FILE *f = 0; + char line[1024]; +- char buf[1024]; +- int bus_num, addr, speed, device_count, class_id, product_id, vendor_id; ++ int bus_num, addr, speed, class_id, product_id, vendor_id; + char product_name[512]; + int ret = 0; ++ DIR* d; ++ struct dirent* de; + +- if (!usb_host_device_path) { +- perror("husb: USB Host Device Path not set"); +- goto the_end; +- } +- snprintf(line, sizeof(line), "%s/devices", usb_host_device_path); +- f = fopen(line, "r"); +- if (!f) { +- perror("husb: cannot open devices file"); +- goto the_end; ++ d = opendir("/sys/bus/usb/devices"); ++ if (!d) { ++ term_printf("Could not open /sys/bus/usb/devices\n"); ++ return 0; + } +- +- device_count = 0; +- bus_num = addr = speed = class_id = product_id = vendor_id = 0; +- for(;;) { +- if (fgets(line, sizeof(line), f) == NULL) +- break; +- if (strlen(line) > 0) +- line[strlen(line) - 1] = '\0'; +- if (line[0] == 'T' && line[1] == ':') { +- if (device_count && (vendor_id || product_id)) { +- /* New device. Add the previously discovered device. */ +- ret = func(opaque, bus_num, addr, class_id, vendor_id, +- product_id, product_name, speed); +- if (ret) +- goto the_end; +- } +- if (get_tag_value(buf, sizeof(buf), line, "Bus=", " ") < 0) +- goto fail; +- bus_num = atoi(buf); +- if (get_tag_value(buf, sizeof(buf), line, "Dev#=", " ") < 0) +- goto fail; +- addr = atoi(buf); +- if (get_tag_value(buf, sizeof(buf), line, "Spd=", " ") < 0) +- goto fail; +- if (!strcmp(buf, "480")) +- speed = USB_SPEED_HIGH; +- else if (!strcmp(buf, "1.5")) +- speed = USB_SPEED_LOW; +- else ++ while ((de = readdir(d))) { ++ if (de->d_name[0] != '.' && ! strchr(de->d_name, ':')) { ++ char filename[PATH_MAX]; ++ char* tmpstr = de->d_name; ++ if (!strncmp(de->d_name, "usb", 3)) ++ tmpstr += 3; ++ bus_num = atoi(tmpstr); ++ snprintf(filename, PATH_MAX, "/sys/bus/usb/devices/%s/devnum", de->d_name); ++ f = fopen(filename, "r"); ++ if (!f) { ++ term_printf("Could not open %s\n", filename); ++ return 0; ++ } ++ fgets(line, sizeof(line), f); ++ fclose(f); ++ addr = atoi(line); ++ snprintf(filename, PATH_MAX, "/sys/bus/usb/devices/%s/bDeviceClass", de->d_name); ++ f = fopen(filename, "r"); ++ if (!f) { ++ term_printf("Could not open %s\n", filename); ++ return 0; ++ } ++ fgets(line, sizeof(line), f); ++ fclose(f); ++ class_id = strtoul(line, NULL, 16); ++ snprintf(filename, PATH_MAX, "/sys/bus/usb/devices/%s/idVendor", de->d_name); ++ f = fopen(filename, "r"); ++ if (!f) { ++ term_printf("Could not open %s\n", filename); ++ return 0; ++ } ++ fgets(line, sizeof(line), f); ++ fclose(f); ++ vendor_id = strtoul(line, NULL, 16); ++ snprintf(filename, PATH_MAX, "/sys/bus/usb/devices/%s/idProduct", de->d_name); ++ f = fopen(filename, "r"); ++ if (!f) { ++ term_printf("Could not open %s\n", filename); ++ return 0; ++ } ++ fgets(line, sizeof(line), f); ++ fclose(f); ++ product_id = strtoul(line, NULL, 16); ++ snprintf(filename, PATH_MAX, "/sys/bus/usb/devices/%s/product", de->d_name); ++ f = fopen(filename, "r"); ++ if (f) { ++ fgets(line, sizeof(line), f); ++ fclose(f); ++ if (strlen(line) > 0) ++ line[strlen(line) - 1] = '\0'; ++ pstrcpy(product_name, sizeof(product_name), line); ++ } else ++ *product_name = 0; ++ snprintf(filename, PATH_MAX, "/sys/bus/usb/devices/%s/speed", de->d_name); ++ f = fopen(filename, "r"); ++ if (!f) { ++ term_printf("Could not open %s\n", filename); ++ return 0; ++ } ++ fgets(line, sizeof(line), f); ++ fclose(f); ++ if (!strcmp(line, "480\n")) ++ speed = USB_SPEED_HIGH; ++ else if (!strcmp(line, "1.5\n")) ++ speed = USB_SPEED_LOW; ++ else + speed = USB_SPEED_FULL; +- product_name[0] = '\0'; +- class_id = 0xff; +- device_count++; +- product_id = 0; +- vendor_id = 0; +- } else if (line[0] == 'P' && line[1] == ':') { +- if (get_tag_value(buf, sizeof(buf), line, "Vendor=", " ") < 0) +- goto fail; +- vendor_id = strtoul(buf, NULL, 16); +- if (get_tag_value(buf, sizeof(buf), line, "ProdID=", " ") < 0) +- goto fail; +- product_id = strtoul(buf, NULL, 16); +- } else if (line[0] == 'S' && line[1] == ':') { +- if (get_tag_value(buf, sizeof(buf), line, "Product=", "") < 0) +- goto fail; +- pstrcpy(product_name, sizeof(product_name), buf); +- } else if (line[0] == 'D' && line[1] == ':') { +- if (get_tag_value(buf, sizeof(buf), line, "Cls=", " (") < 0) +- goto fail; +- class_id = strtoul(buf, NULL, 16); +- } +- fail: ; +- } +- if (device_count && (vendor_id || product_id)) { +- /* Add the last device. */ +- ret = func(opaque, bus_num, addr, class_id, vendor_id, +- product_id, product_name, speed); +- } ++ ++ ret = func(opaque, bus_num, addr, class_id, vendor_id, ++ product_id, product_name, speed); ++ if (ret) ++ goto the_end; ++ } ++ } ++ + the_end: + if (f) +- fclose(f); ++ closedir(d); + return ret; + } +