feat(host): startvm: set vpc nic mtu

Windows DHCP client does not respect DHCP MTU option
This commit is contained in:
Yousong Zhou
2020-12-17 19:05:54 +08:00
parent 0139611d14
commit 319d2cc563
+4
View File
@@ -277,6 +277,7 @@ func (s *SKVMGuestInstance) getNicAddr(index int) int {
}
func (s *SKVMGuestInstance) getVnicDesc(nic jsonutils.JSONObject) string {
bridge, _ := nic.GetString("bridge")
ifname, _ := nic.GetString("ifname")
driver, _ := nic.GetString("driver")
mac, _ := nic.GetString("mac")
@@ -295,6 +296,9 @@ func (s *SKVMGuestInstance) getVnicDesc(nic jsonutils.JSONObject) string {
cmd += fmt.Sprintf(",vectors=%d", vectors)
}
cmd += fmt.Sprintf("$(nic_speed %d)", bw)
if bridge == options.HostOptions.OvnIntegrationBridge {
cmd += fmt.Sprintf("$(nic_mtu %q)", bridge)
}
}
return cmd
}