Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nwuuv-0006aV-41 for qemu-devel@nongnu.org; Wed, 31 Mar 2010 06:12:57 -0400 Received: from [140.186.70.92] (port=34764 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nwuus-0006YB-V4 for qemu-devel@nongnu.org; Wed, 31 Mar 2010 06:12:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NwuuN-0001PT-5k for qemu-devel@nongnu.org; Wed, 31 Mar 2010 06:12:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51342) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NwuuM-0001PE-UY for qemu-devel@nongnu.org; Wed, 31 Mar 2010 06:12:23 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2VACIm1029190 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 31 Mar 2010 06:12:19 -0400 From: Juan Quintela In-Reply-To: <9535ae3ce401266d194f05c122a93f8e627f5b6f.1270022701.git.shaharh@redhat.com> (Shahar Havivi's message of "Wed, 31 Mar 2010 11:16:14 +0300") References: <9535ae3ce401266d194f05c122a93f8e627f5b6f.1270022701.git.shaharh@redhat.com> Date: Wed, 31 Mar 2010 12:12:15 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: [Qemu-devel] Re: [PATCH 1/2] Support for multiple keyboard devices List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Shahar Havivi Cc: qemu-devel@nongnu.org Shahar Havivi 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.