From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37458) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VLrXF-0006v4-KV for qemu-devel@nongnu.org; Tue, 17 Sep 2013 05:25:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VLrX8-0006wf-2u for qemu-devel@nongnu.org; Tue, 17 Sep 2013 05:25:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54671) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VLrX7-0006wY-RC for qemu-devel@nongnu.org; Tue, 17 Sep 2013 05:25:22 -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.14.4/8.14.4) with ESMTP id r8H9PLOd010151 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 17 Sep 2013 05:25:21 -0400 Date: Tue, 17 Sep 2013 12:27:33 +0300 From: "Michael S. Tsirkin" Message-ID: <20130917092733.GE18186@redhat.com> References: <1378211609-16121-1-git-send-email-pbonzini@redhat.com> <1378211609-16121-18-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1378211609-16121-18-git-send-email-pbonzini@redhat.com> Subject: Re: [Qemu-devel] [PATCH 17/38] e1000: use instance_finalize instead of exit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org On Tue, Sep 03, 2013 at 02:33:08PM +0200, Paolo Bonzini wrote: > Signed-off-by: Paolo Bonzini > --- > hw/net/e1000.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/hw/net/e1000.c b/hw/net/e1000.c > index f5ebed4..55fb062 100644 > --- a/hw/net/e1000.c > +++ b/hw/net/e1000.c > @@ -1310,9 +1310,9 @@ e1000_cleanup(NetClientState *nc) > } > > static void > -pci_e1000_uninit(PCIDevice *dev) > +pci_e1000_instance_finalize(Object *obj) > { > - E1000State *d = E1000(dev); > + E1000State *d = E1000(obj); > > timer_del(d->autoneg_timer); > timer_free(d->autoneg_timer); So this looks wrong. This cancels timers after pci device has been destroyed, so meanwhile timers can run and send interrupts. > @@ -1394,7 +1394,6 @@ static void e1000_class_init(ObjectClass *klass, void *data) > PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); > > k->init = pci_e1000_init; > - k->exit = pci_e1000_uninit; > k->romfile = "efi-e1000.rom"; > k->vendor_id = PCI_VENDOR_ID_INTEL; > k->device_id = E1000_DEVID; > @@ -1412,6 +1411,7 @@ static const TypeInfo e1000_info = { > .parent = TYPE_PCI_DEVICE, > .instance_size = sizeof(E1000State), > .class_init = e1000_class_init, > + .instance_finalize = pci_e1000_instance_finalize, > }; > > static void e1000_register_types(void) > -- > 1.8.3.1 >