mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vhost-user_net, vm-virtio, vmm: Permit host MAC address setting
Add a new "host_mac" parameter to "--net" and "--net-backend" and use this to set the MAC address on the tap interface. If no address is given one is randomly assigned and is stored in the config. Support for vhost-user-net self spawning was also included. Fixes: #1177 Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
@@ -1463,8 +1463,13 @@ impl DeviceManager {
|
||||
.args(&[
|
||||
"--net-backend",
|
||||
&format!(
|
||||
"ip={},mask={},socket={},num_queues={},queue_size={}",
|
||||
net_cfg.ip, net_cfg.mask, &sock, net_cfg.num_queues, net_cfg.queue_size
|
||||
"ip={},mask={},socket={},num_queues={},queue_size={},host_mac={}",
|
||||
net_cfg.ip,
|
||||
net_cfg.mask,
|
||||
&sock,
|
||||
net_cfg.num_queues,
|
||||
net_cfg.queue_size,
|
||||
net_cfg.host_mac
|
||||
),
|
||||
])
|
||||
.spawn()
|
||||
@@ -1529,6 +1534,7 @@ impl DeviceManager {
|
||||
None,
|
||||
None,
|
||||
Some(net_cfg.mac),
|
||||
Some(net_cfg.host_mac),
|
||||
net_cfg.iommu,
|
||||
net_cfg.num_queues,
|
||||
net_cfg.queue_size,
|
||||
@@ -1543,6 +1549,7 @@ impl DeviceManager {
|
||||
Some(net_cfg.ip),
|
||||
Some(net_cfg.mask),
|
||||
Some(net_cfg.mac),
|
||||
Some(net_cfg.host_mac),
|
||||
net_cfg.iommu,
|
||||
net_cfg.num_queues,
|
||||
net_cfg.queue_size,
|
||||
|
||||
Reference in New Issue
Block a user