mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-13 07:55:20 +00:00
d4316d0228
In order to let a separate process open a TAP device and pass the file descriptor through the control message mechanism, this patch adds the support for sending a file descriptor over to the Cloud Hypervisor process along with the add-net HTTP API command. The implementation uses the NetConfig structure mutably to update the list of fds with the one passed through control message. The list should always be empty prior to this, as it makes no sense to provide a list of fds once the Cloud Hypervisor process has already been started. It is important to note that reboot is supported since the file descriptor is duplicated upon receival, letting the VM only use the duplicated one. The original file descriptor is kept open in order to support a potential reboot. Fixes #2525 Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>