Re: [libvirt] [PATCH 2/3] network: Use local variables in networkUpdatePortBandwidth

2019-11-18 Thread Peter Krempa
On Mon, Nov 18, 2019 at 11:28:08 -0300, Daniel Henrique Barboza wrote: > > > On 11/18/19 10:53 AM, Peter Krempa wrote: > > On Mon, Nov 18, 2019 at 14:47:03 +0100, Michal Privoznik wrote: > > > On 11/18/19 2:27 PM, Daniel Henrique Barboza wrote: > > > > > > I believe it was John who persuaded us

Re: [libvirt] [PATCH 2/3] network: Use local variables in networkUpdatePortBandwidth

2019-11-18 Thread Daniel Henrique Barboza
On 11/18/19 10:53 AM, Peter Krempa wrote: On Mon, Nov 18, 2019 at 14:47:03 +0100, Michal Privoznik wrote: On 11/18/19 2:27 PM, Daniel Henrique Barboza wrote: I believe it was John who persuaded us to use explicit integer comparison for integer variables. The idea is that it's clear from the

Re: [libvirt] [PATCH 2/3] network: Use local variables in networkUpdatePortBandwidth

2019-11-18 Thread Peter Krempa
On Mon, Nov 18, 2019 at 14:47:03 +0100, Michal Privoznik wrote: > On 11/18/19 2:27 PM, Daniel Henrique Barboza wrote: > > > > > > On 11/14/19 6:58 PM, John Ferlan wrote: > > > We go through the trouble of checking {old|new}Bandwidth[->in] and > > > storing the result in local @old_floor and @new_

Re: [libvirt] [PATCH 2/3] network: Use local variables in networkUpdatePortBandwidth

2019-11-18 Thread Michal Privoznik
On 11/18/19 2:27 PM, Daniel Henrique Barboza wrote: On 11/14/19 6:58 PM, John Ferlan wrote: We go through the trouble of checking {old|new}Bandwidth[->in] and storing the result in local @old_floor and @new_floor, but then we don't use them. Instead we make derefs to the longer name. This caus

Re: [libvirt] [PATCH 2/3] network: Use local variables in networkUpdatePortBandwidth

2019-11-18 Thread Daniel Henrique Barboza
On 11/14/19 6:58 PM, John Ferlan wrote: We go through the trouble of checking {old|new}Bandwidth[->in] and storing the result in local @old_floor and @new_floor, but then we don't use them. Instead we make derefs to the longer name. This caused Coverity to note dereferencing newBandwidth->in w

[libvirt] [PATCH 2/3] network: Use local variables in networkUpdatePortBandwidth

2019-11-14 Thread John Ferlan
We go through the trouble of checking {old|new}Bandwidth[->in] and storing the result in local @old_floor and @new_floor, but then we don't use them. Instead we make derefs to the longer name. This caused Coverity to note dereferencing newBandwidth->in without first checking @newBandwidth like was