fix virtio-net for win guests
PATCH 1/1 fix virtio-net for win guests
This is a quick-n-dirty bandaid to let virtio-net to work on windows again. Merely removing newly added stuff (max_virtqueue_pairs) from struct virtio_net_config makes fixes it. Note this field of the structure is not actually used, as far as I can see - it is write-only, so it shouldn't affect anything, but it lets win guests to run with virtio-net and hence allows for wider testing.
--- hw/virtio-net.c | 2 +- hw/virtio-net.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
hw/virtio-net.c +1 -1
@@ -102,7 +102,7 @@ static void virtio_net_get_config(VirtIODevice *vdev, uint8_t *config)struct virtio_net_config netcfg;stw_p (&netcfg.status, n->status); -stw_p (&netcfg.max_virtqueue_pairs, n->max_queues); +//XXX doesnotwork stw_p(&netcfg.max_virtqueue_pairs, n->max_queues); memcpy (netcfg.mac, n->mac,ETH_ALEN );memcpy (config, &netcfg,sizeof (netcfg)); }
hw/virtio-net.h +1 -1
@@ -76,7 +76,7 @@ struct virtio_net_config/* See VIRTIO_NET_F_STATUS and VIRTIO_NET_S_* above */ uint16_t status;/* Max virtqueue pairs supported by the device */ -uint16_t max_virtqueue_pairs; +//XXXX doesnotwork uint16_t max_virtqueue_pairs; }QEMU_PACKED ;/*
Signature · 1 line
1.7.10.4
Quoted 8 lines · Michael Tokarev
This is a quick-n-dirty bandaid to let virtio-net to work on windows again. Merely removing newly added stuff (
max_virtqueue_pairs) from structvirtio_net_configmakes fixes it. Note this field of the structure is not actually used, as far as I can see - it is write-only, so it shouldn't affect anything, but it lets win guests to run with virtio-net and hence allows for wider testing.Signed-off-by Michael Tokarev <[email protected]>
It's write-only because it's read by the guest.
I just sent a series that should give us a reasonable work around. I'm pretty confident that the guest driver is misbehaving. I don't think it's reasonable to disable mq by default just because there's a broken driver out there.
However, with my series, existing guests that are using a fixed machine model should work with no changes.
Regards,
Anthony Liguori
Quoted 33 lines
--- hw/virtio-net.c | 2 +- hw/virtio-net.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)hw/virtio-net.c +1
-1@@ -102,7 +102,7 @@ static void virtio_net_get_config(VirtIODevice *vdev, uint8_t *config)struct virtio_net_config netcfg;stw_p (&netcfg.status, n->status); -stw_p (&netcfg.max_virtqueue_pairs, n->max_queues); +//XXX doesnotwork stw_p(&netcfg.max_virtqueue_pairs, n->max_queues); memcpy (netcfg.mac, n->mac,ETH_ALEN );memcpy (config, &netcfg,sizeof (netcfg)); }hw/virtio-net.h +1
-1@@ -76,7 +76,7 @@ struct virtio_net_config/* See VIRTIO_NET_F_STATUS and VIRTIO_NET_S_* above */ uint16_t status;/* Max virtqueue pairs supported by the device */ -uint16_t max_virtqueue_pairs; +//XXXX doesnotwork uint16_t max_virtqueue_pairs; }QEMU_PACKED ;/* Signature · 1 line
1.7.10.4