On Tue, Aug 6, 2024 at 8:58 AM Cindy Lu <l...@redhat.com> wrote:
>
> The vdpa device with MAC address 0 should not boot.
> So remove the check here
>
> Signed-off-by: Cindy Lu <l...@redhat.com>

Please describe what issues you've seen, and how it is fixed by this commit.

Thanks

> ---
>  hw/net/virtio-net.c | 13 -------------
>  1 file changed, 13 deletions(-)
>
> diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
> index c144ae2e78..8a7c743ad3 100644
> --- a/hw/net/virtio-net.c
> +++ b/hw/net/virtio-net.c
> @@ -142,7 +142,6 @@ static void virtio_net_get_config(VirtIODevice *vdev, 
> uint8_t *config)
>      VirtIONet *n = VIRTIO_NET(vdev);
>      struct virtio_net_config netcfg;
>      NetClientState *nc = qemu_get_queue(n->nic);
> -    static const MACAddr zero = { .a = { 0, 0, 0, 0, 0, 0 } };
>
>      int ret = 0;
>      memset(&netcfg, 0 , sizeof(struct virtio_net_config));
> @@ -170,18 +169,6 @@ static void virtio_net_get_config(VirtIODevice *vdev, 
> uint8_t *config)
>          if (ret == -1) {
>              return;
>          }
> -
> -        /*
> -         * Some NIC/kernel combinations present 0 as the mac address.  As 
> that
> -         * is not a legal address, try to proceed with the address from the
> -         * QEMU command line in the hope that the address has been configured
> -         * correctly elsewhere - just not reported by the device.
> -         */
> -        if (memcmp(&netcfg.mac, &zero, sizeof(zero)) == 0) {
> -            info_report("Zero hardware mac address detected. Ignoring.");
> -            memcpy(netcfg.mac, n->mac, ETH_ALEN);
> -        }
> -
>          netcfg.status |= virtio_tswap16(vdev,
>                                          n->status & VIRTIO_NET_S_ANNOUNCE);
>          memcpy(config, &netcfg, n->config_size);
> --
> 2.45.0
>


Reply via email to