Management can delete the host tap device of a running VM while QEMU still holds its fds, e.g. OpenStack unplugs the VIF of an instance it is deleting before the domain is gone. QEMU should carry on with a dead link. Instead:
- a multiqueue virtio-net NIC aborts on an assert as soon as the guest changes the number of queue pairs or resets the device (patch 1); - every tap netdev makes the main loop spin at full CPU in tap_send() (patch 2). The two patches are independent. Each adds a case to tests/qtest/virtio-net-test.c that fails without its fix. Creating the tap needs CAP_NET_ADMIN, so both cases are skipped when not run as root. Signed-off-by: Denis V. Lunev <[email protected]> Cc: "Michael S. Tsirkin" <[email protected]> Cc: Jason Wang <[email protected]> Cc: Vladimir Sementsov-Ogievskiy <[email protected]> Cc: Fabiano Rosas <[email protected]> Cc: Laurent Vivier <[email protected]> Cc: Paolo Bonzini <[email protected]> Denis V. Lunev (2): virtio-net: fix abort in virtio_net_set_queue_pairs() on a deleted tap net/tap: fix busy loop in tap_send() after the tap device is deleted hw/net/virtio-net.c | 25 +++-- net/tap.c | 8 ++ tests/qtest/virtio-net-test.c | 174 ++++++++++++++++++++++++++++++++++ 3 files changed, 200 insertions(+), 7 deletions(-) base-commit: 76fdb3373c9a27b3f50ecc9e012cbdeb90af7151 -- 2.53.0
