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 <jdenemar@redhat.com>
This commit is contained in:
Jiri Denemark 2010-02-11 10:47:43 +01:00
parent 2073ed6f20
commit 8efec111fc
4 changed files with 11 additions and 11 deletions

View File

@ -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);
}

View File

@ -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,

View File

@ -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;

View File

@ -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);