examples/vm_power: fix no port in guest
authorDavid Hunt <david.hunt@intel.com>
Tue, 29 Oct 2019 11:40:13 +0000 (11:40 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 12 Nov 2019 07:26:25 +0000 (08:26 +0100)
commit0f2f911deb0cc3c1204b127ac21683390f068ed8
tree3a745f873cb855d9f3475fa262c149c9544657f2
parent31c9a66465ad623258c4449fea54c0b42a2deae1
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 <david.hunt@intel.com>
Acked-by: Lei Yao <lei.a.yao@intel.com>
examples/vm_power_manager/guest_cli/vm_power_cli_guest.c