From 8efec111fc651b4c12b6284f479b77bc007e6627 Mon Sep 17 00:00:00 2001 From: Jiri Denemark Date: Thu, 11 Feb 2010 10:47:43 +0100 Subject: [PATCH] Swap position of nmodels and models parameters in cpuDecode() All other libvirt functions use array first and then number of elements in that array. Let's make cpuDecode follow this rule. Signed-off-by: Jiri Denemark --- src/cpu/cpu.c | 6 +++--- src/cpu/cpu.h | 8 ++++---- src/cpu/cpu_x86.c | 4 ++-- src/qemu/qemu_conf.c | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index ae8d37d0c3..e9ecc980cf 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c @@ -119,8 +119,8 @@ cpuCompare(virCPUDefPtr host, int cpuDecode(virCPUDefPtr cpu, const union cpuData *data, - unsigned int nmodels, - const char **models) + const char **models, + unsigned int nmodels) { struct cpuArchDriver *driver; @@ -146,7 +146,7 @@ cpuDecode(virCPUDefPtr cpu, return -1; } - return driver->decode(cpu, data, nmodels, models); + return driver->decode(cpu, data, models, nmodels); } diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h index 1e04993855..7ee0ce6d7c 100644 --- a/src/cpu/cpu.h +++ b/src/cpu/cpu.h @@ -48,8 +48,8 @@ typedef virCPUCompareResult typedef int (*cpuArchDecode) (virCPUDefPtr cpu, const union cpuData *data, - unsigned int nmodels, - const char **models); + const char **models, + unsigned int nmodels); typedef int (*cpuArchEncode) (const virCPUDefPtr cpu, @@ -95,8 +95,8 @@ cpuCompare (virCPUDefPtr host, extern int cpuDecode (virCPUDefPtr cpu, const union cpuData *data, - unsigned int nmodels, - const char **models); + const char **models, + unsigned int nmodels); extern int cpuEncode (const char *arch, diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 7ae7fbf6f9..c6ed078b1c 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -940,8 +940,8 @@ x86GuestData(virCPUDefPtr host, static int x86Decode(virCPUDefPtr cpu, const union cpuData *data, - unsigned int nmodels, - const char **models) + const char **models, + unsigned int nmodels) { int ret = -1; struct x86_map *map; diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 31a0c52112..00f761d9e4 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -1016,7 +1016,7 @@ qemudCapsInitCPU(virCapsPtr caps, cpu->threads = nodeinfo.threads; if (!(data = cpuNodeData(arch)) - || cpuDecode(cpu, data, 0, NULL) < 0) + || cpuDecode(cpu, data, NULL, 0) < 0) goto error; caps->host.cpu = cpu; @@ -2959,7 +2959,7 @@ qemuBuildCpuArgStr(const struct qemud_driver *driver, if (VIR_ALLOC(guest) < 0 || !(guest->arch = strdup(ut->machine))) goto no_memory; - if (cpuDecode(guest, data, ncpus, cpus) < 0) + if (cpuDecode(guest, data, cpus, ncpus) < 0) goto cleanup; virBufferVSprintf(&buf, "%s", guest->model);