Re: [PATCH] qemuDomainDetermineDiskChain: initialize ret as -1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Jul 30, 2016 at 16:08:40 +0800, Chen Hanxiao wrote:
> From: Chen Hanxiao <chenhanxiao@xxxxxxxxx>

Some words to justify this change would be helpful.

> 
> Signed-off-by: Chen Hanxiao <chenhanxiao@xxxxxxxxx>
> ---
>  src/qemu/qemu_domain.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
> index 9b439df..35d4365 100644
> --- a/src/qemu/qemu_domain.c
> +++ b/src/qemu/qemu_domain.c
> @@ -4394,7 +4394,7 @@ qemuDomainDetermineDiskChain(virQEMUDriverPtr driver,
>                               bool report_broken)
>  {
>      virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
> -    int ret = 0;
> +    int ret = -1;
>      uid_t uid;
>      gid_t gid;

Not visible in this context are two cases where this function shall
return success but would return failure in this case.

>  
> @@ -4416,6 +4416,8 @@ qemuDomainDetermineDiskChain(virQEMUDriverPtr driver,
>                                    report_broken) < 0)
>          ret = -1;
>  
> +    ret = 0;

This would overwrite the previous error.

NACK, the code is okay as-is and there's no justification for the
change.

Peter

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



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]