qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH RFC v4 14/16] virtio-net: no writeable mac for virti


From: Cornelia Huck
Subject: [Qemu-devel] [PATCH RFC v4 14/16] virtio-net: no writeable mac for virtio-1
Date: Thu, 27 Nov 2014 16:16:47 +0100

Devices operating as virtio 1.0 may not allow writes to the mac
address in config space.

Signed-off-by: Cornelia Huck <address@hidden>
---
 hw/net/virtio-net.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 1e214b5..ad477bf 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -87,6 +87,7 @@ static void virtio_net_set_config(VirtIODevice *vdev, const 
uint8_t *config)
     memcpy(&netcfg, config, n->config_size);
 
     if (!(vdev->guest_features[0] >> VIRTIO_NET_F_CTRL_MAC_ADDR & 1) &&
+        !(vdev->guest_features[1] >> (VIRTIO_F_VERSION_1 - 32) & 1) &&
         memcmp(netcfg.mac, n->mac, ETH_ALEN)) {
         memcpy(n->mac, netcfg.mac, ETH_ALEN);
         qemu_format_nic_info_str(qemu_get_queue(n->nic), n->mac);
-- 
1.7.9.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]