diff options
author | Jiri Denemark <jdenemar@redhat.com> | 2016-11-10 09:49:06 +0100 |
---|---|---|
committer | Jiri Denemark <jdenemar@redhat.com> | 2016-11-15 15:49:16 +0100 |
commit | 2a2ce08a6d0efa6fbf0163bb2ffe4452168a0df9 (patch) | |
tree | 454435d79090792c3f280650e17129fcad74b985 /src/cpu | |
parent | adf44c7bae2d12162778c275b75983c6d8861214 (diff) | |
download | libvirt-2a2ce08a6d0efa6fbf0163bb2ffe4452168a0df9.tar.gz |
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>
Diffstat (limited to 'src/cpu')
-rw-r--r-- | src/cpu/cpu.c | 6 | ||||
-rw-r--r-- | src/cpu/cpu.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index 5040669161..9d34206bf5 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 917d847e02..5ad811270e 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); |