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

View File

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

View File

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

View File

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