From: David Hunt Date: Wed, 17 Oct 2018 13:05:26 +0000 (+0100) Subject: examples/power: allow number of VMs to be zero X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=395e97bf801b6b4f0d343c95874b5303324c4def;p=dpdk.git 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 --- diff --git a/examples/vm_power_manager/channel_monitor.c b/examples/vm_power_manager/channel_monitor.c index 7fa47ba972..f180d74e64 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);