From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Fjkv7-0006rI-Tz for qemu-devel@nongnu.org; Fri, 26 May 2006 18:36:37 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Fjkv6-0006oh-1y for qemu-devel@nongnu.org; Fri, 26 May 2006 18:36:37 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fjkv5-0006oN-PA for qemu-devel@nongnu.org; Fri, 26 May 2006 18:36:35 -0400 Received: from [24.93.47.40] (helo=ms-smtp-01.texas.rr.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Fjl04-00063j-M1 for qemu-devel@nongnu.org; Fri, 26 May 2006 18:41:44 -0400 Received: from [192.168.0.11] (cpe-67-9-160-120.austin.res.rr.com [67.9.160.120]) by ms-smtp-01.texas.rr.com (8.13.6/8.13.6) with ESMTP id k4QMaWp6028486 for ; Fri, 26 May 2006 17:36:33 -0500 (CDT) Message-ID: <447782ED.5010407@austin.rr.com> Date: Fri, 26 May 2006 17:36:29 -0500 From: Lonnie Mendez MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------050002050705070305010709" Subject: [Qemu-devel] [usb] call destroy for usb devices upon removal from guest Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------050002050705070305010709 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit lo list. The attached patch calls the cleanup message destroy when the device is detached by the user from the guest. --------------050002050705070305010709 Content-Type: text/plain; name="qemu-usb-destroy.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="qemu-usb-destroy.diff" --- qemu/hw/usb-hub.c 2006-05-25 18:58:51.000000000 -0500 +++ qemu/hw/usb-hub.c 2006-05-26 16:47:47.000000000 -0500 @@ -194,7 +194,6 @@ /* send the detach message */ dev->handle_packet(dev, USB_MSG_DETACH, 0, 0, NULL, 0); - port->port.dev = NULL; } } } --- qemu/hw/usb-uhci.c 2006-05-22 12:17:06.000000000 -0500 +++ qemu/hw/usb-uhci.c 2006-05-26 15:41:48.000000000 -0500 @@ -355,7 +355,6 @@ dev->handle_packet(dev, USB_MSG_DETACH, 0, 0, NULL, 0); } - port->port.dev = NULL; } } --- qemu/hw/usb-ohci.c 2006-05-25 18:37:07.000000000 -0500 +++ qemu/hw/usb-ohci.c 2006-05-26 16:58:03.000000000 -0500 @@ -308,7 +308,6 @@ dev->handle_packet(dev, USB_MSG_DETACH, 0, 0, NULL, 0); } - port->port.dev = NULL; dprintf("usb-ohci: Detached port %d\n", port1->index); } --- qemu/vl.c 2006-05-25 18:58:51.000000000 -0500 +++ qemu/vl.c 2006-05-26 15:42:55.000000000 -0500 @@ -3313,6 +3313,7 @@ { USBPort *port; USBPort **lastp; + USBDevice *dev; int bus_num, addr; const char *p; @@ -3339,6 +3340,9 @@ *lastp = port->next; usb_attach(port, NULL); + dev = port->dev; + dev->handle_packet(dev, USB_MSG_DESTROY, 0, 0, NULL, 0); + port->dev = NULL; port->next = free_usb_ports; free_usb_ports = port; return 0; --------------050002050705070305010709--