Shahar Havivi <shah...@redhat.com> wrote: > Currently you get segfault when trying to remove keyboard (device_del > monitor command) because no keyboard handling is done. > > This patch add QEMUPutKbdEntry structure, handling each keyboard entry. > Adding a keyboard add to the list, removing keyboard select the previous > keyboard in list.
> diff --git a/hw/xenfb.c b/hw/xenfb.c > index 422cd53..2c700bd 100644 > --- a/hw/xenfb.c > +++ b/hw/xenfb.c > @@ -373,7 +373,7 @@ static int input_connect(struct XenDevice *xendev) > if (rc != 0) > return rc; > > - qemu_add_kbd_event_handler(xenfb_key_event, in); > + qemu_add_kbd_event_handler(xenfb_key_event, in, "Xen Keyboard"); > in->qmouse = qemu_add_mouse_event_handler(xenfb_mouse_event, in, > in->abs_pointer_wanted, > "Xen PVFB Mouse"); > @@ -388,7 +388,7 @@ static void input_disconnect(struct XenDevice *xendev) > qemu_remove_mouse_event_handler(in->qmouse); > in->qmouse = NULL; > } > - qemu_add_kbd_event_handler(NULL, NULL); > + qemu_add_kbd_event_handler(NULL, NULL, NULL); > common_unbind(&in->c); > } > xen code changes with this patch. You need to store the event handler somewhere to be able to remove it later, no? Later, Juan.