diff mbox series

[v3,09/46] hw/arm/virt: use pci_init_nic_devices()

Message ID 20240108204909.564514-10-dwmw2@infradead.org
State New
Headers show
Series Rework matching of network devices to -nic options | expand

Commit Message

David Woodhouse Jan. 8, 2024, 8:26 p.m. UTC
From: David Woodhouse <dwmw@amazon.co.uk>

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 hw/arm/virt.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Thomas Huth Jan. 26, 2024, 3:30 p.m. UTC | #1
On 08/01/2024 21.26, David Woodhouse wrote:
> From: David Woodhouse <dwmw@amazon.co.uk>
> 
> Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
> ---
>   hw/arm/virt.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index 2793121cb4..8cf9237001 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -1454,9 +1454,7 @@ static void create_pcie(VirtMachineState *vms)
>       pci->bypass_iommu = vms->default_bus_bypass_iommu;
>       vms->bus = pci->bus;
>       if (vms->bus) {
> -        for (i = 0; i < nb_nics; i++) {
> -            pci_nic_init_nofail(&nd_table[i], pci->bus, mc->default_nic, NULL);
> -        }
> +        pci_init_nic_devices(pci->bus, mc->default_nic);
>       }
>   
>       nodename = vms->pciehb_nodename = g_strdup_printf("/pcie@%" PRIx64, base);

Reviewed-by: Thomas Huth <thuth@redhat.com>
diff mbox series

Patch

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 2793121cb4..8cf9237001 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -1454,9 +1454,7 @@  static void create_pcie(VirtMachineState *vms)
     pci->bypass_iommu = vms->default_bus_bypass_iommu;
     vms->bus = pci->bus;
     if (vms->bus) {
-        for (i = 0; i < nb_nics; i++) {
-            pci_nic_init_nofail(&nd_table[i], pci->bus, mc->default_nic, NULL);
-        }
+        pci_init_nic_devices(pci->bus, mc->default_nic);
     }
 
     nodename = vms->pciehb_nodename = g_strdup_printf("/pcie@%" PRIx64, base);