1
Work around broken virtio drivers in 2.6.26
3
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
5
diff --git a/qemu/hw/virtio-net.c b/qemu/hw/virtio-net.c
6
index 9bce3a0..5b615f9 100644
7
--- a/qemu/hw/virtio-net.c
8
+++ b/qemu/hw/virtio-net.c
9
@@ -120,6 +120,9 @@ static uint32_t virtio_net_get_features(VirtIODevice *vdev)
11
if (tap_has_vnet_hdr(host)) {
12
tap_using_vnet_hdr(host, 1);
14
+ /* Stop advertising advanced features until we work around the fact
15
+ * that this is totally broken in 2.6.26 kernels */
16
features |= (1 << VIRTIO_NET_F_CSUM);
17
features |= (1 << VIRTIO_NET_F_GUEST_CSUM);
18
features |= (1 << VIRTIO_NET_F_GUEST_TSO4);
19
@@ -130,6 +133,7 @@ static uint32_t virtio_net_get_features(VirtIODevice *vdev)
20
features |= (1 << VIRTIO_NET_F_HOST_ECN);
21
features |= (1 << VIRTIO_NET_F_MRG_RXBUF);
22
/* Kernel can't actually handle UFO in software currently. */
27
@@ -374,8 +378,14 @@ static int receive_header(VirtIONet *n, struct iovec *iov, int iovcnt,
28
struct virtio_net_hdr *hdr = iov[0].iov_base;
33
hdr->gso_type = VIRTIO_NET_HDR_GSO_NONE;
35
+ /* we need to clear out the whole header, including any garbage that may be
37
+ memset(hdr, 0, sizeof(*hdr));
41
if (tap_has_vnet_hdr(n->vc->vlan->first_client)) {