From: David Hunt Date: Tue, 29 Oct 2019 11:40:13 +0000 (+0000) Subject: examples/vm_power: fix no port in guest X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=0f2f911deb0cc3c1204b127ac21683390f068ed8;p=dpdk.git examples/vm_power: fix no port in guest If there are no ports available to the guest cli application, it will exit when setting up the default policy because it fails to set the mac address. This should not be the case, as this example can be used for many other use cases that do not need ports. If ports not found, simply set nb_mac_to_monitor in the policy to zero and continue. Fixes: 70febdcfd60f ("examples: check status of getting MAC address") Signed-off-by: David Hunt Acked-by: Lei Yao --- diff --git a/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c b/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c index eb0ae91142..96c1a1ff69 100644 --- a/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c +++ b/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c @@ -79,9 +79,9 @@ set_policy_defaults(struct channel_packet *pkt) ret = set_policy_mac(0, 0); if (ret != 0) - return ret; - - pkt->nb_mac_to_monitor = 1; + pkt->nb_mac_to_monitor = 0; + else + pkt->nb_mac_to_monitor = 1; pkt->t_boost_status.tbEnabled = false;