[libvirt] [PATCH v2 1/2] conf: fix logic error for scsi units

Han Han posted 2 patches 6 years, 2 months ago
[libvirt] [PATCH v2 1/2] conf: fix logic error for scsi units
Posted by Han Han 6 years, 2 months ago
Introduced in c8007fdc5d2, it should use 'greater than max' instread of
'equal or greater than max' for the condition of checking invalid scsi
unit.

Signed-off-by: Han Han <hhan@redhat.com>
---
 src/conf/domain_conf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 9580884747..badc2da487 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -4850,7 +4850,7 @@ virDomainSCSIDriveAddressIsUsed(const virDomainDef *def,
             break;
         }
 
-        if (max != -1 && addr->unit >= max)
+        if (max != -1 && addr->unit > max)
             return true;
         if (reserved != -1 && addr->unit == reserved)
             return true;
-- 
2.24.0.rc1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH v2 1/2] conf: fix logic error for scsi units
Posted by Daniel Henrique Barboza 6 years, 2 months ago

On 12/2/19 5:41 AM, Han Han wrote:
> Introduced in c8007fdc5d2, it should use 'greater than max' instread of

s/instread/instead

> 'equal or greater than max' for the condition of checking invalid scsi
> unit.
> 
> Signed-off-by: Han Han <hhan@redhat.com>
> ---


Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH v2 1/2] conf: fix logic error for scsi units
Posted by Boris Fiuczynski 6 years, 2 months ago
With the commit message spelling corrected
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>

On 12/2/19 9:41 AM, Han Han wrote:
> Introduced in c8007fdc5d2, it should use 'greater than max' instread of
> 'equal or greater than max' for the condition of checking invalid scsi
> unit.
> 
> Signed-off-by: Han Han <hhan@redhat.com>
> ---
>   src/conf/domain_conf.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index 9580884747..badc2da487 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -4850,7 +4850,7 @@ virDomainSCSIDriveAddressIsUsed(const virDomainDef *def,
>               break;
>           }
>   
> -        if (max != -1 && addr->unit >= max)
> +        if (max != -1 && addr->unit > max)
>               return true;
>           if (reserved != -1 && addr->unit == reserved)
>               return true;
> 


-- 
Mit freundlichen Grüßen/Kind regards
    Boris Fiuczynski

IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Matthias Hartmann
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list