提交 921d67e0 编写于 作者: D Daniel P. Berrange

Convert 'int i' to 'size_t i' in src/conf/ files

Convert the type of loop iterators named 'i', 'j', k',
'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or
'unsigned int', also santizing 'ii', 'jj', 'kk' to use
the normal 'i', 'j', 'k' naming
Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
上级 8849fc38
......@@ -123,7 +123,7 @@ virCapabilitiesFreeGuestMachine(virCapsGuestMachinePtr machine)
static void
virCapabilitiesFreeGuestDomain(virCapsGuestDomainPtr dom)
{
int i;
size_t i;
if (dom == NULL)
return;
......@@ -149,7 +149,7 @@ virCapabilitiesFreeGuestFeature(virCapsGuestFeaturePtr feature)
static void
virCapabilitiesFreeGuest(virCapsGuestPtr guest)
{
int i;
size_t i;
if (guest == NULL)
return;
......@@ -175,7 +175,7 @@ virCapabilitiesFreeGuest(virCapsGuestPtr guest)
void
virCapabilitiesFreeNUMAInfo(virCapsPtr caps)
{
int i;
size_t i;
for (i = 0; i < caps->host.nnumaCell; i++)
virCapabilitiesFreeHostNUMACell(caps->host.numaCell[i]);
......@@ -187,7 +187,7 @@ static void
virCapabilitiesDispose(void *object)
{
virCapsPtr caps = object;
int i;
size_t i;
for (i = 0; i < caps->nguests; i++)
virCapabilitiesFreeGuest(caps->guests[i]);
......@@ -327,7 +327,7 @@ virCapsGuestMachinePtr *
virCapabilitiesAllocMachines(const char *const *names, int nnames)
{
virCapsGuestMachinePtr *machines;
int i;
size_t i;
if (VIR_ALLOC_N(machines, nnames) < 0)
return NULL;
......@@ -353,7 +353,7 @@ void
virCapabilitiesFreeMachines(virCapsGuestMachinePtr *machines,
int nmachines)
{
int i;
size_t i;
if (!machines)
return;
for (i = 0; i < nmachines && machines[i]; i++) {
......@@ -518,7 +518,7 @@ extern int
virCapabilitiesSupportsGuestArch(virCapsPtr caps,
virArch arch)
{
int i;
size_t i;
for (i = 0; i < caps->nguests; i++) {
if (caps->guests[i]->arch.id == arch)
return 1;
......@@ -539,7 +539,7 @@ extern int
virCapabilitiesSupportsGuestOSType(virCapsPtr caps,
const char *ostype)
{
int i;
size_t i;
for (i = 0; i < caps->nguests; i++) {
if (STREQ(caps->guests[i]->ostype, ostype))
return 1;
......@@ -562,7 +562,7 @@ virCapabilitiesSupportsGuestOSTypeArch(virCapsPtr caps,
const char *ostype,
virArch arch)
{
int i;
size_t i;
for (i = 0; i < caps->nguests; i++) {
if (STREQ(caps->guests[i]->ostype, ostype) &&
caps->guests[i]->arch.id == arch)
......@@ -585,7 +585,7 @@ virCapabilitiesDefaultGuestArch(virCapsPtr caps,
const char *ostype,
const char *domain)
{
int i, j;
size_t i, j;
/* First try to find one matching host arch */
for (i = 0; i < caps->nguests; i++) {
......@@ -628,11 +628,11 @@ virCapabilitiesDefaultGuestMachine(virCapsPtr caps,
virArch arch,
const char *domain)
{
int i;
size_t i;
for (i = 0; i < caps->nguests; i++) {
virCapsGuestPtr guest = caps->guests[i];
int j;
size_t j;
if (!STREQ(guest->ostype, ostype) ||
guest->arch.id != arch)
......@@ -674,7 +674,7 @@ virCapabilitiesDefaultGuestEmulator(virCapsPtr caps,
virArch arch,
const char *domain)
{
int i, j;
size_t i, j;
for (i = 0; i < caps->nguests; i++) {
char *emulator;
if (STREQ(caps->guests[i]->ostype, ostype) &&
......@@ -697,8 +697,8 @@ virCapabilitiesFormatNUMATopology(virBufferPtr xml,
size_t ncells,
virCapsHostNUMACellPtr *cells)
{
int i;
int j;
size_t i;
size_t j;
char *siblings;
virBufferAddLit(xml, " <topology>\n");
......@@ -754,7 +754,7 @@ char *
virCapabilitiesFormatXML(virCapsPtr caps)
{
virBuffer xml = VIR_BUFFER_INITIALIZER;
int i, j, k;
size_t i, j, k;
char host_uuid[VIR_UUID_STRING_BUFLEN];
virBufferAddLit(&xml, "<capabilities>\n\n");
......
......@@ -60,7 +60,7 @@ VIR_ENUM_IMPL(virCPUFeaturePolicy, VIR_CPU_FEATURE_LAST,
void ATTRIBUTE_NONNULL(1)
virCPUDefFreeModel(virCPUDefPtr def)
{
unsigned int i;
size_t i;
VIR_FREE(def->model);
VIR_FREE(def->vendor);
......@@ -74,7 +74,7 @@ virCPUDefFreeModel(virCPUDefPtr def)
void
virCPUDefFree(virCPUDefPtr def)
{
unsigned int i;
size_t i;
if (!def)
return;
......@@ -97,7 +97,7 @@ virCPUDefCopyModel(virCPUDefPtr dst,
const virCPUDefPtr src,
bool resetPolicy)
{
unsigned int i;
size_t i;
if (VIR_STRDUP(dst->model, src->model) < 0 ||
VIR_STRDUP(dst->vendor, src->vendor) < 0 ||
......@@ -129,7 +129,7 @@ virCPUDefPtr
virCPUDefCopy(const virCPUDefPtr cpu)
{
virCPUDefPtr copy;
unsigned int i;
size_t i;
if (!cpu || VIR_ALLOC(copy) < 0)
return NULL;
......@@ -181,7 +181,7 @@ virCPUDefParseXML(const xmlNodePtr node,
virCPUDefPtr def;
xmlNodePtr *nodes = NULL;
int n;
unsigned int i;
size_t i;
char *cpuMode;
char *fallback = NULL;
char *vendor_id = NULL;
......@@ -379,7 +379,7 @@ virCPUDefParseXML(const xmlNodePtr node,
for (i = 0; i < n; i++) {
char *name;
int policy; /* enum virDomainCPUFeaturePolicy */
unsigned int j;
size_t j;
if (def->type == VIR_CPU_TYPE_GUEST) {
char *strpolicy;
......@@ -562,7 +562,7 @@ virCPUDefFormatBuf(virBufferPtr buf,
virCPUDefPtr def,
unsigned int flags)
{
unsigned int i;
size_t i;
bool formatModel;
bool formatFallback;
......@@ -663,7 +663,7 @@ virCPUDefAddFeature(virCPUDefPtr def,
const char *name,
int policy)
{
int i;
size_t i;
for (i = 0; i < def->nfeatures; i++) {
if (STREQ(name, def->features[i].name)) {
......@@ -694,7 +694,7 @@ virCPUDefIsEqual(virCPUDefPtr src,
virCPUDefPtr dst)
{
bool identical = false;
int i;
size_t i;
if (!src && !dst)
return true;
......
......@@ -793,7 +793,7 @@ virDomainAuditLifecycle(virDomainObjPtr vm, const char *op,
void
virDomainAuditStart(virDomainObjPtr vm, const char *reason, bool success)
{
int i;
size_t i;
for (i = 0; i < vm->def->ndisks; i++) {
virDomainDiskDefPtr disk = vm->def->disks[i];
......@@ -874,7 +874,7 @@ virDomainAuditSecurityLabel(virDomainObjPtr vm, bool success)
char uuidstr[VIR_UUID_STRING_BUFLEN];
char *vmname;
const char *virt;
int i;
size_t i;
virUUIDFormat(vm->def->uuid, uuidstr);
if (!(vmname = virAuditEncode("vm", vm->def->name))) {
......
此差异已折叠。
......@@ -2342,22 +2342,22 @@ virDomainHostdevRemove(virDomainDefPtr def, size_t i);
int virDomainHostdevFind(virDomainDefPtr def, virDomainHostdevDefPtr match,
virDomainHostdevDefPtr *found);
int virDomainGraphicsListenGetType(virDomainGraphicsDefPtr def, size_t ii)
int virDomainGraphicsListenGetType(virDomainGraphicsDefPtr def, size_t i)
ATTRIBUTE_NONNULL(1);
int virDomainGraphicsListenSetType(virDomainGraphicsDefPtr def, size_t ii, int val)
int virDomainGraphicsListenSetType(virDomainGraphicsDefPtr def, size_t i, int val)
ATTRIBUTE_NONNULL(1);
const char *virDomainGraphicsListenGetAddress(virDomainGraphicsDefPtr def,
size_t ii)
size_t i)
ATTRIBUTE_NONNULL(1);
int virDomainGraphicsListenSetAddress(virDomainGraphicsDefPtr def,
size_t ii, const char *address,
size_t i, const char *address,
int len, bool setType)
ATTRIBUTE_NONNULL(1);
const char *virDomainGraphicsListenGetNetwork(virDomainGraphicsDefPtr def,
size_t ii)
size_t i)
ATTRIBUTE_NONNULL(1);
int virDomainGraphicsListenSetNetwork(virDomainGraphicsDefPtr def,
size_t ii, const char *network, int len)
size_t i, const char *network, int len)
ATTRIBUTE_NONNULL(1);
int virDomainNetGetActualType(virDomainNetDefPtr iface);
......
......@@ -134,7 +134,7 @@ struct _virDomainEvent {
static void
virDomainEventCallbackListFree(virDomainEventCallbackListPtr list)
{
int i;
size_t i;
if (!list)
return;
......@@ -162,7 +162,7 @@ virDomainEventCallbackListRemove(virConnectPtr conn,
virConnectDomainEventCallback callback)
{
int ret = 0;
int i;
size_t i;
for (i = 0; i < cbList->count; i++) {
if (cbList->callbacks[i]->cb == VIR_DOMAIN_EVENT_CALLBACK(callback) &&
cbList->callbacks[i]->eventID == VIR_DOMAIN_EVENT_ID_LIFECYCLE &&
......@@ -213,7 +213,7 @@ virDomainEventCallbackListRemoveID(virConnectPtr conn,
int callbackID)
{
int ret = 0;
int i;
size_t i;
for (i = 0; i < cbList->count; i++) {
if (cbList->callbacks[i]->callbackID == callbackID &&
cbList->callbacks[i]->conn == conn) {
......@@ -255,7 +255,7 @@ virDomainEventCallbackListMarkDelete(virConnectPtr conn,
virConnectDomainEventCallback callback)
{
int ret = 0;
int i;
size_t i;
for (i = 0; i < cbList->count; i++) {
if (cbList->callbacks[i]->cb == VIR_DOMAIN_EVENT_CALLBACK(callback) &&
cbList->callbacks[i]->eventID == VIR_DOMAIN_EVENT_ID_LIFECYCLE &&
......@@ -281,7 +281,7 @@ virDomainEventCallbackListMarkDeleteID(virConnectPtr conn,
int callbackID)
{
int ret = 0;
int i;
size_t i;
for (i = 0; i < cbList->count; i++) {
if (cbList->callbacks[i]->callbackID == callbackID &&
cbList->callbacks[i]->conn == conn) {
......@@ -304,22 +304,22 @@ static int
virDomainEventCallbackListPurgeMarked(virDomainEventCallbackListPtr cbList)
{
int old_count = cbList->count;
int i;
for (i = 0; i < cbList->count; i++) {
if (cbList->callbacks[i]->deleted) {
virFreeCallback freecb = cbList->callbacks[i]->freecb;
int n;
for (n = 0; n < cbList->count; n++) {
if (cbList->callbacks[n]->deleted) {
virFreeCallback freecb = cbList->callbacks[n]->freecb;
if (freecb)
(*freecb)(cbList->callbacks[i]->opaque);
virObjectUnref(cbList->callbacks[i]->conn);
VIR_FREE(cbList->callbacks[i]);
(*freecb)(cbList->callbacks[n]->opaque);
virObjectUnref(cbList->callbacks[n]->conn);
VIR_FREE(cbList->callbacks[n]);
if (i < (cbList->count - 1))
memmove(cbList->callbacks + i,
cbList->callbacks + i + 1,
if (n < (cbList->count - 1))
memmove(cbList->callbacks + n,
cbList->callbacks + n + 1,
sizeof(*(cbList->callbacks)) *
(cbList->count - (i + 1)));
(cbList->count - (n + 1)));
cbList->count--;
i--;
n--;
}
}
if (cbList->count < old_count &&
......@@ -352,7 +352,7 @@ virDomainEventCallbackListAddID(virConnectPtr conn,
int *callbackID)
{
virDomainEventCallbackPtr event;
int i;
size_t i;
int ret = 0;
/* Check incoming */
......@@ -455,7 +455,7 @@ virDomainEventCallbackListEventID(virConnectPtr conn,
virDomainEventCallbackListPtr cbList,
int callbackID)
{
int i;
size_t i;
for (i = 0; i < cbList->count; i++) {
if (cbList->callbacks[i]->deleted)
......@@ -496,7 +496,7 @@ void virDomainEventFree(virDomainEventPtr event)
}
VIR_FREE(event->data.graphics.authScheme);
if (event->data.graphics.subject) {
int i;
size_t i;
for (i = 0; i < event->data.graphics.subject->nidentity; i++) {
VIR_FREE(event->data.graphics.subject->identities[i].type);
VIR_FREE(event->data.graphics.subject->identities[i].name);
......@@ -532,7 +532,7 @@ void virDomainEventFree(virDomainEventPtr event)
static void
virDomainEventQueueClear(virDomainEventQueuePtr queue)
{
int i;
size_t i;
if (!queue)
return;
......@@ -1345,7 +1345,7 @@ virDomainEventDispatch(virDomainEventPtr event,
virDomainEventDispatchFunc dispatch,
void *opaque)
{
int i;
size_t i;
/* Cache this now, since we may be dropping the lock,
and have more callbacks added. We're guaranteed not
to have any removed */
......@@ -1370,7 +1370,7 @@ virDomainEventQueueDispatch(virDomainEventQueuePtr queue,
virDomainEventDispatchFunc dispatch,
void *opaque)
{
int i;
size_t i;
for (i = 0; i < queue->count; i++) {
virDomainEventDispatch(queue->events[i], callbacks, dispatch, opaque);
......
......@@ -53,7 +53,7 @@ virDomainConfNWFilterTeardown(virDomainNetDefPtr net) {
void
virDomainConfVMNWFilterTeardown(virDomainObjPtr vm) {
int i;
size_t i;
if (nwfilterDriver != NULL) {
for (i = 0; i < vm->def->nnets; i++)
......
......@@ -54,12 +54,12 @@ void virInterfaceIpDefFree(virInterfaceIpDefPtr def) {
static
void virInterfaceProtocolDefFree(virInterfaceProtocolDefPtr def) {
int ii;
size_t i;
if (def == NULL)
return;
for (ii = 0; ii < def->nips; ii++) {
virInterfaceIpDefFree(def->ips[ii]);
for (i = 0; i < def->nips; i++) {
virInterfaceIpDefFree(def->ips[i]);
}
VIR_FREE(def->ips);
VIR_FREE(def->family);
......@@ -69,7 +69,8 @@ void virInterfaceProtocolDefFree(virInterfaceProtocolDefPtr def) {
void virInterfaceDefFree(virInterfaceDefPtr def)
{
int i, pp;
size_t i;
int pp;
if (def == NULL)
return;
......@@ -299,7 +300,8 @@ virInterfaceDefParseProtoIPv4(virInterfaceProtocolDefPtr def,
xmlXPathContextPtr ctxt) {
xmlNodePtr dhcp;
xmlNodePtr *ipNodes = NULL;
int nIpNodes, ii, ret = -1;
int nIpNodes, ret = -1;
size_t i;
char *tmp;
tmp = virXPathString("string(./route[1]/@gateway)", ctxt);
......@@ -322,14 +324,14 @@ virInterfaceDefParseProtoIPv4(virInterfaceProtocolDefPtr def,
goto error;
def->nips = 0;
for (ii = 0; ii < nIpNodes; ii++) {
for (i = 0; i < nIpNodes; i++) {
virInterfaceIpDefPtr ip;
if (VIR_ALLOC(ip) < 0)
goto error;
ctxt->node = ipNodes[ii];
ctxt->node = ipNodes[i];
ret = virInterfaceDefParseIp(ip, ctxt);
if (ret != 0) {
virInterfaceIpDefFree(ip);
......@@ -350,7 +352,8 @@ virInterfaceDefParseProtoIPv6(virInterfaceProtocolDefPtr def,
xmlXPathContextPtr ctxt) {
xmlNodePtr dhcp, autoconf;
xmlNodePtr *ipNodes = NULL;
int nIpNodes, ii, ret = -1;
int nIpNodes, ret = -1;
size_t i;
char *tmp;
tmp = virXPathString("string(./route[1]/@gateway)", ctxt);
......@@ -377,14 +380,14 @@ virInterfaceDefParseProtoIPv6(virInterfaceProtocolDefPtr def,
goto error;
def->nips = 0;
for (ii = 0; ii < nIpNodes; ii++) {
for (i = 0; i < nIpNodes; i++) {
virInterfaceIpDefPtr ip;
if (VIR_ALLOC(ip) < 0)
goto error;
ctxt->node = ipNodes[ii];
ctxt->node = ipNodes[i];
ret = virInterfaceDefParseIp(ip, ctxt);
if (ret != 0) {
virInterfaceIpDefFree(ip);
......@@ -475,7 +478,8 @@ virInterfaceDefParseBridge(virInterfaceDefPtr def,
xmlNodePtr *interfaces = NULL;
xmlNodePtr bridge;
virInterfaceDefPtr itf;
int nbItf, i;
int nbItf;
size_t i;
int ret = 0;
bridge = ctxt->node;
......@@ -515,7 +519,8 @@ virInterfaceDefParseBondItfs(virInterfaceDefPtr def,
xmlNodePtr *interfaces = NULL;
xmlNodePtr bond = ctxt->node;
virInterfaceDefPtr itf;
int nbItf, i;
int nbItf;
size_t i;
int ret = 0;
nbItf = virXPathNodeSet("./interface", ctxt, &interfaces);
......@@ -858,7 +863,7 @@ virInterfaceDefPtr virInterfaceDefParseFile(const char *filename)
static int
virInterfaceBridgeDefFormat(virBufferPtr buf,
const virInterfaceDefPtr def, int level) {
int i;
size_t i;
int ret = 0;
virBufferAsprintf(buf, "%*s <bridge", level*2, "");
......@@ -883,7 +888,7 @@ virInterfaceBridgeDefFormat(virBufferPtr buf,
static int
virInterfaceBondDefFormat(virBufferPtr buf,
const virInterfaceDefPtr def, int level) {
int i;
size_t i;
int ret = 0;
virBufferAsprintf(buf, "%*s <bond", level*2, "");
......@@ -965,43 +970,43 @@ virInterfaceVlanDefFormat(virBufferPtr buf,
static int
virInterfaceProtocolDefFormat(virBufferPtr buf, const virInterfaceDefPtr def,
int level) {
int pp, ii;
size_t i, j;
for (pp = 0; pp < def->nprotos; pp++) {
for (i = 0; i < def->nprotos; i++) {
virBufferAsprintf(buf, "%*s <protocol family='%s'>\n",
level*2, "", def->protos[pp]->family);
level*2, "", def->protos[i]->family);
if (def->protos[pp]->autoconf) {
if (def->protos[i]->autoconf) {
virBufferAsprintf(buf, "%*s <autoconf/>\n", level*2, "");
}
if (def->protos[pp]->dhcp) {
if (def->protos[pp]->peerdns == 0)
if (def->protos[i]->dhcp) {
if (def->protos[i]->peerdns == 0)
virBufferAsprintf(buf, "%*s <dhcp peerdns='no'/>\n",
level*2, "");
else if (def->protos[pp]->peerdns == 1)
else if (def->protos[i]->peerdns == 1)
virBufferAsprintf(buf, "%*s <dhcp peerdns='yes'/>\n",
level*2, "");
else
virBufferAsprintf(buf, "%*s <dhcp/>\n", level*2, "");
}
for (ii = 0; ii < def->protos[pp]->nips; ii++) {
if (def->protos[pp]->ips[ii]->address != NULL) {
for (j = 0; j < def->protos[i]->nips; j++) {
if (def->protos[i]->ips[j]->address != NULL) {
virBufferAsprintf(buf, "%*s <ip address='%s'", level*2, "",
def->protos[pp]->ips[ii]->address);
if (def->protos[pp]->ips[ii]->prefix != 0) {
def->protos[i]->ips[j]->address);
if (def->protos[i]->ips[j]->prefix != 0) {
virBufferAsprintf(buf, " prefix='%d'",
def->protos[pp]->ips[ii]->prefix);
def->protos[i]->ips[j]->prefix);
}
virBufferAddLit(buf, "/>\n");
}
}
if (def->protos[pp]->gateway != NULL) {
if (def->protos[i]->gateway != NULL) {
virBufferAsprintf(buf, "%*s <route gateway='%s'/>\n",
level*2, "", def->protos[pp]->gateway);
level*2, "", def->protos[i]->gateway);
}
virBufferAsprintf(buf, "%*s </protocol>\n", level*2, "");
......@@ -1153,7 +1158,8 @@ int virInterfaceFindByMACString(const virInterfaceObjListPtr interfaces,
const char *mac,
virInterfaceObjPtr *matches, int maxmatches)
{
unsigned int i, matchct = 0;
size_t i;
unsigned int matchct = 0;
for (i = 0; i < interfaces->count; i++) {
......@@ -1177,7 +1183,7 @@ virInterfaceObjPtr virInterfaceFindByName(const virInterfaceObjListPtr
interfaces,
const char *name)
{
unsigned int i;
size_t i;
for (i = 0; i < interfaces->count; i++) {
virInterfaceObjLock(interfaces->objs[i]);
......@@ -1191,7 +1197,7 @@ virInterfaceObjPtr virInterfaceFindByName(const virInterfaceObjListPtr
void virInterfaceObjListFree(virInterfaceObjListPtr interfaces)
{
unsigned int i;
size_t i;
for (i = 0; i < interfaces->count; i++)
virInterfaceObjFree(interfaces->objs[i]);
......@@ -1204,7 +1210,8 @@ int virInterfaceObjListClone(virInterfaceObjListPtr src,
virInterfaceObjListPtr dest)
{
int ret = -1;
unsigned int i, cnt;
size_t i;
unsigned int cnt;
if (!src || !dest)
goto cleanup;
......@@ -1276,7 +1283,7 @@ virInterfaceObjPtr virInterfaceAssignDef(virInterfaceObjListPtr interfaces,
void virInterfaceRemove(virInterfaceObjListPtr interfaces,
const virInterfaceObjPtr iface)
{
unsigned int i;
size_t i;
virInterfaceObjUnlock(iface);
for (i = 0; i < interfaces->count; i++) {
......
......@@ -39,7 +39,8 @@ virNetDevVlanParse(xmlNodePtr node, xmlXPathContextPtr ctxt, virNetDevVlanPtr de
const char *trunk = NULL;
const char *nativeMode = NULL;
xmlNodePtr *tagNodes = NULL;
int nTags, ii;
int nTags;
size_t i;
ctxt->node = node;
......@@ -59,10 +60,10 @@ virNetDevVlanParse(xmlNodePtr node, xmlXPathContextPtr ctxt, virNetDevVlanPtr de
def->nativeMode = 0;
def->nativeTag = 0;
for (ii = 0; ii < nTags; ii++) {
for (i = 0; i < nTags; i++) {
unsigned long id;
ctxt->node = tagNodes[ii];
ctxt->node = tagNodes[i];
if (virXPathULong("string(./@id)", ctxt, &id) < 0) {
virReportError(VIR_ERR_XML_ERROR, "%s",
_("missing or invalid vlan tag id attribute"));
......@@ -90,7 +91,7 @@ virNetDevVlanParse(xmlNodePtr node, xmlXPathContextPtr ctxt, virNetDevVlanPtr de
VIR_FREE(nativeMode);
def->nativeTag = id;
}
def->tag[ii] = id;
def->tag[i] = id;
}
def->nTags = nTags;
......@@ -141,7 +142,7 @@ cleanup:
int
virNetDevVlanFormat(virNetDevVlanPtr def, virBufferPtr buf)
{
int ii;
size_t i;
if (def->nTags == 0)
return 0;
......@@ -153,9 +154,9 @@ virNetDevVlanFormat(virNetDevVlanPtr def, virBufferPtr buf)
}
virBufferAsprintf(buf, "<vlan%s>\n", def->trunk ? " trunk='yes'" : "");
for (ii = 0; ii < def->nTags; ii++) {
for (i = 0; i < def->nTags; i++) {
if (def->nativeMode != VIR_NATIVE_VLAN_MODE_DEFAULT &&
def->nativeTag == def->tag[ii]) {
def->nativeTag == def->tag[i]) {
/* check the nativeMode in case we get <tag id='0'/>*/
const char *mode = virNativeVlanModeTypeToString(def->nativeMode);
if (!mode) {
......@@ -163,9 +164,9 @@ virNetDevVlanFormat(virNetDevVlanPtr def, virBufferPtr buf)
_("Bad value for nativeMode"));
}
virBufferAsprintf(buf, " <tag id='%u' nativeMode='%s'/>\n",
def->tag[ii], mode);
def->tag[i], mode);
} else {
virBufferAsprintf(buf, " <tag id='%u'/>\n", def->tag[ii]);
virBufferAsprintf(buf, " <tag id='%u'/>\n", def->tag[i]);
}
}
virBufferAddLit(buf, "</vlan>\n");
......
此差异已折叠。
......@@ -88,7 +88,7 @@ virNodeDeviceObjPtr
virNodeDeviceFindBySysfsPath(const virNodeDeviceObjListPtr devs,
const char *sysfs_path)
{
unsigned int i;
size_t i;
for (i = 0; i < devs->count; i++) {
virNodeDeviceObjLock(devs->objs[i]);
......@@ -106,7 +106,7 @@ virNodeDeviceFindBySysfsPath(const virNodeDeviceObjListPtr devs,
virNodeDeviceObjPtr virNodeDeviceFindByName(const virNodeDeviceObjListPtr devs,
const char *name)
{
unsigned int i;
size_t i;
for (i = 0; i < devs->count; i++) {
virNodeDeviceObjLock(devs->objs[i]);
......@@ -158,7 +158,7 @@ void virNodeDeviceObjFree(virNodeDeviceObjPtr dev)
void virNodeDeviceObjListFree(virNodeDeviceObjListPtr devs)
{
unsigned int i;
size_t i;
for (i = 0; i < devs->count; i++)
virNodeDeviceObjFree(devs->objs[i]);
VIR_FREE(devs->objs);
......@@ -203,7 +203,7 @@ virNodeDeviceObjPtr virNodeDeviceAssignDef(virNodeDeviceObjListPtr devs,
void virNodeDeviceObjRemove(virNodeDeviceObjListPtr devs,
const virNodeDeviceObjPtr dev)
{
unsigned int i;
size_t i;
virNodeDeviceObjUnlock(dev);
......@@ -232,7 +232,7 @@ char *virNodeDeviceDefFormat(const virNodeDeviceDefPtr def)
{
virBuffer buf = VIR_BUFFER_INITIALIZER;
virNodeDevCapsDefPtr caps;
unsigned int i = 0;
size_t i = 0;
virBufferAddLit(&buf, "<device>\n");
virBufferEscapeString(&buf, " <name>%s</name>\n", def->name);
......@@ -566,7 +566,8 @@ virNodeDevCapStorageParseXML(xmlXPathContextPtr ctxt,
union _virNodeDevCapData *data)
{
xmlNodePtr orignode, *nodes = NULL;
int i, n, ret = -1;
size_t i;
int n, ret = -1;
unsigned long long val;
orignode = ctxt->node;
......@@ -735,7 +736,8 @@ virNodeDevCapScsiHostParseXML(xmlXPathContextPtr ctxt,
const char *virt_type)
{
xmlNodePtr orignode, *nodes = NULL;
int ret = -1, n = 0, i;
int ret = -1, n = 0;
size_t i;
char *type = NULL;
orignode = ctxt->node;
......@@ -986,7 +988,8 @@ virNodeDevCapPciDevIommuGroupParseXML(xmlXPathContextPtr ctxt,
xmlNodePtr origNode = ctxt->node;
xmlNodePtr *addrNodes = NULL;
char *numberStr = NULL;
int nAddrNodes, ii, ret = -1;
int nAddrNodes, ret = -1;
size_t i;
virPCIDeviceAddressPtr pciAddr = NULL;
ctxt->node = iommuGroupNode;
......@@ -1008,9 +1011,9 @@ virNodeDevCapPciDevIommuGroupParseXML(xmlXPathContextPtr ctxt,
if ((nAddrNodes = virXPathNodeSet("./address", ctxt, &addrNodes)) < 0)
goto cleanup;
for (ii = 0; ii < nAddrNodes; ii++) {
for (i = 0; i < nAddrNodes; i++) {
virDevicePCIAddress addr = { 0, 0, 0, 0, 0 };
if (virDevicePCIAddressParseXML(addrNodes[ii], &addr) < 0)
if (virDevicePCIAddressParseXML(addrNodes[i], &addr) < 0)
goto cleanup;
if (VIR_ALLOC(pciAddr) < 0)
goto cleanup;
......@@ -1227,7 +1230,8 @@ virNodeDeviceDefParseXML(xmlXPathContextPtr ctxt,
virNodeDeviceDefPtr def;
virNodeDevCapsDefPtr *next_cap;
xmlNodePtr *nodes;
int n, i;
int n;
size_t i;
if (VIR_ALLOC(def) < 0)
return NULL;
......@@ -1436,7 +1440,7 @@ out:
void virNodeDevCapsDefFree(virNodeDevCapsDefPtr caps)
{
int i = 0;
size_t i = 0;
union _virNodeDevCapData *data = &caps->data;
switch (caps->type) {
......@@ -1593,7 +1597,7 @@ virNodeDeviceObjListExport(virConnectPtr conn,
virNodeDevicePtr device = NULL;
int ndevices = 0;
int ret = -1;
int i;
size_t i;
if (devices && VIR_ALLOC_N(tmp_devices, devobjs.count + 1) < 0)
goto cleanup;
......
......@@ -225,7 +225,7 @@ static const char ipsetflags_str[] = "ipsetflags";
static int
intMapGetByInt(const struct int_map *intmap, int32_t attr, const char **res)
{
int i = 0;
size_t i = 0;
bool found = false;
while (intmap[i].val && !found) {
......@@ -255,7 +255,7 @@ static int
intMapGetByString(const struct int_map *intmap, const char *str, int casecmp,
int32_t *result)
{
int i = 0;
size_t i = 0;
bool found = false;
while (intmap[i].val && !found) {
......@@ -272,7 +272,7 @@ intMapGetByString(const struct int_map *intmap, const char *str, int casecmp,
void
virNWFilterRuleDefFree(virNWFilterRuleDefPtr def) {
int i;
size_t i;
if (!def)
return;
......@@ -312,7 +312,7 @@ virNWFilterEntryFree(virNWFilterEntryPtr entry) {
void
virNWFilterDefFree(virNWFilterDefPtr def) {
int i;
size_t i;
if (!def)
return;
......@@ -348,7 +348,7 @@ virNWFilterObjFree(virNWFilterObjPtr obj)
void
virNWFilterObjListFree(virNWFilterObjListPtr nwfilters)
{
unsigned int i;
size_t i;
for (i = 0; i < nwfilters->count; i++)
virNWFilterObjFree(nwfilters->objs[i]);
VIR_FREE(nwfilters->objs);
......@@ -361,7 +361,7 @@ virNWFilterRuleDefAddVar(virNWFilterRuleDefPtr nwf,
nwItemDesc *item,
const char *var)
{
int i = 0;
size_t i = 0;
virNWFilterVarAccessPtr varAccess;
varAccess = virNWFilterVarAccessParse(var);
......@@ -410,7 +410,7 @@ void
virNWFilterObjRemove(virNWFilterObjListPtr nwfilters,
virNWFilterObjPtr nwfilter)
{
unsigned int i;
size_t i;
virNWFilterObjUnlock(nwfilter);
......@@ -786,7 +786,7 @@ parseStringItems(const struct int_map *int_map,
const char *input, int32_t *flags, char sep)
{
int rc = 0;
unsigned int i, j;
size_t i, j;
bool found;
i = 0;
......@@ -818,7 +818,8 @@ static int
printStringItems(virBufferPtr buf, const struct int_map *int_map,
int32_t flags, const char *sep)
{
unsigned int i, c = 0;
size_t i;
unsigned int c = 0;
int32_t mask = 0x1;
while (mask) {
......@@ -2354,7 +2355,7 @@ virNWFilterRuleParse(xmlNodePtr node)
while (cur != NULL) {
if (cur->type == XML_ELEMENT_NODE) {
int i = 0;
size_t i = 0;
while (1) {
if (found)
i = found_i;
......@@ -2667,7 +2668,7 @@ virNWFilterObjPtr
virNWFilterObjFindByUUID(virNWFilterObjListPtr nwfilters,
const unsigned char *uuid)
{
unsigned int i;
size_t i;
for (i = 0; i < nwfilters->count; i++) {
virNWFilterObjLock(nwfilters->objs[i]);
......@@ -2683,7 +2684,7 @@ virNWFilterObjFindByUUID(virNWFilterObjListPtr nwfilters,
virNWFilterObjPtr
virNWFilterObjFindByName(virNWFilterObjListPtr nwfilters, const char *name)
{
unsigned int i;
size_t i;
for (i = 0; i < nwfilters->count; i++) {
virNWFilterObjLock(nwfilters->objs[i]);
......@@ -2751,7 +2752,7 @@ _virNWFilterDefLoopDetect(virConnectPtr conn,
const char *filtername)
{
int rc = 0;
int i;
size_t i;
virNWFilterEntryPtr entry;
virNWFilterObjPtr obj;
......@@ -2818,7 +2819,7 @@ virNWFilterRegisterCallbackDriver(virNWFilterCallbackDriverPtr cbd)
void
virNWFilterUnRegisterCallbackDriver(virNWFilterCallbackDriverPtr cbd)
{
int i = 0;
size_t i = 0;
while (i < nCallbackDriver && callbackDrvArray[i] != cbd)
i++;
......@@ -2834,7 +2835,7 @@ virNWFilterUnRegisterCallbackDriver(virNWFilterCallbackDriverPtr cbd)
void
virNWFilterCallbackDriversLock(void)
{
int i;
size_t i;
for (i = 0; i < nCallbackDriver; i++)
callbackDrvArray[i]->vmDriverLock();
......@@ -2843,7 +2844,7 @@ virNWFilterCallbackDriversLock(void)
void
virNWFilterCallbackDriversUnlock(void)
{
int i;
size_t i;
for (i = 0; i < nCallbackDriver; i++)
callbackDrvArray[i]->vmDriverUnlock();
......@@ -2860,7 +2861,7 @@ static virDomainObjListIterator virNWFilterDomainFWUpdateCB;
int
virNWFilterInstFiltersOnAllVMs(virConnectPtr conn)
{
int i;
size_t i;
struct domUpdateCBStruct cb = {
.conn = conn,
.step = STEP_APPLY_CURRENT,
......@@ -2878,7 +2879,7 @@ virNWFilterInstFiltersOnAllVMs(virConnectPtr conn)
static int
virNWFilterTriggerVMFilterRebuild(virConnectPtr conn)
{
int i;
size_t i;
int ret = 0;
struct domUpdateCBStruct cb = {
.conn = conn,
......@@ -3201,7 +3202,7 @@ virNWFilterRuleDefDetailsFormat(virBufferPtr buf,
const virXMLAttr2Struct *att,
virNWFilterRuleDefPtr def)
{
int i = 0, j;
size_t i = 0, j;
bool typeShown = false;
bool neverShown = true;
bool asHex;
......@@ -3340,7 +3341,7 @@ err_exit:
static char *
virNWFilterRuleDefFormat(virNWFilterRuleDefPtr def)
{
int i;
size_t i;
virBuffer buf = VIR_BUFFER_INITIALIZER;
virBuffer buf2 = VIR_BUFFER_INITIALIZER;
char *data;
......@@ -3427,7 +3428,7 @@ virNWFilterDefFormat(virNWFilterDefPtr def)
{
virBuffer buf = VIR_BUFFER_INITIALIZER;
char uuid[VIR_UUID_STRING_BUFLEN];
int i;
size_t i;
char *xml;
virBufferAsprintf(&buf, "<filter name='%s' chain='%s'",
......
......@@ -44,7 +44,7 @@ static unsigned int virNWFilterVarAccessGetIntIterId(
void
virNWFilterVarValueFree(virNWFilterVarValuePtr val)
{
unsigned i;
size_t i;
if (!val)
return;
......@@ -68,7 +68,7 @@ virNWFilterVarValuePtr
virNWFilterVarValueCopy(const virNWFilterVarValuePtr val)
{
virNWFilterVarValuePtr res;
unsigned i;
size_t i;
char *str;
if (VIR_ALLOC(res) < 0)
......@@ -183,7 +183,8 @@ bool
virNWFilterVarValueEqual(const virNWFilterVarValuePtr a,
const virNWFilterVarValuePtr b)
{
unsigned int card, i, j;
unsigned int card;
size_t i, j;
const char *s;
if (!a || !b)
......@@ -277,7 +278,7 @@ virNWFilterVarValueDelNthValue(virNWFilterVarValuePtr val, unsigned int pos)
int
virNWFilterVarValueDelValue(virNWFilterVarValuePtr val, const char *value)
{
unsigned int i;
size_t i;
switch (val->valType) {
case NWFILTER_VALUE_TYPE_SIMPLE:
......@@ -299,7 +300,7 @@ virNWFilterVarValueDelValue(virNWFilterVarValuePtr val, const char *value)
void
virNWFilterVarCombIterFree(virNWFilterVarCombIterPtr ci)
{
unsigned int i;
size_t i;
if (!ci)
return;
......@@ -314,7 +315,7 @@ static int
virNWFilterVarCombIterGetIndexByIterId(virNWFilterVarCombIterPtr ci,
unsigned int iterId)
{
unsigned int i;
size_t i;
for (i = 0; i < ci->nIter; i++)
if (ci->iter[i].iterId == iterId)
......@@ -402,7 +403,7 @@ static bool
virNWFilterVarCombIterEntryAreUniqueEntries(virNWFilterVarCombIterEntryPtr cie,
virNWFilterHashTablePtr hash)
{
unsigned int i, j;
size_t i, j;
virNWFilterVarValuePtr varValue, tmp;
const char *value;
......@@ -463,7 +464,8 @@ virNWFilterVarCombIterCreate(virNWFilterHashTablePtr hash,
size_t nVarAccess)
{
virNWFilterVarCombIterPtr res;
unsigned int i, iterId;
size_t i;
unsigned int iterId;
int iterIndex = -1;
unsigned int nextIntIterId = VIR_NWFILTER_MAX_ITERID + 1;
......@@ -516,7 +518,7 @@ err_exit:
virNWFilterVarCombIterPtr
virNWFilterVarCombIterNext(virNWFilterVarCombIterPtr ci)
{
unsigned int i;
size_t i;
for (i = 0; i < ci->nIter; i++) {
next:
......@@ -543,7 +545,8 @@ const char *
virNWFilterVarCombIterGetVarValue(virNWFilterVarCombIterPtr ci,
const virNWFilterVarAccessPtr vap)
{
unsigned int i, iterId;
size_t i;
unsigned int iterId;
bool found = false;
const char *res = NULL;
virNWFilterVarValuePtr value;
......@@ -675,7 +678,7 @@ virNWFilterHashTablePut(virNWFilterHashTablePtr table,
void
virNWFilterHashTableFree(virNWFilterHashTablePtr table)
{
int i;
size_t i;
if (!table)
return;
virHashFree(table->hashTable);
......@@ -706,7 +709,7 @@ void *
virNWFilterHashTableRemoveEntry(virNWFilterHashTablePtr ht,
const char *entry)
{
int i;
size_t i;
void *value = virHashSteal(ht->hashTable, entry);
if (value) {
......@@ -886,7 +889,8 @@ virNWFilterFormatParamAttributes(virBufferPtr buf,
const char *filterref)
{
virHashKeyValuePairPtr items;
int i, j, card, numKeys;
size_t i, j;
int card, numKeys;
numKeys = virHashSize(table->hashTable);
......
......@@ -86,7 +86,7 @@ virDomainSnapshotDiskDefClear(virDomainSnapshotDiskDefPtr disk)
void virDomainSnapshotDefFree(virDomainSnapshotDefPtr def)
{
int i;
size_t i;
if (!def)
return;
......@@ -178,7 +178,8 @@ virDomainSnapshotDefParseString(const char *xmlStr,
virDomainSnapshotDefPtr def = NULL;
virDomainSnapshotDefPtr ret = NULL;
xmlNodePtr *nodes = NULL;
int i;
size_t i;
int n;
char *creation = NULL, *state = NULL;
struct timeval tv;
int active;
......@@ -313,10 +314,10 @@ virDomainSnapshotDefParseString(const char *xmlStr,
def->file = memoryFile;
memoryFile = NULL;
if ((i = virXPathNodeSet("./disks/*", ctxt, &nodes)) < 0)
if ((n = virXPathNodeSet("./disks/*", ctxt, &nodes)) < 0)
goto cleanup;
if (flags & VIR_DOMAIN_SNAPSHOT_PARSE_DISKS) {
def->ndisks = i;
def->ndisks = n;
if (def->ndisks && VIR_ALLOC_N(def->disks, def->ndisks) < 0)
goto cleanup;
for (i = 0; i < def->ndisks; i++) {
......@@ -324,7 +325,7 @@ virDomainSnapshotDefParseString(const char *xmlStr,
goto cleanup;
}
VIR_FREE(nodes);
} else if (i) {
} else if (n) {
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
_("unable to handle disk requests in snapshot"));
goto cleanup;
......@@ -379,7 +380,7 @@ virDomainSnapshotAlignDisks(virDomainSnapshotDefPtr def,
{
int ret = -1;
virBitmapPtr map = NULL;
int i;
size_t i;
int ndisks;
bool inuse;
......@@ -568,7 +569,7 @@ char *virDomainSnapshotDefFormat(const char *domain_uuid,
int internal)
{
virBuffer buf = VIR_BUFFER_INITIALIZER;
int i;
size_t i;
virCheckFlags(VIR_DOMAIN_XML_SECURE |
VIR_DOMAIN_XML_UPDATE_CPU, NULL);
......@@ -767,7 +768,7 @@ virDomainSnapshotObjListGetNames(virDomainSnapshotObjListPtr snapshots,
{
struct virDomainSnapshotNameData data = { names, maxnames, flags, 0,
false };
int i;
size_t i;
if (!from) {
/* LIST_ROOTS and LIST_DESCENDANTS have the same bit value,
......@@ -1009,7 +1010,7 @@ virDomainListSnapshots(virDomainSnapshotObjListPtr snapshots,
virDomainSnapshotPtr *list = NULL;
char **names;
int ret = -1;
int i;
size_t i;
if (!snaps || count < 0)
return count;
......@@ -1043,7 +1044,7 @@ cleanup:
bool
virDomainSnapshotDefIsExternal(virDomainSnapshotDefPtr def)
{
int i;
size_t i;
if (def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL)
return true;
......
......@@ -264,7 +264,7 @@ static virStoragePoolTypeInfo poolTypeInfo[] = {
static virStoragePoolTypeInfoPtr
virStoragePoolTypeInfoLookup(int type)
{
unsigned int i;
size_t i;
for (i = 0; i < ARRAY_CARDINALITY(poolTypeInfo); i++)
if (poolTypeInfo[i].poolType == type)
return &poolTypeInfo[i];
......@@ -296,7 +296,7 @@ virStorageVolOptionsForPoolType(int type)
void
virStorageVolDefFree(virStorageVolDefPtr def)
{
int i;
size_t i;
if (!def)
return;
......@@ -338,7 +338,7 @@ virStoragePoolSourceAdapterClear(virStoragePoolSourceAdapter adapter)
void
virStoragePoolSourceClear(virStoragePoolSourcePtr source)
{
int i;
size_t i;
if (!source)
return;
......@@ -416,7 +416,7 @@ virStoragePoolObjFree(virStoragePoolObjPtr obj)
void
virStoragePoolObjListFree(virStoragePoolObjListPtr pools)
{
unsigned int i;
size_t i;
for (i = 0; i < pools->count; i++)
virStoragePoolObjFree(pools->objs[i]);
VIR_FREE(pools->objs);
......@@ -427,7 +427,7 @@ void
virStoragePoolObjRemove(virStoragePoolObjListPtr pools,
virStoragePoolObjPtr pool)
{
unsigned int i;
size_t i;
virStoragePoolObjUnlock(pool);
......@@ -527,7 +527,8 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt,
int ret = -1;
xmlNodePtr relnode, *nodeset = NULL;
char *authType = NULL;
int nsource, i;
int nsource;
size_t i;
virStoragePoolOptionsPtr options;
char *name = NULL;
char *port = NULL;
......@@ -1039,7 +1040,7 @@ virStoragePoolSourceFormat(virBufferPtr buf,
virStoragePoolOptionsPtr options,
virStoragePoolSourcePtr src)
{
int i, j;
size_t i, j;
char uuid[VIR_UUID_STRING_BUFLEN];
virBufferAddLit(buf," <source>\n");
......@@ -1254,7 +1255,8 @@ virStorageVolDefParseXML(virStoragePoolDefPtr pool,
char *unit = NULL;
xmlNodePtr node;
xmlNodePtr *nodes = NULL;
int i, n;
size_t i;
int n;
options = virStorageVolOptionsForPoolType(pool->type);
if (options == NULL)
......@@ -1524,7 +1526,7 @@ virStorageVolTargetDefFormat(virStorageVolOptionsPtr options,
virBufferEscapeString(buf, " <compat>%s</compat>\n", def->compat);
if (options->featureToString && def->features) {
int i;
size_t i;
bool b;
bool empty = virBitmapIsAllClear(def->features);
......@@ -1565,7 +1567,7 @@ virStorageVolDefFormat(virStoragePoolDefPtr pool,
virBufferAddLit(&buf, " <source>\n");
if (def->source.nextent) {
int i;
size_t i;
const char *thispath = NULL;
for (i = 0; i < def->source.nextent; i++) {
if (thispath == NULL ||
......@@ -1621,7 +1623,7 @@ virStoragePoolObjPtr
virStoragePoolObjFindByUUID(virStoragePoolObjListPtr pools,
const unsigned char *uuid)
{
unsigned int i;
size_t i;
for (i = 0; i < pools->count; i++) {
virStoragePoolObjLock(pools->objs[i]);
......@@ -1637,7 +1639,7 @@ virStoragePoolObjPtr
virStoragePoolObjFindByName(virStoragePoolObjListPtr pools,
const char *name)
{
unsigned int i;
size_t i;
for (i = 0; i < pools->count; i++) {
virStoragePoolObjLock(pools->objs[i]);
......@@ -1653,7 +1655,7 @@ virStoragePoolObjPtr
virStoragePoolSourceFindDuplicateDevices(virStoragePoolObjPtr pool,
virStoragePoolDefPtr def)
{
unsigned int i, j;
size_t i, j;
for (i = 0; i < pool->def->source.ndevice; i++) {
for (j = 0; j < def->source.ndevice; j++) {
......@@ -1668,7 +1670,7 @@ virStoragePoolSourceFindDuplicateDevices(virStoragePoolObjPtr pool,
void
virStoragePoolObjClearVols(virStoragePoolObjPtr pool)
{
unsigned int i;
size_t i;
for (i = 0; i < pool->volumes.count; i++)
virStorageVolDefFree(pool->volumes.objs[i]);
......@@ -1680,7 +1682,7 @@ virStorageVolDefPtr
virStorageVolDefFindByKey(virStoragePoolObjPtr pool,
const char *key)
{
unsigned int i;
size_t i;
for (i = 0; i < pool->volumes.count; i++)
if (STREQ(pool->volumes.objs[i]->key, key))
......@@ -1693,7 +1695,7 @@ virStorageVolDefPtr
virStorageVolDefFindByPath(virStoragePoolObjPtr pool,
const char *path)
{
unsigned int i;
size_t i;
for (i = 0; i < pool->volumes.count; i++)
if (STREQ(pool->volumes.objs[i]->target.path, path))
......@@ -1706,7 +1708,7 @@ virStorageVolDefPtr
virStorageVolDefFindByName(virStoragePoolObjPtr pool,
const char *name)
{
unsigned int i;
size_t i;
for (i = 0; i < pool->volumes.count; i++)
if (STREQ(pool->volumes.objs[i]->name, name))
......@@ -1934,7 +1936,7 @@ virStoragePoolSourceListFormat(virStoragePoolSourceListPtr def)
virStoragePoolOptionsPtr options;
virBuffer buf = VIR_BUFFER_INITIALIZER;
const char *type;
int i;
size_t i;
options = virStoragePoolOptionsForPoolType(def->type);
if (options == NULL)
......@@ -2034,7 +2036,7 @@ int
virStoragePoolSourceFindDuplicate(virStoragePoolObjListPtr pools,
virStoragePoolDefPtr def)
{
int i;
size_t i;
int ret = 1;
virStoragePoolObjPtr pool = NULL;
virStoragePoolObjPtr matchpool = NULL;
......@@ -2197,7 +2199,7 @@ virStoragePoolObjListExport(virConnectPtr conn,
virStoragePoolPtr pool = NULL;
int npools = 0;
int ret = -1;
int i;
size_t i;
if (pools && VIR_ALLOC_N(tmp_pools, poolobjs.count + 1) < 0)
goto cleanup;
......
......@@ -130,7 +130,8 @@ virStorageEncryptionParseXML(xmlXPathContextPtr ctxt)
xmlNodePtr *nodes = NULL;
virStorageEncryptionPtr ret;
char *format_str;
int format, i, n;
int format, n;
size_t i;
if (VIR_ALLOC(ret) < 0)
return NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册