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

Eric Blake eblake at redhat.com
Fri Sep 13 21:48:21 UTC 2013


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 at redhat.com>
>> ---
>>  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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130913/1520349e/attachment-0001.sig>


More information about the libvir-list mailing list