mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-23 13:05:45 +00:00
f4d41d600b
When there are no available descriptors in the queue (observed when the network interface hasn't been brought up by the kernel) stop waiting for notifications that the TAP fd should be read from. This avoids a situation where the TAP device has data avaiable and wakes up the virtio-net thread only for the virtio-net thread not read that data as it has nowhere to put it. When there are descriptors available in the queue then we resume waiting for the epoll event on the TAP fd. This bug demonstrated itself as 100% CPU usage for cloud-hypervisor binary prior to the guest network interface being brought up. The solution was inspired by the Firecracker virtio-net code. Fixes: #208 Signed-off-by: Rob Bradford <robert.bradford@intel.com>