Skip to content

net: fix abort and busy loop when the tap device is deleted

Denis V. Lunev qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2virtio-net: fix abort in virtio_net_set_queue_pairs() on a deleted taphw/net/virtio-net.c tests/qtest/virtio-net-test.c+122 -70 replies
2/2net/tap: fix busy loop in tap_send() after the tap device is deletednet/tap.c tests/qtest/virtio-net-test.c+78 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] net: fix abort and busy loop when the tap device is deleted

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.

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

Signature · 1 line
2.53.0