From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=38016 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OO6K9-0008DN-TA for qemu-devel@nongnu.org; Mon, 14 Jun 2010 05:51:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OO6J6-000080-O9 for qemu-devel@nongnu.org; Mon, 14 Jun 2010 05:50:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38085) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OO6J6-00007o-Dy for qemu-devel@nongnu.org; Mon, 14 Jun 2010 05:50:16 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5E9oFm3010326 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 14 Jun 2010 05:50:15 -0400 Message-ID: <4C15FB4F.5030104@redhat.com> Date: Mon, 14 Jun 2010 11:50:07 +0200 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 2/2] Return usb device to host on exit References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Shahar Havivi Cc: qemu-devel@nongnu.org > @@ -1066,6 +1077,7 @@ USBDevice *usb_host_device_open(const char *devname) > qdev_prop_set_uint32(&dev->qdev, "vendorid", filter.vendor_id); > qdev_prop_set_uint32(&dev->qdev, "productid", filter.product_id); > qdev_init_nofail(&dev->qdev); > + atexit(usb_host_cleanup); > return dev; You'll register atexit multiple times here (once per device). I still think this should use exit notifiers, see http://patchwork.ozlabs.org/patch/54571/ (doesn't apply cleanly and more, will post a rebased version later today). cheers, Gerd