Re: [PATCH 1/3] lxc_process: Resolve Coverity NULL_RETURNS error

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

 



On Thu, May 16, 2013 at 10:01:51AM -0400, John Ferlan wrote:
> In virLXCProcessReboot, if the 'conn' value is NULL, the eventual
> call to virLXCNetworkLookupByName() via virLXCProcessStart() and
> virLXCProcessSetupInterfaces() will cause a core since it references
> conn->networkDriver directly.
> ---
>  src/lxc/lxc_process.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c
> index b06d748..4410db4 100644
> --- a/src/lxc/lxc_process.c
> +++ b/src/lxc/lxc_process.c
> @@ -181,7 +181,6 @@ virLXCProcessReboot(virLXCDriverPtr driver,
>          autodestroy = true;
>      } else {
>          conn = virConnectOpen("lxc:///");
> -        /* Ignoring NULL conn which is mostly harmless here */

I'm actually inclined to say that we should stop ignoring failures
of virConnectOpen(). I don't think there's any valid reason for us
to be doing that. Then we wouldnt have to worry about conn being
NULL later

This ignoring of errors is historical legacy of my own creation
when first writing the QEMU driver. I can't think what possessed
me to ignore the errors at the time.


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]