mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-21 14:19:49 +08:00
fix(host): arm vm virtio-net-pci without addr
This commit is contained in:
@@ -270,7 +270,9 @@ func (s *SKVMGuestInstance) generateArmStartScript(data *jsonutils.JSONDict) (st
|
||||
} else {
|
||||
cmd += nicCmd
|
||||
}
|
||||
cmd += s.getVnicDesc(nics[i])
|
||||
// aarch64 with addr lead to:
|
||||
// virtio_net: probe of virtioN failed with error -22
|
||||
cmd += s.getVnicDesc(nics[i], false)
|
||||
}
|
||||
|
||||
if isolatedDevsParams != nil {
|
||||
|
||||
@@ -276,7 +276,7 @@ func (s *SKVMGuestInstance) getNicAddr(index int) int {
|
||||
return s.GetDiskAddr(pciBase + index)
|
||||
}
|
||||
|
||||
func (s *SKVMGuestInstance) getVnicDesc(nic jsonutils.JSONObject) string {
|
||||
func (s *SKVMGuestInstance) getVnicDesc(nic jsonutils.JSONObject, withAddr bool) string {
|
||||
bridge, _ := nic.GetString("bridge")
|
||||
ifname, _ := nic.GetString("ifname")
|
||||
driver, _ := nic.GetString("driver")
|
||||
@@ -290,7 +290,9 @@ func (s *SKVMGuestInstance) getVnicDesc(nic jsonutils.JSONObject) string {
|
||||
cmd += fmt.Sprintf(",netdev=%s", ifname)
|
||||
cmd += fmt.Sprintf(",mac=%s", mac)
|
||||
|
||||
cmd += fmt.Sprintf(",addr=0x%x", s.getNicAddr(int(index)))
|
||||
if withAddr {
|
||||
cmd += fmt.Sprintf(",addr=0x%x", s.getNicAddr(int(index)))
|
||||
}
|
||||
if driver == "virtio" {
|
||||
if nic.Contains("vectors") {
|
||||
cmd += fmt.Sprintf(",vectors=%d", vectors)
|
||||
@@ -617,7 +619,7 @@ function nic_mtu() {
|
||||
} else {
|
||||
cmd += nicCmd
|
||||
}
|
||||
cmd += s.getVnicDesc(nics[i])
|
||||
cmd += s.getVnicDesc(nics[i], true)
|
||||
}
|
||||
|
||||
if isolatedDevsParams != nil {
|
||||
|
||||
Reference in New Issue
Block a user