Blame SOURCES/kvm-virtio_net-copy-VIRTIO_NET_S_ANNOUNCE-if-device-mode.patch

7f1c5b
From b3d728b53abaae0c9884dfb5e9c216b1088196e3 Mon Sep 17 00:00:00 2001
7f1c5b
From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= <eperezma@redhat.com>
7f1c5b
Date: Wed, 21 Dec 2022 12:50:13 +0100
7f1c5b
Subject: [PATCH 2/9] virtio_net: copy VIRTIO_NET_S_ANNOUNCE if device model
7f1c5b
 has it
7f1c5b
MIME-Version: 1.0
7f1c5b
Content-Type: text/plain; charset=UTF-8
7f1c5b
Content-Transfer-Encoding: 8bit
7f1c5b
7f1c5b
RH-Author: Eugenio Pérez <eperezma@redhat.com>
7f1c5b
RH-MergeRequest: 137: vDPA net SVQ guest announce support
7f1c5b
RH-Bugzilla: 2141088
7f1c5b
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
7f1c5b
RH-Acked-by: Cindy Lu <lulu@redhat.com>
7f1c5b
RH-Acked-by: Jason Wang <jasowang@redhat.com>
7f1c5b
RH-Commit: [2/4] fb04186829eb93bab3c9ececf90fa5b035ffa2ec (eperezmartin/qemu-kvm)
7f1c5b
7f1c5b
Status part of the emulated feature. It will follow device model, so we
7f1c5b
must copy it as long as NIC device model has it set.
7f1c5b
7f1c5b
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
7f1c5b
Message-Id: <20221221115015.1400889-3-eperezma@redhat.com>
7f1c5b
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
7f1c5b
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
7f1c5b
Acked-by: Jason Wang <jasowang@redhat.com>
7f1c5b
(cherry picked from commit 4f93aafc8f9d731c6588f5dc5594c6a1dd1fbe66)
7f1c5b
---
7f1c5b
 hw/net/virtio-net.c | 2 ++
7f1c5b
 1 file changed, 2 insertions(+)
7f1c5b
7f1c5b
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
7f1c5b
index 5935e55653..948bcf33cf 100644
7f1c5b
--- a/hw/net/virtio-net.c
7f1c5b
+++ b/hw/net/virtio-net.c
7f1c5b
@@ -183,6 +183,8 @@ static void virtio_net_get_config(VirtIODevice *vdev, uint8_t *config)
7f1c5b
             memcpy(netcfg.mac, n->mac, ETH_ALEN);
7f1c5b
         }
7f1c5b
 
7f1c5b
+        netcfg.status |= virtio_tswap16(vdev,
7f1c5b
+                                        n->status & VIRTIO_NET_S_ANNOUNCE);
7f1c5b
         memcpy(config, &netcfg, n->config_size);
7f1c5b
     }
7f1c5b
 }
7f1c5b
-- 
7f1c5b
2.31.1
7f1c5b