summaryrefslogtreecommitdiff
path: root/examples/vm_power_manager
diff options
context:
space:
mode:
authorDavid Hunt <david.hunt@intel.com>2017-10-13 13:31:42 +0100
committerThomas Monjalon <thomas@monjalon.net>2017-10-13 15:35:18 +0200
commit7abd801fbbd9b0e80c94c84d386f6ac12120923b (patch)
tree7acf6bbacc54e186aaf3fc024ef86ec545f57071 /examples/vm_power_manager
parent50aa486c877a8d5482fde4b0dacd0fad40789864 (diff)
downloaddpdk-7abd801fbbd9b0e80c94c84d386f6ac12120923b.zip
dpdk-7abd801fbbd9b0e80c94c84d386f6ac12120923b.tar.gz
dpdk-7abd801fbbd9b0e80c94c84d386f6ac12120923b.tar.xz
examples/vm_power_manager: fix build
Remove variable declaration from within for loop. Fixes: f14791a8126e ("examples/vm_power_mgr: add policy to channels") Signed-off-by: David Hunt <david.hunt@intel.com>
Diffstat (limited to 'examples/vm_power_manager')
-rw-r--r--examples/vm_power_manager/channel_monitor.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/examples/vm_power_manager/channel_monitor.c b/examples/vm_power_manager/channel_monitor.c
index f16358d..f8e3491 100644
--- a/examples/vm_power_manager/channel_monitor.c
+++ b/examples/vm_power_manager/channel_monitor.c
@@ -169,8 +169,9 @@ update_policy(struct channel_packet *pkt)
{
unsigned int updated = 0;
+ int i;
- for (int i = 0; i < MAX_VMS; i++) {
+ for (i = 0; i < MAX_VMS; i++) {
if (strcmp(policies[i].pkt.vm_name, pkt->vm_name) == 0) {
policies[i].pkt = *pkt;
get_pcpu_to_control(&policies[i]);
@@ -184,7 +185,7 @@ update_policy(struct channel_packet *pkt)
}
}
if (!updated) {
- for (int i = 0; i < MAX_VMS; i++) {
+ for (i = 0; i < MAX_VMS; i++) {
if (policies[i].enabled == 0) {
policies[i].pkt = *pkt;
get_pcpu_to_control(&policies[i]);
@@ -543,7 +544,9 @@ run_channel_monitor(void)
}
rte_delay_us(time_period_s*1000000);
if (policy_is_set) {
- for (int j = 0; j < MAX_VMS; j++) {
+ int j;
+
+ for (j = 0; j < MAX_VMS; j++) {
if (policies[j].enabled == 1)
apply_policy(&policies[j]);
}