mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: allow net devices without ip and mask
This change enables easier integration with third-party tools by removing the requirement for a dummy IP address when configuring tap devices. The modification applies to both CLI and API interactions. Previously, cloud-hypervisor would automatically set a default static IP address (192.168.249.1) if none was provided. This could lead to: * multiple devices without explicit IP configurations would end up with the same default IP * unnecessary inclusion of this IP in firewall rules * the IP address could clash with host networking and routing This introduces a new constraint: When providing an IP, the mask must also be provided. Removes warnings introduced in #7179. Closes issue #7083. Signed-off-by: Maximilian Güntner <code@mguentner.de>
This commit is contained in:
committed by
Rob Bradford
parent
d28d9eb34e
commit
66aa0743f0
14
src/main.rs
14
src/main.rs
@@ -1336,20 +1336,6 @@ mod unit_tests {
|
||||
}"#,
|
||||
true,
|
||||
),
|
||||
(
|
||||
vec![
|
||||
"cloud-hypervisor", "--kernel", "/path/to/kernel",
|
||||
"--net",
|
||||
"mac=12:34:56:78:90:ab,host_mac=34:56:78:90:ab:cd,tap=tap0,ip=1.2.3.4",
|
||||
],
|
||||
r#"{
|
||||
"payload": {"kernel": "/path/to/kernel"},
|
||||
"net": [
|
||||
{"mac": "12:34:56:78:90:ab", "host_mac": "34:56:78:90:ab:cd", "tap": "tap0", "ip": "1.2.3.4"}
|
||||
]
|
||||
}"#,
|
||||
true,
|
||||
),
|
||||
(
|
||||
vec![
|
||||
"cloud-hypervisor", "--kernel", "/path/to/kernel",
|
||||
|
||||
Reference in New Issue
Block a user