From patchwork Wed Feb 8 15:02:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 140151 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id F24DCB71B2 for ; Thu, 9 Feb 2012 02:02:50 +1100 (EST) Received: from localhost ([::1]:60286 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rv92f-0000X0-4h for incoming@patchwork.ozlabs.org; Wed, 08 Feb 2012 10:02:41 -0500 Received: from eggs.gnu.org ([140.186.70.92]:57015) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rv92O-0000WH-Mf for qemu-devel@nongnu.org; Wed, 08 Feb 2012 10:02:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rv92G-0003Vo-L4 for qemu-devel@nongnu.org; Wed, 08 Feb 2012 10:02:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:2496) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rv92G-0003Vb-AG for qemu-devel@nongnu.org; Wed, 08 Feb 2012 10:02:16 -0500 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 q18F2F5S018263 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 8 Feb 2012 10:02:15 -0500 Received: from rincewind.home.kraxel.org (ovpn-116-33.ams2.redhat.com [10.36.116.33]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q18F2Dfd014402; Wed, 8 Feb 2012 10:02:13 -0500 Received: by rincewind.home.kraxel.org (Postfix, from userid 500) id 4CFDA4144E; Wed, 8 Feb 2012 16:02:12 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Wed, 8 Feb 2012 16:02:11 +0100 Message-Id: <1328713331-30985-1-git-send-email-kraxel@redhat.com> 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. X-Received-From: 209.132.183.28 Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH v2] nic: zap obsolote romloading bits from ne2k + pcnet X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org These days one just needs to specify the romfile in PCiDeviceInfo and everything magically works. It also allows to disable pxe rom loading via "romfile=" like it is possible for all other nics. [ v2: rebased & adapted to qom changes ] Signed-off-by: Gerd Hoffmann --- hw/ne2000.c | 9 +-------- hw/pcnet-pci.c | 9 +-------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/hw/ne2000.c b/hw/ne2000.c index 080811e..c4b574d 100644 --- a/hw/ne2000.c +++ b/hw/ne2000.c @@ -763,14 +763,6 @@ static int pci_ne2000_init(PCIDevice *pci_dev) object_get_typename(OBJECT(pci_dev)), pci_dev->qdev.id, s); qemu_format_nic_info_str(&s->nic->nc, s->c.macaddr.a); - if (!pci_dev->qdev.hotplugged) { - static int loaded = 0; - if (!loaded) { - rom_add_option("pxe-ne2k_pci.rom", -1); - loaded = 1; - } - } - add_boot_device_path(s->c.bootindex, &pci_dev->qdev, "/ethernet-phy@0"); return 0; @@ -798,6 +790,7 @@ static void ne2000_class_init(ObjectClass *klass, void *data) k->init = pci_ne2000_init; k->exit = pci_ne2000_exit; + k->romfile = "pxe-ne2k_pci.rom", k->vendor_id = PCI_VENDOR_ID_REALTEK; k->device_id = PCI_DEVICE_ID_REALTEK_8029; k->class_id = PCI_CLASS_NETWORK_ETHERNET; diff --git a/hw/pcnet-pci.c b/hw/pcnet-pci.c index 439f32c..6f4755d 100644 --- a/hw/pcnet-pci.c +++ b/hw/pcnet-pci.c @@ -330,14 +330,6 @@ static int pci_pcnet_init(PCIDevice *pci_dev) s->phys_mem_write = pci_physical_memory_write; s->dma_opaque = pci_dev; - if (!pci_dev->qdev.hotplugged) { - static int loaded = 0; - if (!loaded) { - rom_add_option("pxe-pcnet.rom", -1); - loaded = 1; - } - } - return pcnet_common_init(&pci_dev->qdev, s, &net_pci_pcnet_info); } @@ -360,6 +352,7 @@ static void pcnet_class_init(ObjectClass *klass, void *data) k->init = pci_pcnet_init; k->exit = pci_pcnet_uninit; + k->romfile = "pxe-pcnet.rom", k->vendor_id = PCI_VENDOR_ID_AMD; k->device_id = PCI_DEVICE_ID_AMD_LANCE; k->revision = 0x10;