Re: [PATCH 09/10] Fix error reporting in virNetDevVethDelete

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

 



----- Original Message -----
> From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
> 
> In virNetDevVethDelete the virRun method will properly report
> errors, but when checking the exit status for non-zero exit
> code no error is reported
> 
> Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
> ---
>  po/POTFILES.in           |  1 +
>  src/util/virnetdevveth.c | 19 +++++++++----------
>  2 files changed, 10 insertions(+), 10 deletions(-)

I think this is overkill.

>      rc = virRun(argv, &cmdResult);
>  
> -    if (rc != 0 ||
> -        (WIFEXITED(cmdResult) && WEXITSTATUS(cmdResult) != 0)) {

The old code wants cmdResult to be exactly 0.  But guess what - if
you pass NULL to virRun, then virRun errors out unless the exit
status is exactly 0.

That is it is better to just do:

rc = virRun(argv, NULL);

and delete the rest of this attempt at warning about non-zero
status, as virRun does a better job of it in the first place.

--
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]