Merge pull request #2452 from tb365/bugfix/tb-host-metric-fix-0821

add update vm name method
This commit is contained in:
yunion-ci-robot
2019-08-22 08:10:07 +08:00
committed by GitHub
6 changed files with 10 additions and 0 deletions
+5
View File
@@ -177,6 +177,7 @@ func (s *SGuestMonitorCollector) GetGuests() map[string]*SGuestMonitor {
gm, ok := s.monitors[guestId]
if ok && gm.Pid == pid {
delete(s.monitors, guestId)
gm.UpdateVmName(guestName)
gm.UpdateNicsDesc(nics)
gm.UpdateCpuCount(int(vcpuCount))
} else {
@@ -401,6 +402,10 @@ func NewGuestMonitor(name, id string, pid int, nics []jsonutils.JSONObject, cpuC
return &SGuestMonitor{name, id, pid, nics, cpuCount, ip, proc}, nil
}
func (m *SGuestMonitor) UpdateVmName(name string) {
m.Name = name
}
func (m *SGuestMonitor) UpdateNicsDesc(nics []jsonutils.JSONObject) {
m.Nics = nics
}
+1
View File
@@ -0,0 +1 @@
package notify // import "yunion.io/x/onecloud/pkg/notify"
+1
View File
@@ -0,0 +1 @@
package models // import "yunion.io/x/onecloud/pkg/notify/models"
+1
View File
@@ -0,0 +1 @@
package options // import "yunion.io/x/onecloud/pkg/notify/options"
+1
View File
@@ -0,0 +1 @@
package utils // import "yunion.io/x/onecloud/pkg/notify/utils"
+1
View File
@@ -0,0 +1 @@
package bitmap // import "yunion.io/x/onecloud/pkg/util/bitmap"