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

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

 



On Tue, Nov 27, 2012 at 12:46:44PM -0500, Eric Blake wrote:
> ----- 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.

Hmm, good point. I'll delete all this code

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

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