diff mbox series

[6/7] virtio_net: copy VIRTIO_NET_S_ANNOUNCE if device model has it

Message ID 20221020103429.347525-7-eperezma@redhat.com (mailing list archive)
State New, archived
Headers show
Series Guest announce feature emulation using Shadow VirtQueue | expand

Commit Message

Eugenio Perez Martin Oct. 20, 2022, 10:34 a.m. UTC
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>
---
 hw/net/virtio-net.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 51fe6d5c1a..49674dcf32 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -180,6 +180,7 @@  static void virtio_net_get_config(VirtIODevice *vdev, uint8_t *config)
             netcfg.status |= VIRTIO_NET_S_LINK_UP;
         }
 
+        netcfg.status |= (n->status & VIRTIO_NET_S_ANNOUNCE);
         memcpy(config, &netcfg, n->config_size);
     }
 }