virtio_net: copy VIRTIO_NET_S_ANNOUNCE if device model has it
authorEugenio Pérez <eperezma@redhat.com>
Wed, 21 Dec 2022 11:50:13 +0000 (12:50 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Sun, 8 Jan 2023 06:54:21 +0000 (01:54 -0500)
Status part of the emulated feature. It will follow device model, so we
must copy it as long as NIC device model has it set.

Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Message-Id: <20221221115015.1400889-3-eperezma@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
hw/net/virtio-net.c

index b30038d1301f52889717ec326db32b4de665b831..122eac25eee4e8a90ea8d87b72c136848f494c39 100644 (file)
@@ -183,6 +183,8 @@ static void virtio_net_get_config(VirtIODevice *vdev, uint8_t *config)
             memcpy(netcfg.mac, n->mac, ETH_ALEN);
         }
 
+        netcfg.status |= virtio_tswap16(vdev,
+                                        n->status & VIRTIO_NET_S_ANNOUNCE);
         memcpy(config, &netcfg, n->config_size);
     }
 }