Skip to contentSkip to conversation

examples/vm_power: fix no PCI option for guest cli

PATCH Applied David Hunt 3 participants 3 messages Oct 29, 2019 – Nov 12, 2019

lore
Share & tools
lore

David Hunt

author
#0 lore raw

PATCH 1/1 examples/vm_power: fix no PCI option for guest cli

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")
---
 examples/vm_power_manager/guest_cli/vm_power_cli_guest.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
examples/vm_power_manager/guest_cli/vm_power_cli_guest.c +3 -3
index eb0ae9114..96c1a1ff6 100644
@@ -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;
 
Signature · 1 line
2.17.1
Acked-by on v1 1/1
#1 lore raw
Quoted 14 lines

-----Original Message-----
From: Hunt, David <[email protected]>
Sent: Tuesday, October 29, 2019 7:40 PM
To: [email protected]
Cc: Yao, Lei A <[email protected]>; Hunt, David <[email protected]>
Subject: [PATCH v1] examples/vm_power: fix no PCI option for guest cli

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.

Quoted 5 lines

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")
Quoted 24 lines
---
 examples/vm_power_manager/guest_cli/vm_power_cli_guest.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
examples/vm_power_manager/guest_cli/vm_power_cli_guest.c +3 -4
index eb0ae9114..96c1a1ff6 100644
@@ -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;
 
--

2.17.1

#2 lore raw

30/10/2019 02:09, Yao, Lei A:

Quoted 7 lines

From: Hunt, David <[email protected]>

Quoted 6 lines

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.

Quoted 6 lines
Quoted 5 lines

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")

Applied, thanks