Re: [PATCH v3 2/7] cpu: add function to get the models for an arch

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

 



On 09/13/2013 01:29 PM, Eric Blake wrote:
> On 09/11/2013 08:12 AM, Giuseppe Scrivano wrote:
>> Signed-off-by: Giuseppe Scrivano <gscrivan@xxxxxxxxxx>
>> ---
>>  src/cpu/cpu.c            | 56 ++++++++++++++++++++++++++++++++++++++++++++++++
>>  src/cpu/cpu.h            |  3 +++
>>  src/libvirt_private.syms |  1 +
>>  3 files changed, 60 insertions(+)
>>
> 
>> +
>> +int
>> +cpuGetModels(const char *arch, char ***models)
>> +{
>> +    struct cpuGetModelsData data;
>> +
>> +    *models = data.data = NULL;
> 
> Blind dereference of models; but since I argued in patch 1 that passing
> NULL makes sense for the return value count, this needs a tweak...
> 
> ACK with this squashed in.

NACK, needs a v4; this is where we need to fix things to do the right
subdriver mapping. Quoting IRC:

and I know which one to change
[15:30]	jdenemar	eblake: cpu-models should work for both x86 and x86_64 imho
[15:31]	eblake	yep - where the map file lists x86, we need the
cpu-models to support it for both i686 and x86_64
[15:32]	jdenemar	yeah, the x86 in cpu_map.xml is actually a cpu driver
name and the driver has a list of archs it supports
[15:34]	eblake	jdenemar: giuseppe_s used cpuMapLoad(arch, ...) - which
is only doing a literal string match
[15:34]	eblake	so where do we reverse map the driver names in the map
file into actual arch names?
[15:35]	eblake	or, where SHOULD we be doing that mapping?
[15:38]	jdenemar	every cpu api in cpu.c calls cpuGetSubDriver to get the
driver from a real arch
[15:41]	jdenemar	so there should be a high level cpu api that takes a
real arch and gives model names, that should look up the appropriate sub
driver, call its api and it should load its section of cpu_map.xml and
return the list

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

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