[libvirt] [PATCH] xen: Don't crash when we fail to init caps

Guido Günther agx at sigxcpu.org
Sun Jan 22 11:30:20 UTC 2012


On Fri, Jan 20, 2012 at 05:01:48PM +0000, Daniel P. Berrange wrote:
> On Fri, Jan 20, 2012 at 05:57:34PM +0100, Guido Günther wrote:
> > by dereferencing a NULL pointer in the call to
> > virNodeSuspendGetTargetMask.
> > 
> > Only warn but Don't set an error to not overwrite an error code set by
> > xenHypervisorMakeCapabilities.
> > ---
> >  src/xen/xen_hypervisor.c |    4 ++++
> >  1 files changed, 4 insertions(+), 0 deletions(-)
> > 
> > diff --git a/src/xen/xen_hypervisor.c b/src/xen/xen_hypervisor.c
> > index 2bb3466..855576c 100644
> > --- a/src/xen/xen_hypervisor.c
> > +++ b/src/xen/xen_hypervisor.c
> > @@ -2764,6 +2764,10 @@ xenHypervisorMakeCapabilities(virConnectPtr conn)
> >                                                   utsname.machine,
> >                                                   cpuinfo,
> >                                                   capabilities);
> > +    if (caps == NULL) {
> > +        VIR_WARN("Failed to get host capabilities");
> > +        return NULL;
> > +    }
> 
> Shouldn't be any need for a warning there since the method
> we just called should have raised an error
The attached version omits the warning. O.k. to apply?
Cheers,
 -- Guido
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-xen-Don-t-crash-when-we-fail-to-init-caps.patch
Type: text/x-diff
Size: 1011 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120122/ff6dfb89/attachment-0001.bin>


More information about the libvir-list mailing list