mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 07:17:44 +00:00
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:
parent
2073ed6f20
commit
8efec111fc
@ -119,8 +119,8 @@ cpuCompare(virCPUDefPtr host,
|
|||||||
int
|
int
|
||||||
cpuDecode(virCPUDefPtr cpu,
|
cpuDecode(virCPUDefPtr cpu,
|
||||||
const union cpuData *data,
|
const union cpuData *data,
|
||||||
unsigned int nmodels,
|
const char **models,
|
||||||
const char **models)
|
unsigned int nmodels)
|
||||||
{
|
{
|
||||||
struct cpuArchDriver *driver;
|
struct cpuArchDriver *driver;
|
||||||
|
|
||||||
@ -146,7 +146,7 @@ cpuDecode(virCPUDefPtr cpu,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return driver->decode(cpu, data, nmodels, models);
|
return driver->decode(cpu, data, models, nmodels);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -48,8 +48,8 @@ typedef virCPUCompareResult
|
|||||||
typedef int
|
typedef int
|
||||||
(*cpuArchDecode) (virCPUDefPtr cpu,
|
(*cpuArchDecode) (virCPUDefPtr cpu,
|
||||||
const union cpuData *data,
|
const union cpuData *data,
|
||||||
unsigned int nmodels,
|
const char **models,
|
||||||
const char **models);
|
unsigned int nmodels);
|
||||||
|
|
||||||
typedef int
|
typedef int
|
||||||
(*cpuArchEncode) (const virCPUDefPtr cpu,
|
(*cpuArchEncode) (const virCPUDefPtr cpu,
|
||||||
@ -95,8 +95,8 @@ cpuCompare (virCPUDefPtr host,
|
|||||||
extern int
|
extern int
|
||||||
cpuDecode (virCPUDefPtr cpu,
|
cpuDecode (virCPUDefPtr cpu,
|
||||||
const union cpuData *data,
|
const union cpuData *data,
|
||||||
unsigned int nmodels,
|
const char **models,
|
||||||
const char **models);
|
unsigned int nmodels);
|
||||||
|
|
||||||
extern int
|
extern int
|
||||||
cpuEncode (const char *arch,
|
cpuEncode (const char *arch,
|
||||||
|
@ -940,8 +940,8 @@ x86GuestData(virCPUDefPtr host,
|
|||||||
static int
|
static int
|
||||||
x86Decode(virCPUDefPtr cpu,
|
x86Decode(virCPUDefPtr cpu,
|
||||||
const union cpuData *data,
|
const union cpuData *data,
|
||||||
unsigned int nmodels,
|
const char **models,
|
||||||
const char **models)
|
unsigned int nmodels)
|
||||||
{
|
{
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
struct x86_map *map;
|
struct x86_map *map;
|
||||||
|
@ -1016,7 +1016,7 @@ qemudCapsInitCPU(virCapsPtr caps,
|
|||||||
cpu->threads = nodeinfo.threads;
|
cpu->threads = nodeinfo.threads;
|
||||||
|
|
||||||
if (!(data = cpuNodeData(arch))
|
if (!(data = cpuNodeData(arch))
|
||||||
|| cpuDecode(cpu, data, 0, NULL) < 0)
|
|| cpuDecode(cpu, data, NULL, 0) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
caps->host.cpu = cpu;
|
caps->host.cpu = cpu;
|
||||||
@ -2959,7 +2959,7 @@ qemuBuildCpuArgStr(const struct qemud_driver *driver,
|
|||||||
if (VIR_ALLOC(guest) < 0 || !(guest->arch = strdup(ut->machine)))
|
if (VIR_ALLOC(guest) < 0 || !(guest->arch = strdup(ut->machine)))
|
||||||
goto no_memory;
|
goto no_memory;
|
||||||
|
|
||||||
if (cpuDecode(guest, data, ncpus, cpus) < 0)
|
if (cpuDecode(guest, data, cpus, ncpus) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
virBufferVSprintf(&buf, "%s", guest->model);
|
virBufferVSprintf(&buf, "%s", guest->model);
|
||||||
|
Loading…
Reference in New Issue
Block a user