소스 검색

Fixed vmmouse_detect SIGSEGV in x11-drivers/xf86-input-vmmouse

The patch obsoletes a vmmouse_detect wrapper that was used previously,
and enables seamless mouse in QEMU-KVM (#380907).
Maxim Kammerer 12 년 전
부모
커밋
e3dadacdff

+ 2 - 0
doc/changelog.txt

@@ -1,6 +1,8 @@
 2012-10-XX
   + 2012.4 release
 
+  * Better support for QEMU mouse virtualization
+
   * Added UFRaw, a RAW images viewer and converter
   * Added proxychains, a heterogeneous chaining proxyfier
 

+ 3 - 2
src/etc/init.d/fbinit

@@ -20,9 +20,10 @@ start() {
             # Support only video= parameters without driver:/output: qualification
             # /usr/src/linux/Documentation/fb/modedb.txt
             if [ "${param}" != "${param#video=}" -a "${param}" = "${param#*:}" ]; then
-                # Use our vmmouse_detect wrapper to detect VMware
+                # Use virt-what to detect VMware
                 # (VMware card is not enough, e.g., QEMU: "Hardware has no pitchlock")
-                if vmmouse_detect; then
+                vm=`virt-what 2>/dev/null`
+                if [ "${vm}" = vmware ]; then
                     einfo "Initializing VMware framebuffer"
                     modprobe -b vmwgfx enable_fbdev=1
                     eend $?

+ 14 - 0
src/etc/portage/patches/x11-drivers/xf86-input-vmmouse/sigsegv-iopl.patch

@@ -0,0 +1,14 @@
+--- a/tools/vmmouse_detect.c
++++ b/tools/vmmouse_detect.c
+@@ -47,6 +47,11 @@ main(void)
+    signal(SIGSEGV, segvCB);
+ 
+ #if defined __i386__ || defined __x86_64__ 
++   /*
++    * To access i/o ports above 0x3ff, we need to be in iopl(3).
++    */
++
++   iopl(3);
+    if (VMMouseClient_Enable()) {
+       VMMouseClient_Disable();
+       return 0;

+ 1 - 2
src/root/setup

@@ -492,8 +492,7 @@ dconf update
 
 
 sinfo "Installing wrappers"
-ln -sf ../local/libexec/proxyresolv.wrapper    /usr/bin/proxyresolv
-ln -sf ../local/libexec/vmmouse_detect.wrapper /usr/bin/vmmouse_detect
+ln -sf ../local/libexec/proxyresolv.wrapper /usr/bin/proxyresolv
 
 
 sinfo "Building kernel modules"

+ 0 - 13
src/usr/local/libexec/vmmouse_detect.wrapper

@@ -1,13 +0,0 @@
-#!/bin/sh -e
-
-# Use virt-what instead of the segfaulting supplied binary
-# in xf86-input-vmmouse
-
-vm=`/usr/sbin/virt-what 2>/dev/null`
-
-case "${vm}" in
-    vmware)
-        ;;
-    *)
-        exit 1
-esac