[PATCH 1/2] hw/arm/npcm7xx: Call qemu_configure_nic_device() for GMAC modules

Peter Maydell posted 2 patches 9 months, 3 weeks ago
Maintainers: Tyrone Ting <kfting@nuvoton.com>, Hao Wu <wuhaotsh@google.com>, Peter Maydell <peter.maydell@linaro.org>, Thomas Huth <thuth@redhat.com>, Laurent Vivier <lvivier@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>
[PATCH 1/2] hw/arm/npcm7xx: Call qemu_configure_nic_device() for GMAC modules
Posted by Peter Maydell 9 months, 3 weeks ago
The patchset adding the GMAC ethernet to this SoC crossed in the
mail with the patchset cleaning up the NIC handling. When we
create the GMAC modules we must call qemu_configure_nic_device()
so that the user has the opportunity to use the -nic commandline
option to create a network backend and connect it to the GMACs.

Add the missing call.

Fixes: 21e5326a7c ("hw/arm: Add GMAC devices to NPCM7XX SoC")
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/arm/npcm7xx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/arm/npcm7xx.c b/hw/arm/npcm7xx.c
index ff3ecde9043..cc68b5d8f12 100644
--- a/hw/arm/npcm7xx.c
+++ b/hw/arm/npcm7xx.c
@@ -710,6 +710,7 @@ static void npcm7xx_realize(DeviceState *dev, Error **errp)
     for (i = 0; i < ARRAY_SIZE(s->gmac); i++) {
         SysBusDevice *sbd = SYS_BUS_DEVICE(&s->gmac[i]);
 
+        qemu_configure_nic_device(DEVICE(sbd), false, NULL);
         /*
          * The device exists regardless of whether it's connected to a QEMU
          * netdev backend. So always instantiate it even if there is no
-- 
2.34.1
Re: [PATCH 1/2] hw/arm/npcm7xx: Call qemu_configure_nic_device() for GMAC modules
Posted by David Woodhouse 9 months, 3 weeks ago
On Tue, 2024-02-06 at 17:12 +0000, Peter Maydell wrote:
> The patchset adding the GMAC ethernet to this SoC crossed in the
> mail with the patchset cleaning up the NIC handling. When we
> create the GMAC modules we must call qemu_configure_nic_device()
> so that the user has the opportunity to use the -nic commandline
> option to create a network backend and connect it to the GMACs.
> 
> Add the missing call.
> 
> Fixes: 21e5326a7c ("hw/arm: Add GMAC devices to NPCM7XX SoC")
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>