Commit Graph

12 Commits

Author SHA1 Message Date
Andrea Bolognani
adb865df85 cpu: Align ppc64 CPU data with x86
Use a typedef instead of the plain struct and heap allocation. This
will make it easier to extend the ppc64 specific CPU data later on.
2015-08-11 11:04:57 +02:00
Andrea Bolognani
d574094d30 cpu: Use ppc64Compute() to implement ppc64DriverCompare()
This ensures comparison of two CPU definitions will be consistent
regardless of the fact that it is performed using cpuCompare() or
cpuGuestData(). The x86 driver uses the same exact code.
2015-08-11 11:04:57 +02:00
Andrea Bolognani
96b2c7459c cpu: CPU model names have to match on ppc64
Limitations of the POWER architecture mean that you can't run
eg. a POWER7 guest on a POWER8 host when using KVM. This applies
to all guests, not just those using VIR_CPU_MATCH_STRICT in the
CPU definition; in fact, exact and strict CPU matching are
basically the same on ppc64.

This means, of course, that hosts using different CPUs have to be
considered incompatible as well.

Change ppc64Compute(), called by cpuGuestData(), to reflect this
fact and update test cases accordingly.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1250977
2015-08-11 11:04:57 +02:00
Andrea Bolognani
8382136d42 cpu: Never skip CPU model name check in ppc64 driver
ppc64Compute(), called by cpuNodeData(), is used not only to retrieve
the driver-specific data associated to a guest CPU definition, but
also to check whether said guest CPU is compatible with the host CPU.

If the user is not interested in the CPU data, it's perfectly fine
to pass a NULL pointer instead of a return location, and the
compatibility data returned should not be affected by this. One of
the checks, specifically the one on CPU model name, was however
only performed if the return location was non-NULL.
2015-08-11 11:04:57 +02:00
Andrea Bolognani
b85b51f2a5 cpu: Reorder functions in the ppc64 driver
Having the functions grouped together this way will avoid further
shuffling around down the line.

No functional changes.
2015-08-11 11:04:56 +02:00
Andrea Bolognani
c238d16af4 cpu: Simplify ppc64ModelFromCPU() 2015-08-11 11:04:56 +02:00
Andrea Bolognani
4590f0678f cpu: Simplify NULL handling in ppc64 driver
Use briefer checks, eg. (!model) instead of (model == NULL), and
avoid initializing to NULL a pointer that would be assigned in
the first line of the function anyway.

Also remove a pointless NULL assignment.

No functional changes.
2015-08-11 11:04:56 +02:00
Andrea Bolognani
2686bf2292 cpu: Mark driver functions in ppc64 driver
Use the ppc64Driver prefix for all functions that are used to
fill in the cpuDriverPPC64 structure, ie. those that are going
to be called by the generic CPU code.

This makes it clear which functions are exported and which are
implementation details; it also gets rid of the ambiguity that
affected the ppc64DataFree() function which, despite what the
name suggested, was not related to ppc64DataCopy() and could
not be used to release the memory allocated for a
virCPUppc64Data* instance.

No functional changes.
2015-08-11 11:04:56 +02:00
Andrea Bolognani
4ff3e939e7 cpu: Indentation changes in the ppc64 driver 2015-08-05 13:30:16 +02:00
Andrea Bolognani
3d1515890b cpu: Rename {powerpc,ppc} => ppc64 (internal symbols)
Update the names of the symbols used internally by the driver.

No functional changes.
2015-08-05 13:30:16 +02:00
Andrea Bolognani
e89733c4a4 cpu: Rename {powerpc,ppc} => ppc64 (exported symbols)
Only the symbols exported by the driver have been updated;
the driver implementation itself still uses the old names
internally.

No functional changes.
2015-08-05 13:30:16 +02:00
Andrea Bolognani
ef770f0160 cpu: Rename {powerpc,ppc} => ppc64 (filesystem)
The driver only supports VIR_ARCH_PPC64 and VIR_ARCH_PPC64LE.

Just shuffling files around and updating the build system
accordingly. No functional changes.
2015-08-05 13:30:16 +02:00