Avoid breaking keepalive during incoming migration

The keepalive was getting stuck gathering memoryStats from the
non-running VM, since it was in a paused state. Avoid this by just
skipping past the rest of the stats gathering if the VM isn't running.
This commit is contained in:
Joshua Boniface 2020-08-28 01:47:36 -04:00
parent 7ce1bfd930
commit 65b44f2955
1 changed files with 3 additions and 0 deletions

View File

@ -1355,6 +1355,9 @@ def collect_vm_stats(queue):
if debug:
logger.out("Getting general statistics for VM {}".format(domain_name), state='d', prefix='vm-thread')
domain_state, domain_maxmem, domain_mem, domain_vcpus, domain_cputime = domain.info()
# We can't properly gather stats from a non-running VMs so continue
if domain_state != libvirt.VIR_DOMAIN_RUNNING:
continue
domain_memory_stats = domain.memoryStats()
domain_cpu_stats = domain.getCPUStats(True)[0]
except Exception as e: