virtio-net: handle virtio_net_flush_tx() errors
commitfa5e56c2a73501427203c34d702fccc2fbcb5eab
authorGreg Kurz <groug@kaod.org>
Fri, 30 Sep 2016 15:13:32 +0000 (30 17:13 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Sun, 9 Oct 2016 22:16:59 +0000 (10 01:16 +0300)
tree8de836b6cdcca8fd05fb24c3e5f41c4f82c73d46
parentba10b9c0038e201d7ea28a9e3908928439ff7fa4
virtio-net: handle virtio_net_flush_tx() errors

All these errors are caused by a buggy guest: let's switch the device to
the broken state instead of terminating QEMU. Also we detach the element
from the virtqueue and free it.

If this happens, virtio_net_flush_tx() also returns -EINVAL, so that all
callers can stop processing the virtqueue immediatly.

Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/net/virtio-net.c