(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");
{
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)