From 3d6f52baaacea87133d0bfdc02cf1f1dfc2028f2 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Wed, 25 Jun 2014 21:05:42 +0200 Subject: [PATCH] bug #2831: Do not add monitoring data to the VM when it is not ACTIVE --- src/vmm/VirtualMachineManagerDriver.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/vmm/VirtualMachineManagerDriver.cc b/src/vmm/VirtualMachineManagerDriver.cc index 39f836dcca..df35555058 100644 --- a/src/vmm/VirtualMachineManagerDriver.cc +++ b/src/vmm/VirtualMachineManagerDriver.cc @@ -617,6 +617,11 @@ void VirtualMachineManagerDriver::process_poll( /* Parse VM info and update VM */ /* ---------------------------------------------------------------------- */ + if (vm->get_state() != VirtualMachine::ACTIVE) + { + return; + } + rc = parse_vm_info(monitor_str, cpu, memory, net_tx, net_rx, state, custom); if (rc == -1) @@ -649,8 +654,8 @@ void VirtualMachineManagerDriver::process_poll( /* Process the VM state from the monitoring info */ /* ---------------------------------------------------------------------- */ - if (state == '-' || ( vm->get_lcm_state() != VirtualMachine::RUNNING && - vm->get_lcm_state() != VirtualMachine::UNKNOWN)) + if (vm->get_lcm_state() != VirtualMachine::RUNNING && + vm->get_lcm_state() != VirtualMachine::UNKNOWN) { return; }