Re: [PATCH 19/41] domcaps: Show only CPU models supported by libvirt

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

 



On Mon, Aug 29, 2016 at 18:01:21 -0400, John Ferlan wrote:
...
> My Coverity environment had a build failure here:
> 
> conf/domain_capabilities.c: In function 'virDomainCapsCPUModelsFilter':
> conf/domain_capabilities.c:183:48: error: passing argument 1 of
> 'virStringArrayHasString' from incompatible pointer type
> [-Werror=incompatible-pointer-types]
>          if (models && !virStringArrayHasString(models,
> old->models[i].name))
>                                                 ^~~~~~
> In file included from conf/domain_capabilities.c:28:0:
> ./util/virstring.h:47:6: note: expected 'const char **' but argument is
> of type 'char **'
>  bool virStringArrayHasString(const char **strings, const char *needle);
>       ^~~~~~~~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
> Makefile:8092: recipe for target
> 'conf/libvirt_conf_la-domain_capabilities.lo' failed

Yeah, my compiler doesn't like this either. It's caused by a recent
change to virStringArrayHasString. Fixed.

> > @@ -4207,7 +4209,13 @@ virQEMUCapsFillDomainCPUCaps(virCapsPtr caps,
> >          domCaps->cpu.hostModel = virQEMUCapsGuestIsNative(caps->host.arch,
> >                                                            qemuCaps->arch);
> >  
> > -    domCaps->cpu.custom = virObjectRef(qemuCaps->cpuDefinitions);
> > +    if (qemuCaps->cpuDefinitions &&
> > +        cpuGetModels(domCaps->arch, &models) >= 0) {
> 
> if cpuGetModels returns 0, then models is empty so is there any point in
> making the call?

Yeah, currently there's no reason to call it if models is empty, but it
will change in the future :-)

That's what happens when splitting the changes into several patches once
a complete functionality has been implemented.

Jirka

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