From patchwork Mon Aug 2 21:15:17 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Williamson X-Patchwork-Id: 60670 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id F3C53B6F06 for ; Tue, 3 Aug 2010 07:16:13 +1000 (EST) Received: from localhost ([127.0.0.1]:44020 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Og2Mi-0006ZW-E7 for incoming@patchwork.ozlabs.org; Mon, 02 Aug 2010 17:16:08 -0400 Received: from [140.186.70.92] (port=40288 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Og2Ly-0006ZR-QY for qemu-devel@nongnu.org; Mon, 02 Aug 2010 17:15:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Og2Lx-0000fr-LG for qemu-devel@nongnu.org; Mon, 02 Aug 2010 17:15:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:8103) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Og2Lx-0000fc-D8 for qemu-devel@nongnu.org; Mon, 02 Aug 2010 17:15:21 -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.13.8/8.13.8) with ESMTP id o72LFIHZ012933 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 2 Aug 2010 17:15:19 -0400 Received: from localhost6.localdomain6 (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o72LFHAX018436; Mon, 2 Aug 2010 17:15:17 -0400 From: Alex Williamson To: qemu-devel@nongnu.org, anthony@codemonkey.ws Date: Mon, 02 Aug 2010 15:15:17 -0600 Message-ID: <20100802211121.5497.36512.stgit@localhost6.localdomain6> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: alex.williamson@redhat.com, glommer@redhat.com Subject: [Qemu-devel] [PATCH] e1000: Fix hotplug X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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);