path: root/examples/vm_power_manager
diff options
authorDavid Hunt <>2018-10-17 14:05:26 +0100
committerThomas Monjalon <>2018-10-26 10:48:03 +0200
commit395e97bf801b6b4f0d343c95874b5303324c4def (patch)
treecac2cca50a79e1c22b4e1c23a6b69856ff615058 /examples/vm_power_manager
parente0207366b173c78a92603ed2519a0e5eb04b0dc0 (diff)
examples/power: allow number of VMs to be zero
Previously the vm_power_manager app required to have some vms defined, so the call to get_all_vm() always set the noVms variable. Now we're accepting policies from the host OS (without any VMs defined), so it is now valid to have zero VMs. This patch initialises the relevant variables to zero just in case the call to get_all_vms() does not find any, so could return with the variables uninitialised. Signed-off-by: David Hunt <> Acked-by: Anatoly Burakov <>
Diffstat (limited to 'examples/vm_power_manager')
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/vm_power_manager/channel_monitor.c b/examples/vm_power_manager/channel_monitor.c
index 7fa47ba..f180d74 100644
--- a/examples/vm_power_manager/channel_monitor.c
+++ b/examples/vm_power_manager/channel_monitor.c
@@ -66,7 +66,7 @@ static void
core_share_status(int pNo)
- int noVms, noVcpus, z, x, t;
+ int noVms = 0, noVcpus = 0, z, x, t;
get_all_vm(&noVms, &noVcpus);