fix(host): isolated device probe closure reference for range val (#20988)

This commit is contained in:
wanyaoqi
2024-08-09 16:17:55 +08:00
committed by GitHub
parent 48fb20150a
commit b4861abe59
+4 -1
View File
@@ -2193,7 +2193,10 @@ func (h *SHostInfo) probeSyncIsolatedDevices() (*jsonutils.JSONArray, error) {
eg := errgroup.Group{}
mtx := sync.Mutex{}
updateDevs := jsonutils.NewArray()
for _, dev := range h.IsolatedDeviceMan.GetDevices() {
devs := h.IsolatedDeviceMan.GetDevices()
for i := range devs {
dev := devs[i]
eg.Go(func() error {
if obj, err := isolated_device.SyncDeviceInfo(h.GetSession(), h.HostId, dev); err != nil {
return errors.Wrapf(err, "Sync device %s", dev)