static struct cpuArchDriver *
cpuGetSubDriver(virArch arch)
{
- unsigned int i;
- unsigned int j;
+ size_t i;
+ size_t j;
if (arch == VIR_ARCH_NONE) {
virReportError(VIR_ERR_INTERNAL_ERROR,
VIR_DEBUG("cpu=%p, data=%p, nmodels=%u, preferred=%s",
cpu, data, nmodels, NULLSTR(preferred));
if (models) {
- unsigned int i;
+ size_t i;
for (i = 0; i < nmodels; i++)
- VIR_DEBUG("models[%u]=%s", i, NULLSTR(models[i]));
+ VIR_DEBUG("models[%zu]=%s", i, NULLSTR(models[i]));
}
if (models == NULL && nmodels != 0) {
virCPUDefPtr *cpus = NULL;
virCPUDefPtr cpu = NULL;
char *cpustr;
- unsigned int i;
+ size_t i;
VIR_DEBUG("ncpus=%u, nmodels=%u", ncpus, nmodels);
if (xmlCPUs) {
for (i = 0; i < ncpus; i++)
- VIR_DEBUG("xmlCPUs[%u]=%s", i, NULLSTR(xmlCPUs[i]));
+ VIR_DEBUG("xmlCPUs[%zu]=%s", i, NULLSTR(xmlCPUs[i]));
}
if (models) {
for (i = 0; i < nmodels; i++)
- VIR_DEBUG("models[%u]=%s", i, NULLSTR(models[i]));
+ VIR_DEBUG("models[%zu]=%s", i, NULLSTR(models[i]));
}
if (xmlCPUs == NULL && ncpus != 0) {
unsigned int nmodels)
{
struct cpuArchDriver *driver;
- unsigned int i;
+ size_t i;
VIR_DEBUG("ncpus=%u, nmodels=%u", ncpus, nmodels);
if (cpus) {
for (i = 0; i < ncpus; i++)
- VIR_DEBUG("cpus[%u]=%p", i, cpus[i]);
+ VIR_DEBUG("cpus[%zu]=%p", i, cpus[i]);
}
if (models) {
for (i = 0; i < nmodels; i++)
- VIR_DEBUG("models[%u]=%s", i, NULLSTR(models[i]));
+ VIR_DEBUG("models[%zu]=%s", i, NULLSTR(models[i]));
}
if (cpus == NULL && ncpus != 0) {
const char **models,
unsigned int nmodels)
{
- unsigned int i;
+ size_t i;
if (!models || !nmodels)
return true;
genericHashFeatures(virCPUDefPtr cpu)
{
virHashTablePtr hash;
- unsigned int i;
+ size_t i;
if ((hash = virHashCreate(cpu->nfeatures, NULL)) == NULL)
return NULL;
{
virHashTablePtr hash;
virCPUCompareResult ret = VIR_CPU_COMPARE_ERROR;
- unsigned int i;
+ size_t i;
unsigned int reqfeatures;
if (((cpu->arch != VIR_ARCH_NONE) &&
virCPUFeatureDefPtr features = NULL;
unsigned int nfeatures;
unsigned int count;
- unsigned int i, j;
+ size_t i, j;
if (!cpuModelIsAllowed(cpus[0]->model, models, nmodels)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
const struct ppc_model *model;
const struct ppc_vendor *vendor = NULL;
virCPUDefPtr cpu = NULL;
- unsigned int i;
+ size_t i;
if (!(map = ppcLoadMap()))
goto error;
{
struct cpuX86cpuid *cpuids;
int len;
- unsigned int i;
+ size_t i;
if (function < CPUX86_EXTENDED) {
cpuids = data->x86.basic;
x86DataCopy(const union cpuData *data)
{
union cpuData *copy = NULL;
- int i;
+ size_t i;
if (VIR_ALLOC(copy) < 0
|| VIR_ALLOC_N(copy->x86.basic, data->x86.basic_len) < 0
x86DataAdd(union cpuData *data1,
const union cpuData *data2)
{
- unsigned int i;
+ size_t i;
if (x86DataExpand(data1,
data2->x86.basic_len - data1->x86.basic_len,
x86DataSubtract(union cpuData *data1,
const union cpuData *data2)
{
- unsigned int i;
+ size_t i;
unsigned int len;
len = MIN(data1->x86.basic_len, data2->x86.basic_len);
xmlNodePtr ctxt_node = ctxt->node;
struct x86_feature *feature;
int ret = 0;
- int i;
+ size_t i;
int n;
if (!(feature = x86FeatureNew()))
if (ret_fun < 0 || ret_eax == -2 || ret_ebx == -2
|| ret_ecx == -2 || ret_edx == -2) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Invalid cpuid[%d] in %s feature"), i, feature->name);
+ _("Invalid cpuid[%zu] in %s feature"), i, feature->name);
goto ignore;
}
int policy)
{
struct x86_model *model = NULL;
- int i;
+ size_t i;
if (policy == VIR_CPU_FEATURE_REQUIRE) {
if ((model = x86ModelFind(map, cpu->model)) == NULL) {
const struct x86_map *map)
{
const struct x86_model *cpu_model;
- unsigned int i;
+ size_t i;
if (!(cpu_model = x86ModelFind(map, cpu->model))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
struct x86_model *model;
char *vendor = NULL;
int ret = 0;
- int i;
+ size_t i;
int n;
if (!(model = x86ModelNew()))
struct x86_model *guest_model = NULL;
virCPUCompareResult ret;
enum compare_result result;
- unsigned int i;
+ size_t i;
if (cpu->arch != VIR_ARCH_NONE) {
bool found = false;
const struct x86_model *candidate;
virCPUDefPtr cpuCandidate;
virCPUDefPtr cpuModel = NULL;
- unsigned int i;
+ size_t i;
if (data == NULL || (map = x86LoadMap()) == NULL)
return -1;
struct x86_map *map = NULL;
struct x86_model *base_model = NULL;
virCPUDefPtr cpu = NULL;
- unsigned int i;
+ size_t i;
const struct x86_vendor *vendor = NULL;
struct x86_model *model = NULL;
bool outputVendor = true;
const virCPUDefPtr host)
{
int ret = -1;
- unsigned int i;
+ size_t i;
struct x86_map *map;
struct x86_model *host_model = NULL;