mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-27 07:22:07 +03:00
cpu: Drop cpuGuestData
The API is not used anywhere in the code. Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
98b7c37d37
commit
03fa904c0c
@ -372,47 +372,6 @@ cpuNodeData(virArch arch)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* cpuGuestData:
|
||||
*
|
||||
* @host: host CPU definition
|
||||
* @guest: guest CPU definition
|
||||
* @data: computed guest CPU data
|
||||
* @msg: error message describing why the @guest and @host CPUs are considered
|
||||
* incompatible
|
||||
*
|
||||
* Computes guest CPU data for the @guest CPU definition when run on the @host
|
||||
* CPU.
|
||||
*
|
||||
* Returns VIR_CPU_COMPARE_ERROR on error, VIR_CPU_COMPARE_INCOMPATIBLE when
|
||||
* the two CPUs are incompatible (@msg will describe the incompatibility),
|
||||
* VIR_CPU_COMPARE_IDENTICAL when the two CPUs are identical,
|
||||
* VIR_CPU_COMPARE_SUPERSET when the @guest CPU is a superset of the @host CPU.
|
||||
*/
|
||||
virCPUCompareResult
|
||||
cpuGuestData(virCPUDefPtr host,
|
||||
virCPUDefPtr guest,
|
||||
virCPUDataPtr *data,
|
||||
char **msg)
|
||||
{
|
||||
struct cpuArchDriver *driver;
|
||||
|
||||
VIR_DEBUG("host=%p, guest=%p, data=%p, msg=%p", host, guest, data, msg);
|
||||
|
||||
if ((driver = cpuGetSubDriver(host->arch)) == NULL)
|
||||
return VIR_CPU_COMPARE_ERROR;
|
||||
|
||||
if (driver->guestData == NULL) {
|
||||
virReportError(VIR_ERR_NO_SUPPORT,
|
||||
_("cannot compute guest CPU data for %s architecture"),
|
||||
virArchToString(host->arch));
|
||||
return VIR_CPU_COMPARE_ERROR;
|
||||
}
|
||||
|
||||
return driver->guestData(host, guest, data, msg);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* cpuBaselineXML:
|
||||
*
|
||||
|
@ -73,12 +73,6 @@ typedef void
|
||||
typedef virCPUDataPtr
|
||||
(*cpuArchNodeData) (virArch arch);
|
||||
|
||||
typedef virCPUCompareResult
|
||||
(*cpuArchGuestData) (virCPUDefPtr host,
|
||||
virCPUDefPtr guest,
|
||||
virCPUDataPtr *data,
|
||||
char **message);
|
||||
|
||||
typedef virCPUDefPtr
|
||||
(*cpuArchBaseline) (virCPUDefPtr *cpus,
|
||||
unsigned int ncpus,
|
||||
@ -124,7 +118,6 @@ struct cpuArchDriver {
|
||||
cpuArchEncode encode;
|
||||
cpuArchDataFree free;
|
||||
cpuArchNodeData nodeData;
|
||||
cpuArchGuestData guestData;
|
||||
cpuArchBaseline baseline;
|
||||
virCPUArchUpdate update;
|
||||
virCPUArchCheckFeature checkFeature;
|
||||
@ -175,13 +168,6 @@ cpuDataFree (virCPUDataPtr data);
|
||||
virCPUDataPtr
|
||||
cpuNodeData (virArch arch);
|
||||
|
||||
virCPUCompareResult
|
||||
cpuGuestData(virCPUDefPtr host,
|
||||
virCPUDefPtr guest,
|
||||
virCPUDataPtr *data,
|
||||
char **msg)
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
||||
|
||||
char *
|
||||
cpuBaselineXML(const char **xmlCPUs,
|
||||
unsigned int ncpus,
|
||||
|
@ -78,15 +78,6 @@ virCPUarmUpdate(virCPUDefPtr guest,
|
||||
}
|
||||
|
||||
|
||||
static virCPUCompareResult
|
||||
armGuestData(virCPUDefPtr host ATTRIBUTE_UNUSED,
|
||||
virCPUDefPtr guest ATTRIBUTE_UNUSED,
|
||||
virCPUDataPtr *data ATTRIBUTE_UNUSED,
|
||||
char **message ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return VIR_CPU_COMPARE_IDENTICAL;
|
||||
}
|
||||
|
||||
static virCPUDefPtr
|
||||
armBaseline(virCPUDefPtr *cpus,
|
||||
unsigned int ncpus ATTRIBUTE_UNUSED,
|
||||
@ -128,7 +119,6 @@ struct cpuArchDriver cpuDriverArm = {
|
||||
.encode = NULL,
|
||||
.free = armDataFree,
|
||||
.nodeData = NULL,
|
||||
.guestData = armGuestData,
|
||||
.baseline = armBaseline,
|
||||
.update = virCPUarmUpdate,
|
||||
};
|
||||
|
@ -745,14 +745,6 @@ ppc64DriverNodeData(virArch arch)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static virCPUCompareResult
|
||||
ppc64DriverGuestData(virCPUDefPtr host,
|
||||
virCPUDefPtr guest,
|
||||
virCPUDataPtr *data,
|
||||
char **message)
|
||||
{
|
||||
return ppc64Compute(host, guest, data, message);
|
||||
}
|
||||
|
||||
static int
|
||||
virCPUppc64Update(virCPUDefPtr guest,
|
||||
@ -911,7 +903,6 @@ struct cpuArchDriver cpuDriverPPC64 = {
|
||||
.encode = NULL,
|
||||
.free = ppc64DriverFree,
|
||||
.nodeData = ppc64DriverNodeData,
|
||||
.guestData = ppc64DriverGuestData,
|
||||
.baseline = ppc64DriverBaseline,
|
||||
.update = virCPUppc64Update,
|
||||
.getModels = virCPUppc64DriverGetModels,
|
||||
|
@ -80,7 +80,6 @@ struct cpuArchDriver cpuDriverS390 = {
|
||||
.encode = NULL,
|
||||
.free = s390DataFree,
|
||||
.nodeData = s390NodeData,
|
||||
.guestData = NULL,
|
||||
.baseline = NULL,
|
||||
.update = NULL,
|
||||
};
|
||||
|
@ -1725,22 +1725,6 @@ virCPUx86Compare(virCPUDefPtr host,
|
||||
}
|
||||
|
||||
|
||||
static virCPUCompareResult
|
||||
x86GuestData(virCPUDefPtr host,
|
||||
virCPUDefPtr guest,
|
||||
virCPUDataPtr *data,
|
||||
char **message)
|
||||
{
|
||||
if (!guest->model) {
|
||||
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||
_("no guest CPU model specified"));
|
||||
return VIR_CPU_COMPARE_ERROR;
|
||||
}
|
||||
|
||||
return x86Compute(host, guest, data, message);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Checks whether a candidate model is a better fit for the CPU data than the
|
||||
* current model.
|
||||
@ -2761,7 +2745,6 @@ struct cpuArchDriver cpuDriverX86 = {
|
||||
#else
|
||||
.nodeData = NULL,
|
||||
#endif
|
||||
.guestData = x86GuestData,
|
||||
.baseline = x86Baseline,
|
||||
.update = virCPUx86Update,
|
||||
.checkFeature = virCPUx86CheckFeature,
|
||||
|
@ -978,7 +978,6 @@ cpuBaselineXML;
|
||||
cpuDataFree;
|
||||
cpuDecode;
|
||||
cpuEncode;
|
||||
cpuGuestData;
|
||||
cpuNodeData;
|
||||
virCPUCheckFeature;
|
||||
virCPUCompare;
|
||||
|
Loading…
Reference in New Issue
Block a user