diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index 50406691612ec6739857a44336ac985c61e2583d..9d34206bf51bf7c6caafbcea83ac1da66e072fd4 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c @@ -896,7 +896,7 @@ virCPUGetModels(virArch arch, char ***models) int virCPUTranslate(virArch arch, virCPUDefPtr cpu, - char **models, + const char **models, unsigned int nmodels) { struct cpuArchDriver *driver; @@ -911,7 +911,7 @@ virCPUTranslate(virArch arch, cpu->mode == VIR_CPU_MODE_HOST_PASSTHROUGH) return 0; - if (virCPUModelIsAllowed(cpu->model, (const char **) models, nmodels)) + if (virCPUModelIsAllowed(cpu->model, models, nmodels)) return 0; if (cpu->fallback != VIR_CPU_FALLBACK_ALLOW) { @@ -928,7 +928,7 @@ virCPUTranslate(virArch arch, return -1; } - if (driver->translate(cpu, (const char **) models, nmodels) < 0) + if (driver->translate(cpu, models, nmodels) < 0) return -1; VIR_DEBUG("model=%s", NULLSTR(cpu->model)); diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h index 917d847e02c8d41f327583dbe03298fef7f5efe5..5ad811270ebd55e73e04f301d520e65f386b03b6 100644 --- a/src/cpu/cpu.h +++ b/src/cpu/cpu.h @@ -225,7 +225,7 @@ virCPUGetModels(virArch arch, char ***models); int virCPUTranslate(virArch arch, virCPUDefPtr cpu, - char **models, + const char **models, unsigned int nmodels) ATTRIBUTE_NONNULL(2); diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 09b2a72b53994880c4eb6358592229161f082d1f..14c799e46f5a556bb5cb0dda532ab419d66531e4 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -5083,7 +5083,8 @@ qemuProcessUpdateGuestCPU(virDomainDefPtr def, goto cleanup; 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; def->cpu->fallback = VIR_CPU_FALLBACK_FORBID;