From patchwork Thu Jan 26 10:45:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 137901 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 5968DB6F99 for ; Thu, 26 Jan 2012 21:45:51 +1100 (EST) Received: from localhost ([::1]:51765 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RqMpw-000345-I4 for incoming@patchwork.ozlabs.org; Thu, 26 Jan 2012 05:45:48 -0500 Received: from eggs.gnu.org ([140.186.70.92]:35844) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RqMpk-00033w-UC for qemu-devel@nongnu.org; Thu, 26 Jan 2012 05:45:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RqMpg-0001wy-Fb for qemu-devel@nongnu.org; Thu, 26 Jan 2012 05:45:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46043) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RqMpg-0001wt-6a for qemu-devel@nongnu.org; Thu, 26 Jan 2012 05:45:32 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q0QAjUQ2031852 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 26 Jan 2012 05:45:31 -0500 Received: from rincewind.home.kraxel.org (ovpn-116-32.ams2.redhat.com [10.36.116.32]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q0QAjSCN011388; Thu, 26 Jan 2012 05:45:29 -0500 Message-ID: <4F212EC7.3010500@redhat.com> Date: Thu, 26 Jan 2012 11:45:27 +0100 From: Gerd Hoffmann User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111104 Red Hat/3.1.16-2.el6_1 Thunderbird/3.1.16 MIME-Version: 1.0 To: Markus Armbruster References: In-Reply-To: X-Enigmail-Version: 1.1.2 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Gerhard Wiesinger , qemu-devel@nongnu.org Subject: Re: [Qemu-devel] [PATCH] network: Added option to disable NIC option roms 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 On 01/26/12 08:45, Markus Armbruster wrote: > Gerhard Wiesinger writes: > >> Option ROM for network interface cards (NICs) can now explicitly disabled >> with romfile=disabled (or romfile=no or romfile=none) parameter. >> With hotplugable NICs (currently NE2000, PCNET) romfile=(empty) didn't work. >> This patch disables Option ROMs for iPXE for alls supported NICs >> (hotplugable and non hotplugable). > > And now filenames "disabled", "no" and "none" don't work. > > Any way to fix "romfile="? Sure. cheers, Gerd From 4c17b5a36e6228536318e06a18a41166ff8356c5 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Thu, 26 Jan 2012 11:40:07 +0100 Subject: [PATCH] nic: zap obsolote romloading bits from ne2k + pcnet 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. 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 62e082f..83328bb 100644 --- a/hw/ne2000.c +++ b/hw/ne2000.c @@ -763,14 +763,6 @@ static int pci_ne2000_init(PCIDevice *pci_dev) pci_dev->qdev.info->name, 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; @@ -792,6 +784,7 @@ static PCIDeviceInfo ne2000_info = { .qdev.vmsd = &vmstate_pci_ne2000, .init = pci_ne2000_init, .exit = pci_ne2000_exit, + .romfile = "pxe-ne2k_pci.rom", .vendor_id = PCI_VENDOR_ID_REALTEK, .device_id = PCI_DEVICE_ID_REALTEK_8029, .class_id = PCI_CLASS_NETWORK_ETHERNET, diff --git a/hw/pcnet-pci.c b/hw/pcnet-pci.c index 4e164da..2f333e2 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); } @@ -355,6 +347,7 @@ static PCIDeviceInfo pcnet_info = { .qdev.vmsd = &vmstate_pci_pcnet, .init = pci_pcnet_init, .exit = pci_pcnet_uninit, + .romfile = "pxe-pcnet.rom", .vendor_id = PCI_VENDOR_ID_AMD, .device_id = PCI_DEVICE_ID_AMD_LANCE, .revision = 0x10,