mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: Allow IP configuration on named TAP interfaces
This commit changes existing behavior of named TAP interfaces. When booting a VM with configuration for a named TAP interface, cloud-hypervisor will create the interface and apply a given IP configuration to that interface. If the named interface already exists on the system, the configuration is NOT overwritten. Setting the ip and netmask fields in a tap interface configuration for a named tap interface now works by handing this configuration to the virtio_devices::Net object when it is created with a name. This commit also touches net_util to make sure that the ip configuration of existing TAP interfaces is not modified with ip or netmask handed to open_tap. Signed-off-by: Markus Sütter <markus.suetter@secunet.com>
This commit is contained in:
@@ -2464,8 +2464,8 @@ impl DeviceManager {
|
||||
virtio_devices::Net::new(
|
||||
id.clone(),
|
||||
Some(tap_if_name),
|
||||
None,
|
||||
None,
|
||||
Some(net_cfg.ip),
|
||||
Some(net_cfg.mask),
|
||||
Some(net_cfg.mac),
|
||||
&mut net_cfg.host_mac,
|
||||
net_cfg.mtu,
|
||||
|
||||
Reference in New Issue
Block a user