From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=37957 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Og2a2-0004b1-Rh for qemu-devel@nongnu.org; Mon, 02 Aug 2010 17:29:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Og2a1-0002nh-J2 for qemu-devel@nongnu.org; Mon, 02 Aug 2010 17:29:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51852) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Og2a1-0002nZ-B5 for qemu-devel@nongnu.org; Mon, 02 Aug 2010 17:29:53 -0400 From: Alex Williamson In-Reply-To: <20100802211121.5497.36512.stgit@localhost6.localdomain6> References: <20100802211121.5497.36512.stgit@localhost6.localdomain6> Content-Type: text/plain; charset="UTF-8" Date: Mon, 02 Aug 2010 15:29:49 -0600 Message-ID: <1280784589.6598.86.camel@x201> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH] e1000: Fix hotplug List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: glommer@redhat.com rtl8139 has the same problem, except there's a much bigger pile of code in rtl8139_reset()? I think maybe we need to revisit this wholesale remove of reset calls from init functions, unless I'm missing how hotplug is supposed to work. Thanks, Alex On Mon, 2010-08-02 at 15:15 -0600, Alex Williamson wrote: > When we removed the call to e1000_reset() back in cset c1699988, we > left some register state uninitialized. When we hotplug the device, > we don't go through a reset cycle, which means a hot added e1000 is > useless until the VM reboots. Duplicate the bits we need from > e1000_reset(). > > Signed-off-by: Alex Williamson > --- > > 0.13 candidate? > > hw/e1000.c | 4 ++++ > 1 files changed, 4 insertions(+), 0 deletions(-) > > diff --git a/hw/e1000.c b/hw/e1000.c > index 80b78bc..eb323d2 100644 > --- a/hw/e1000.c > +++ b/hw/e1000.c > @@ -1129,6 +1129,10 @@ static int pci_e1000_init(PCIDevice *pci_dev) > checksum = (uint16_t) EEPROM_SUM - checksum; > d->eeprom_data[EEPROM_CHECKSUM_REG] = checksum; > > + memmove(d->phy_reg, phy_reg_init, sizeof phy_reg_init); > + memmove(d->mac_reg, mac_reg_init, sizeof mac_reg_init); > + d->rxbuf_min_shift = 1; > + > d->nic = qemu_new_nic(&net_e1000_info, &d->conf, > d->dev.qdev.info->name, d->dev.qdev.id, d); > >