mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
cpu: Add support for loading and storing CPU data
This patch adds cpuDataFormat and cpuDataParse APIs to be used in unit tests for testing APIs that deal with virCPUData. In the x86 world, this means we can now store/load arbitrary CPUID data in the test suite to check correctness of CPU related APIs that could not be tested before. Signed-off-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
committed by
Peter Krempa
parent
fe1bf917f9
commit
376261d164
@@ -93,6 +93,11 @@ typedef int
|
||||
(*cpuArchHasFeature) (const virCPUData *data,
|
||||
const char *feature);
|
||||
|
||||
typedef char *
|
||||
(*cpuArchDataFormat)(const virCPUData *data);
|
||||
|
||||
typedef virCPUDataPtr
|
||||
(*cpuArchDataParse) (const char *xmlStr);
|
||||
|
||||
struct cpuArchDriver {
|
||||
const char *name;
|
||||
@@ -107,6 +112,8 @@ struct cpuArchDriver {
|
||||
cpuArchBaseline baseline;
|
||||
cpuArchUpdate update;
|
||||
cpuArchHasFeature hasFeature;
|
||||
cpuArchDataFormat dataFormat;
|
||||
cpuArchDataParse dataParse;
|
||||
};
|
||||
|
||||
|
||||
@@ -178,4 +185,11 @@ cpuModelIsAllowed(const char *model,
|
||||
extern int
|
||||
cpuGetModels(const char *arch, char ***models);
|
||||
|
||||
/* cpuDataFormat and cpuDataParse are implemented for unit tests only and
|
||||
* have no real-life usage
|
||||
*/
|
||||
char *cpuDataFormat(const virCPUData *data);
|
||||
virCPUDataPtr cpuDataParse(virArch arch,
|
||||
const char *xmlStr);
|
||||
|
||||
#endif /* __VIR_CPU_H__ */
|
||||
|
||||
Reference in New Issue
Block a user