VM Network Disconnected When Starting the VM
Symptom
After configuring the bridge for the cVM, the cVM is started successfully and its guest system can be accessed through virsh console. The NIC is initialized properly. However, the guest and host cannot communicate with each other using IP addresses.
Key Process and Cause Analysis
By default, QEMU enables the event_idx function for virtio-net devices. This reduces the number of times that VMs frequently exit and notify the backend of processing data, improving virtio-net performance. However, the virtCCA solution introduces SWIOTLB and additional processing on cVM exits, requiring secure–normal world transitions and increasing vring status synchronization latency between the front end and back end. In extreme cases, the back end may fail to update the vring status to the front end in a timely manner. Consequently, based on the event_idx mechanism, the front end does not send a kick. The backend host then remains in a sleep state, waiting for a kick, which results in a network deadlock.
Conclusion and Solution
- Access the cVM.
virsh console cvm_uefi
- Uninstall the driver.
rmmod virtio_net
- Reload the driver.
modprobe virtio_net
In stress tests such as frequently starting and destroying cVMs, you are advised to disable the event_idx mechanism of virtio-net to improve the virtio network stability. Refer to the default VM configuration in Startup with libvirt for NIC configuration.