nic: zap obsolote romloading bits from ne2k + pcnet
PATCH 1/1 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=<emptystring>" like it is possible for all other nics.
Signed-off-by Gerd Hoffmann <[email protected]>
--- hw/ne2000.c | 9 +-------- hw/pcnet-pci.c | 9 +-------- 2 files changed, 2 insertions(+), 16 deletions(-)
hw/ne2000.c +1 -8
@@ -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,
hw/pcnet-pci.c +1 -8
@@ -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,
Signature · 1 line
1.7.1
Quoted 5 lines · Gerd Hoffmann
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=<emptystring>" like it is possible for all other nics.
Signed-off-by Gerd Hoffmann<[email protected]>
This needs rebasing.
Regards,
Anthony Liguori
Quoted 59 lines
--- hw/ne2000.c | 9 +-------- hw/pcnet-pci.c | 9 +-------- 2 files changed, 2 insertions(+), 16 deletions(-)hw/ne2000.c +1
-8@@ -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,hw/pcnet-pci.c +1
-8@@ -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,