From 27e57efe32f53a8788cd6b6b9b9bbc08446cc8ae Mon Sep 17 00:00:00 2001 From: Ladi Prosek Date: Thu, 3 Nov 2016 09:55:49 +0100 Subject: virtio: rename virtqueue_discard to virtqueue_unpop The function undoes the effect of virtqueue_pop and doesn't do anything destructive or irreversible so virtqueue_unpop is a more fitting name. Signed-off-by: Ladi Prosek Reviewed-by: Stefan Hajnoczi Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/net/virtio-net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hw/net/virtio-net.c') diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 06bfe4bcc9..20aa63e16c 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -1177,7 +1177,7 @@ static ssize_t virtio_net_receive(NetClientState *nc, const uint8_t *buf, size_t * must have consumed the complete packet. * Otherwise, drop it. */ if (!n->mergeable_rx_bufs && offset < size) { - virtqueue_discard(q->rx_vq, elem, total); + virtqueue_unpop(q->rx_vq, elem, total); g_free(elem); return size; } -- cgit 1.4.1 From 2a083ffd2e37ef08769749a5c7cfc6ca65c9f8ea Mon Sep 17 00:00:00 2001 From: "Michael S. Tsirkin" Date: Fri, 4 Nov 2016 12:27:52 +0200 Subject: virtio-net: mark VIRTIO_NET_F_GSO as legacy virtio 1.0 spec says this is a legacy feature bit, hide it from guests in modern mode. Note: for cross-version migration compatibility, we keep the bit set in host_features. The result will be that a guest migrating cross-version will see host features change under it. As guests only seem to read it once, this should not be an issue. Meanwhile, will work to fix guests to ignore this bit in virtio1 mode, too. Cc: qemu-stable@nongnu.org Signed-off-by: Michael S. Tsirkin Reviewed-by: Cornelia Huck --- hw/net/virtio-net.c | 1 + 1 file changed, 1 insertion(+) (limited to 'hw/net/virtio-net.c') diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 20aa63e16c..b68c69d8f6 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -1942,6 +1942,7 @@ static void virtio_net_class_init(ObjectClass *klass, void *data) vdc->guest_notifier_pending = virtio_net_guest_notifier_pending; vdc->load = virtio_net_load_device; vdc->save = virtio_net_save_device; + vdc->legacy_features |= (0x1 << VIRTIO_NET_F_GSO); } static const TypeInfo virtio_net_info = { -- cgit 1.4.1