From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gerd Hoffmann Subject: Re: PATCH: QEMU support for UHCI suspend / remote wake up Date: Thu, 25 Nov 2010 17:15:33 +0100 Message-ID: <4CEE8BA5.7020900@redhat.com> References: <20101125153455.GA4097@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: qemu-devel@nongnu.org, kvm , Matthew Garrett , Adam Jackson , Glauber de Oliveira Costa To: Marcelo Tosatti Return-path: Received: from mx1.redhat.com ([209.132.183.28]:38921 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753632Ab0KYQPq (ORCPT ); Thu, 25 Nov 2010 11:15:46 -0500 In-Reply-To: <20101125153455.GA4097@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: 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