Fix data types used for list sizes in QEMU capabilities

The QEMU capabilities APIs used a misc of 'int' and
'unsigned int' for variables relating to array sizes.
Change all these to use 'size_t'

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrange 2012-08-22 11:56:11 +01:00
parent 4dced75e79
commit 9b5c540096
4 changed files with 15 additions and 15 deletions

View File

@ -292,7 +292,7 @@ qemuCapsProbeCommand(const char *qemu,
static int static int
qemuCapsParseMachineTypesStr(const char *output, qemuCapsParseMachineTypesStr(const char *output,
virCapsGuestMachinePtr **machines, virCapsGuestMachinePtr **machines,
int *nmachines) size_t *nmachines)
{ {
const char *p = output; const char *p = output;
const char *next; const char *next;
@ -361,7 +361,7 @@ int
qemuCapsProbeMachineTypes(const char *binary, qemuCapsProbeMachineTypes(const char *binary,
qemuCapsPtr caps, qemuCapsPtr caps,
virCapsGuestMachinePtr **machines, virCapsGuestMachinePtr **machines,
int *nmachines) size_t *nmachines)
{ {
char *output; char *output;
int ret = -1; int ret = -1;
@ -402,7 +402,7 @@ qemuCapsGetOldMachinesFromInfo(virCapsGuestDomainInfoPtr info,
const char *emulator, const char *emulator,
time_t emulator_mtime, time_t emulator_mtime,
virCapsGuestMachinePtr **machines, virCapsGuestMachinePtr **machines,
int *nmachines) size_t *nmachines)
{ {
virCapsGuestMachinePtr *list; virCapsGuestMachinePtr *list;
int i; int i;
@ -457,7 +457,7 @@ qemuCapsGetOldMachines(const char *ostype,
time_t emulator_mtime, time_t emulator_mtime,
virCapsPtr old_caps, virCapsPtr old_caps,
virCapsGuestMachinePtr **machines, virCapsGuestMachinePtr **machines,
int *nmachines) size_t *nmachines)
{ {
int i; int i;
@ -491,8 +491,8 @@ qemuCapsGetOldMachines(const char *ostype,
typedef int typedef int
(*qemuCapsParseCPUModels)(const char *output, (*qemuCapsParseCPUModels)(const char *output,
unsigned int *retcount, size_t *retcount,
const char ***retcpus); const char ***retcpus);
/* Format: /* Format:
* <arch> <model> * <arch> <model>
@ -501,7 +501,7 @@ typedef int
*/ */
static int static int
qemuCapsParseX86Models(const char *output, qemuCapsParseX86Models(const char *output,
unsigned int *retcount, size_t *retcount,
const char ***retcpus) const char ***retcpus)
{ {
const char *p = output; const char *p = output;
@ -577,7 +577,7 @@ error:
*/ */
static int static int
qemuCapsParsePPCModels(const char *output, qemuCapsParsePPCModels(const char *output,
unsigned int *retcount, size_t *retcount,
const char ***retcpus) const char ***retcpus)
{ {
const char *p = output; const char *p = output;
@ -647,7 +647,7 @@ int
qemuCapsProbeCPUModels(const char *qemu, qemuCapsProbeCPUModels(const char *qemu,
qemuCapsPtr caps, qemuCapsPtr caps,
const char *arch, const char *arch,
unsigned int *count, size_t *count,
const char ***cpus) const char ***cpus)
{ {
char *output = NULL; char *output = NULL;
@ -704,9 +704,9 @@ qemuCapsInitGuest(virCapsPtr caps,
char *binary = NULL; char *binary = NULL;
time_t binary_mtime; time_t binary_mtime;
virCapsGuestMachinePtr *machines = NULL; virCapsGuestMachinePtr *machines = NULL;
int nmachines = 0; size_t nmachines = 0;
struct stat st; struct stat st;
unsigned int ncpus; size_t ncpus;
qemuCapsPtr qemubinCaps = NULL; qemuCapsPtr qemubinCaps = NULL;
qemuCapsPtr kvmbinCaps = NULL; qemuCapsPtr kvmbinCaps = NULL;
int ret = -1; int ret = -1;

View File

@ -180,12 +180,12 @@ virCapsPtr qemuCapsInit(virCapsPtr old_caps);
int qemuCapsProbeMachineTypes(const char *binary, int qemuCapsProbeMachineTypes(const char *binary,
qemuCapsPtr caps, qemuCapsPtr caps,
virCapsGuestMachinePtr **machines, virCapsGuestMachinePtr **machines,
int *nmachines); size_t *nmachines);
int qemuCapsProbeCPUModels(const char *qemu, int qemuCapsProbeCPUModels(const char *qemu,
qemuCapsPtr caps, qemuCapsPtr caps,
const char *arch, const char *arch,
unsigned int *count, size_t *count,
const char ***cpus); const char ***cpus);
int qemuCapsExtractVersion(virCapsPtr caps, int qemuCapsExtractVersion(virCapsPtr caps,

View File

@ -4082,7 +4082,7 @@ qemuBuildCpuArgStr(const struct qemud_driver *driver,
const virCPUDefPtr host = driver->caps->host.cpu; const virCPUDefPtr host = driver->caps->host.cpu;
virCPUDefPtr guest = NULL; virCPUDefPtr guest = NULL;
virCPUDefPtr cpu = NULL; virCPUDefPtr cpu = NULL;
unsigned int ncpus = 0; size_t ncpus = 0;
const char **cpus = NULL; const char **cpus = NULL;
const char *default_model; const char *default_model;
union cpuData *data = NULL; union cpuData *data = NULL;

View File

@ -5440,7 +5440,7 @@ static int
qemudCanonicalizeMachineDirect(virDomainDefPtr def, char **canonical) qemudCanonicalizeMachineDirect(virDomainDefPtr def, char **canonical)
{ {
virCapsGuestMachinePtr *machines = NULL; virCapsGuestMachinePtr *machines = NULL;
int i, nmachines = 0; size_t i, nmachines = 0;
/* XXX we should be checking emulator capabilities and pass them instead /* XXX we should be checking emulator capabilities and pass them instead
* of NULL so that -nodefconfig or -no-user-config is properly added when * of NULL so that -nodefconfig or -no-user-config is properly added when