Skip to content

Commit

Permalink
fix(host): make sure it won't match vpc guests by accident
Browse files Browse the repository at this point in the history
  • Loading branch information
yousong committed Dec 1, 2020
1 parent 65bf8ec commit 1ee1493
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/hostman/guestman/qemu-kvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -994,10 +994,13 @@ func (s *SKVMGuestInstance) ExecSuspendTask(ctx context.Context) {
func (s *SKVMGuestInstance) GetNicDescMatch(mac, ip, port, bridge string) jsonutils.JSONObject {
nics, _ := s.Desc.GetArray("nics")
for _, nic := range nics {
nicBridge, _ := nic.GetString("bridge")
if bridge == "" && nicBridge != "" && nicBridge == options.HostOptions.OvnIntegrationBridge {
continue
}
nicMac, _ := nic.GetString("mac")
nicIp, _ := nic.GetString("ip")
nicPort, _ := nic.GetString("ifname")
nicBridge, _ := nic.GetString("bridge")
if (len(mac) == 0 || netutils2.MacEqual(nicMac, mac)) &&
(len(ip) == 0 || nicIp == ip) &&
(len(port) == 0 || nicPort == port) &&
Expand Down

0 comments on commit 1ee1493

Please sign in to comment.