From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=41426 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PLeU4-0007wW-5T for qemu-devel@nongnu.org; Thu, 25 Nov 2010 11:15:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PLeU3-000323-8R for qemu-devel@nongnu.org; Thu, 25 Nov 2010 11:15:44 -0500 Received: from mx1.redhat.com ([209.132.183.28]:32894) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PLeU3-00030c-1P for qemu-devel@nongnu.org; Thu, 25 Nov 2010 11:15:43 -0500 Message-ID: <4CEE8BA5.7020900@redhat.com> Date: Thu, 25 Nov 2010 17:15:33 +0100 From: Gerd Hoffmann MIME-Version: 1.0 References: <20101125153455.GA4097@amt.cnet> In-Reply-To: <20101125153455.GA4097@amt.cnet> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: PATCH: QEMU support for UHCI suspend / remote wake up List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcelo Tosatti Cc: Matthew Garrett , Adam Jackson , qemu-devel@nongnu.org, kvm , Glauber de Oliveira Costa Hi, > + dev->info->remote_wakeup_cb = uhci_event; > diff --git a/hw/usb.h b/hw/usb.h > index 00d2802..16de1c9 100644 > --- a/hw/usb.h > +++ b/hw/usb.h > @@ -189,6 +189,11 @@ struct USBDeviceInfo { > */ > int (*handle_data)(USBDevice *dev, USBPacket *p); > > + /* > + * Process remote wakeup request. > + */ > + void (*remote_wakeup_cb)(USBDevice *dev); > + No way. DeviceInfo holds informations about the device *implementation*. Multiple instances will share that, placing runtime data there is just plain wrong. Also this is a callback from the usb device to the usb host adapter, not the other way around. I'd suggest to create a USBBusOps for host adapter callbacks and and stick it into USBBus. cheers, Gerd