]> xenbits.xensource.com Git - xenclient/ioemu.git/commitdiff
Fix the condition when we stat xenmgr key file.
authorJean Guyader <jean.guyader@eu.citrix.com>
Tue, 9 Dec 2008 01:50:38 +0000 (01:50 +0000)
committerJean Guyader <jean.guyader@eu.citrix.com>
Tue, 9 Dec 2008 01:50:38 +0000 (01:50 +0000)
Remove the support of keyboard passthrough for dom0_driver.

dom0_driver.c

index ed2bf9d0c2c74790b20994e64712c36b0c67203d..1b69d72b671d63484109ef415fabe04a8c88f4f6 100644 (file)
@@ -260,9 +260,9 @@ static void dom0_driver_detect_secure_auth(int keycode)
         (driver.key_status[KEY_BACKSPACE]))
     {
         struct stat s;
-        
+
         DEBUG("Received SAS keystroke\n");
-        if (stat("/var/lib/xenmgr/keys", &s) != 0)
+        if (stat("/var/lib/xenmgr/keys", &s) == 0)
             dom0_driver_redirect_fds(dom0_read_secure);
         else
             DEBUG("xenmgr file is not there\n");
@@ -473,43 +473,27 @@ static void dom0_gr_devices(int grab, int controller)
 {
     int         st = 0;
     int *fd = 0;
-    int (*fn_grab)(int, int) = NULL;
 
-    if (kbd_passthrough == 2)
-        fn_grab = pt_i8042_grab;
-    else if (kbd_passthrough == 1)
-        fn_grab = kbd_host_grab;
+    if (controller == DOM0_MOUSE)
+        fd = driver.mouse_fds;
+    if (controller == DOM0_KEYBOARD)
+        fd = driver.keyboard_fds;
+    assert(fd != NULL);
 
-    if (fn_grab)
-    {
-        if (controller == DOM0_MOUSE)
-            st = fn_grab(1, grab);
-        else
-            st = fn_grab(0, grab);
-    }
-    else
+    while (*fd != -1)
     {
-        if (controller == DOM0_MOUSE)
-            fd = driver.mouse_fds;
-        if (controller == DOM0_KEYBOARD)
-            fd = driver.keyboard_fds;
-        assert(fd != NULL);
-
-        while (*fd != -1)
+        if (ioctl(*fd, EVIOCGRAB, grab) == -1)
         {
-            if (ioctl(*fd, EVIOCGRAB, grab) == -1)
-            {
-                DEBUG("Try to %s on %d\n", 1 ? "grab" : "release", *fd);
-                return;
-            }
-            DEBUG("%s succed %d\n", grab ? "grab" : "release", *fd);
-
-            if (grab)
-                qemu_set_fd_handler(*fd, dom0_read, NULL, fd);
-            else
-                qemu_set_fd_handler(*fd, NULL, NULL, fd);
-            fd++;
+            DEBUG("Try to %s on %d\n", 1 ? "grab" : "release", *fd);
+            return;
         }
+        DEBUG("%s succed %d\n", grab ? "grab" : "release", *fd);
+
+        if (grab)
+            qemu_set_fd_handler(*fd, dom0_read, NULL, fd);
+        else
+            qemu_set_fd_handler(*fd, NULL, NULL, fd);
+        fd++;
     }
 
     if (controller == DOM0_MOUSE && !vga_passthrough)