Re: [libvirt PATCH 5/5] qemu: reuse convenience variable introduced in a00b97f27672b3

2020-02-12 Thread Michal Privoznik

On 2/10/20 5:10 PM, Pavel Mores wrote:

Since we have the result of a compound condition named now we can use it
to simplify another complex condition to make it more readable.

Signed-off-by: Pavel Mores 
---
  src/network/bridge_driver.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)



libvirt.git $ git describe a00b97f27672b3
fatal: Not a valid object name a00b97f27672b3

;-)


diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 513ae59e68..584c78cadb 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -5081,8 +5081,7 @@ networkCheckBandwidth(virNetworkObjPtr obj,
  return -1;
  }
  
-if (ifaceBand && ifaceBand->in && ifaceBand->in->floor &&

-!(netBand && netBand->in)) {
+if (floorRequested && !(netBand && netBand->in)) {
  virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
 _("Invalid use of 'floor' on interface with MAC "
   "address %s - network '%s' has no inbound QoS set"),



As I'm saying in review of 2/5, this won't be needed.

Michal



[libvirt PATCH 5/5] qemu: reuse convenience variable introduced in a00b97f27672b3

2020-02-10 Thread Pavel Mores
Since we have the result of a compound condition named now we can use it
to simplify another complex condition to make it more readable.

Signed-off-by: Pavel Mores 
---
 src/network/bridge_driver.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 513ae59e68..584c78cadb 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -5081,8 +5081,7 @@ networkCheckBandwidth(virNetworkObjPtr obj,
 return -1;
 }
 
-if (ifaceBand && ifaceBand->in && ifaceBand->in->floor &&
-!(netBand && netBand->in)) {
+if (floorRequested && !(netBand && netBand->in)) {
 virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
_("Invalid use of 'floor' on interface with MAC "
  "address %s - network '%s' has no inbound QoS set"),
-- 
2.24.1