mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 19:11:16 +00:00
cpu: Make models array in virCPUTranslate constant
The API doesn't change the array so let's make it constant. Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
adf44c7bae
commit
2a2ce08a6d
@ -896,7 +896,7 @@ virCPUGetModels(virArch arch, char ***models)
|
|||||||
int
|
int
|
||||||
virCPUTranslate(virArch arch,
|
virCPUTranslate(virArch arch,
|
||||||
virCPUDefPtr cpu,
|
virCPUDefPtr cpu,
|
||||||
char **models,
|
const char **models,
|
||||||
unsigned int nmodels)
|
unsigned int nmodels)
|
||||||
{
|
{
|
||||||
struct cpuArchDriver *driver;
|
struct cpuArchDriver *driver;
|
||||||
@ -911,7 +911,7 @@ virCPUTranslate(virArch arch,
|
|||||||
cpu->mode == VIR_CPU_MODE_HOST_PASSTHROUGH)
|
cpu->mode == VIR_CPU_MODE_HOST_PASSTHROUGH)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (virCPUModelIsAllowed(cpu->model, (const char **) models, nmodels))
|
if (virCPUModelIsAllowed(cpu->model, models, nmodels))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (cpu->fallback != VIR_CPU_FALLBACK_ALLOW) {
|
if (cpu->fallback != VIR_CPU_FALLBACK_ALLOW) {
|
||||||
@ -928,7 +928,7 @@ virCPUTranslate(virArch arch,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (driver->translate(cpu, (const char **) models, nmodels) < 0)
|
if (driver->translate(cpu, models, nmodels) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
VIR_DEBUG("model=%s", NULLSTR(cpu->model));
|
VIR_DEBUG("model=%s", NULLSTR(cpu->model));
|
||||||
|
@ -225,7 +225,7 @@ virCPUGetModels(virArch arch, char ***models);
|
|||||||
int
|
int
|
||||||
virCPUTranslate(virArch arch,
|
virCPUTranslate(virArch arch,
|
||||||
virCPUDefPtr cpu,
|
virCPUDefPtr cpu,
|
||||||
char **models,
|
const char **models,
|
||||||
unsigned int nmodels)
|
unsigned int nmodels)
|
||||||
ATTRIBUTE_NONNULL(2);
|
ATTRIBUTE_NONNULL(2);
|
||||||
|
|
||||||
|
@ -5083,7 +5083,8 @@ qemuProcessUpdateGuestCPU(virDomainDefPtr def,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (virQEMUCapsGetCPUDefinitions(qemuCaps, &models, &nmodels) < 0 ||
|
if (virQEMUCapsGetCPUDefinitions(qemuCaps, &models, &nmodels) < 0 ||
|
||||||
virCPUTranslate(def->os.arch, def->cpu, models, nmodels) < 0)
|
virCPUTranslate(def->os.arch, def->cpu,
|
||||||
|
(const char **) models, nmodels) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
def->cpu->fallback = VIR_CPU_FALLBACK_FORBID;
|
def->cpu->fallback = VIR_CPU_FALLBACK_FORBID;
|
||||||
|
Loading…
Reference in New Issue
Block a user