mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
Convert 'int i' to 'size_t i' in src/{xen,xenapi,xenxs} 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: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
111f6f4d73
commit
632180d14f
@ -78,7 +78,7 @@ read_stat(const char *path)
|
||||
{
|
||||
char str[64];
|
||||
int64_t r;
|
||||
int i;
|
||||
size_t i;
|
||||
FILE *fp;
|
||||
|
||||
fp = fopen(path, "r");
|
||||
@ -109,7 +109,7 @@ read_bd_stat(int device, int domid, const char *str)
|
||||
"/sys/devices/xen-backend/tap-%d-%d/statistics/%s"
|
||||
};
|
||||
|
||||
int i;
|
||||
size_t i;
|
||||
char *path;
|
||||
int64_t r;
|
||||
|
||||
|
@ -2445,7 +2445,8 @@ static int
|
||||
xenUnifiedNodeDeviceAssignedDomainId(virNodeDevicePtr dev)
|
||||
{
|
||||
int numdomains;
|
||||
int ret = -1, i;
|
||||
int ret = -1;
|
||||
size_t i;
|
||||
int *ids = NULL;
|
||||
char *bdf = NULL;
|
||||
char *xref = NULL;
|
||||
@ -2768,7 +2769,7 @@ xenRegister(void)
|
||||
void
|
||||
xenUnifiedDomainInfoListFree(xenUnifiedDomainInfoListPtr list)
|
||||
{
|
||||
int i;
|
||||
size_t i;
|
||||
|
||||
if (list == NULL)
|
||||
return;
|
||||
@ -2841,7 +2842,7 @@ xenUnifiedRemoveDomainInfo(xenUnifiedDomainInfoListPtr list,
|
||||
int id, char *name,
|
||||
unsigned char *uuid)
|
||||
{
|
||||
int i;
|
||||
size_t i;
|
||||
for (i = 0; i < list->count; i++) {
|
||||
if (list->doms[i]->id == id &&
|
||||
STREQ(list->doms[i]->name, name) &&
|
||||
|
@ -1267,7 +1267,7 @@ xenHypervisorSetSchedulerParameters(virConnectPtr conn,
|
||||
virTypedParameterPtr params,
|
||||
int nparams)
|
||||
{
|
||||
int i;
|
||||
size_t i;
|
||||
unsigned int val;
|
||||
xenUnifiedPrivatePtr priv = conn->privateData;
|
||||
char buf[256];
|
||||
@ -2039,7 +2039,7 @@ xenHypervisorBuildCapabilities(virConnectPtr conn, virArch hostarch,
|
||||
int nr_guest_archs)
|
||||
{
|
||||
virCapsPtr caps;
|
||||
int i;
|
||||
size_t i;
|
||||
int hv_major = hv_versions.hv >> 16;
|
||||
int hv_minor = hv_versions.hv & 0xFFFF;
|
||||
|
||||
@ -2219,7 +2219,7 @@ static virCapsPtr
|
||||
xenHypervisorMakeCapabilitiesSunOS(virConnectPtr conn)
|
||||
{
|
||||
struct guest_arch guest_arches[32];
|
||||
int i = 0;
|
||||
size_t i = 0;
|
||||
virCapsPtr caps = NULL;
|
||||
int pae, longmode;
|
||||
const char *hvm;
|
||||
@ -2288,7 +2288,7 @@ xenHypervisorMakeCapabilitiesInternal(virConnectPtr conn,
|
||||
char line[1024], *str, *token;
|
||||
regmatch_t subs[4];
|
||||
char *saveptr = NULL;
|
||||
int i;
|
||||
size_t i;
|
||||
|
||||
char hvm_type[4] = ""; /* "vmx" or "svm" (or "" if not in CPU). */
|
||||
int host_pae = 0;
|
||||
@ -2592,7 +2592,8 @@ xenHypervisorLookupDomainByUUID(virConnectPtr conn, const unsigned char *uuid)
|
||||
xenUnifiedPrivatePtr priv = conn->privateData;
|
||||
virDomainDefPtr ret;
|
||||
char *name;
|
||||
int maxids = 100, nids, i, id;
|
||||
int maxids = 100, nids, id;
|
||||
size_t i;
|
||||
|
||||
retry:
|
||||
if (!(XEN_GETDOMAININFOLIST_ALLOC(dominfos, maxids))) {
|
||||
@ -2840,7 +2841,9 @@ xenHypervisorNodeGetCellsFreeMemory(virConnectPtr conn,
|
||||
int maxCells)
|
||||
{
|
||||
xen_op_v2_sys op_sys;
|
||||
int i, j, ret;
|
||||
size_t i;
|
||||
int cell;
|
||||
int ret;
|
||||
xenUnifiedPrivatePtr priv = conn->privateData;
|
||||
|
||||
if (priv->nbNodeCells < 0) {
|
||||
@ -2867,22 +2870,22 @@ xenHypervisorNodeGetCellsFreeMemory(virConnectPtr conn,
|
||||
memset(&op_sys, 0, sizeof(op_sys));
|
||||
op_sys.cmd = XEN_V2_OP_GETAVAILHEAP;
|
||||
|
||||
for (i = startCell, j = 0;
|
||||
i < priv->nbNodeCells && j < maxCells; i++, j++) {
|
||||
for (cell = startCell, i = 0;
|
||||
cell < priv->nbNodeCells && i < maxCells; cell++, i++) {
|
||||
if (hv_versions.sys_interface >= 5)
|
||||
op_sys.u.availheap5.node = i;
|
||||
op_sys.u.availheap5.node = cell;
|
||||
else
|
||||
op_sys.u.availheap.node = i;
|
||||
op_sys.u.availheap.node = cell;
|
||||
ret = xenHypervisorDoV2Sys(priv->handle, &op_sys);
|
||||
if (ret < 0) {
|
||||
return -1;
|
||||
}
|
||||
if (hv_versions.sys_interface >= 5)
|
||||
freeMems[j] = op_sys.u.availheap5.avail_bytes;
|
||||
freeMems[i] = op_sys.u.availheap5.avail_bytes;
|
||||
else
|
||||
freeMems[j] = op_sys.u.availheap.avail_bytes;
|
||||
freeMems[i] = op_sys.u.availheap.avail_bytes;
|
||||
}
|
||||
return j;
|
||||
return i;
|
||||
}
|
||||
|
||||
|
||||
@ -2970,7 +2973,8 @@ xenHypervisorGetVcpus(virConnectPtr conn,
|
||||
int ret;
|
||||
xenUnifiedPrivatePtr priv = conn->privateData;
|
||||
virVcpuInfoPtr ipt;
|
||||
int nbinfo, i;
|
||||
int nbinfo;
|
||||
size_t i;
|
||||
|
||||
if (sizeof(cpumap_t) & 7) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
|
@ -72,7 +72,7 @@ xenInotifyXendDomainsDirLookup(virConnectPtr conn,
|
||||
char **name,
|
||||
unsigned char *uuid)
|
||||
{
|
||||
int i;
|
||||
size_t i;
|
||||
virDomainDefPtr def;
|
||||
const char *uuid_str;
|
||||
unsigned char rawuuid[VIR_UUID_BUFLEN];
|
||||
@ -159,7 +159,7 @@ xenInotifyXendDomainsDirRemoveEntry(virConnectPtr conn, const char *fname)
|
||||
xenUnifiedPrivatePtr priv = conn->privateData;
|
||||
const char *uuidstr = fname + strlen(XEND_DOMAINS_DIR) + 1;
|
||||
unsigned char uuid[VIR_UUID_BUFLEN];
|
||||
int i;
|
||||
size_t i;
|
||||
|
||||
if (virUUIDParse(uuidstr, uuid) < 0) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
|
@ -744,7 +744,7 @@ xenDaemonListDomainsOld(virConnectPtr xend)
|
||||
struct sexpr *root = NULL;
|
||||
char **ret = NULL;
|
||||
int count = 0;
|
||||
int i;
|
||||
size_t i;
|
||||
struct sexpr *_for_i, *node;
|
||||
|
||||
root = sexpr_get(xend, "/xend/domain");
|
||||
@ -1843,7 +1843,8 @@ xenDaemonDomainPinVcpu(virConnectPtr conn,
|
||||
int maplen)
|
||||
{
|
||||
char buf[VIR_UUID_BUFLEN], mapstr[sizeof(cpumap_t) * 64];
|
||||
int i, j, ret;
|
||||
size_t i, j;
|
||||
int ret;
|
||||
xenUnifiedPrivatePtr priv = conn->privateData;
|
||||
virDomainDefPtr def = NULL;
|
||||
|
||||
@ -1862,7 +1863,7 @@ xenDaemonDomainPinVcpu(virConnectPtr conn,
|
||||
/* from bit map, build character string of mapped CPU numbers */
|
||||
for (i = 0; i < maplen; i++) for (j = 0; j < 8; j++)
|
||||
if (cpumap[i] & (1 << j)) {
|
||||
snprintf(buf, sizeof(buf), "%d,", (8 * i) + j);
|
||||
snprintf(buf, sizeof(buf), "%zu,", (8 * i) + j);
|
||||
strcat(mapstr, buf);
|
||||
}
|
||||
if (priv->xendConfigVersion < XEND_CONFIG_VERSION_3_0_4)
|
||||
@ -2895,7 +2896,8 @@ xenDaemonListDefinedDomains(virConnectPtr conn,
|
||||
int maxnames)
|
||||
{
|
||||
struct sexpr *root = NULL;
|
||||
int i, ret = -1;
|
||||
size_t i;
|
||||
int ret = -1;
|
||||
struct sexpr *_for_i, *node;
|
||||
|
||||
if (maxnames == 0)
|
||||
@ -2905,8 +2907,6 @@ xenDaemonListDefinedDomains(virConnectPtr conn,
|
||||
if (root == NULL)
|
||||
goto error;
|
||||
|
||||
ret = 0;
|
||||
|
||||
/* coverity[copy_paste_error] */
|
||||
for (_for_i = root, node = root->u.s.car; _for_i->kind == SEXPR_CONS;
|
||||
_for_i = _for_i->u.s.cdr, node = _for_i->u.s.car) {
|
||||
@ -2920,16 +2920,16 @@ xenDaemonListDefinedDomains(virConnectPtr conn,
|
||||
break;
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
sexpr_free(root);
|
||||
return ret;
|
||||
|
||||
error:
|
||||
for (i = 0; i < ret; ++i)
|
||||
for (i = 0; ret != -1 && i < ret; ++i)
|
||||
VIR_FREE(names[i]);
|
||||
|
||||
ret = -1;
|
||||
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@ -3117,7 +3117,7 @@ xenDaemonSetSchedulerParameters(virConnectPtr conn,
|
||||
xenUnifiedPrivatePtr priv = conn->privateData;
|
||||
struct sexpr *root;
|
||||
char *sched_type = NULL;
|
||||
int i;
|
||||
size_t i;
|
||||
int sched_nparam = 0;
|
||||
int ret = -1;
|
||||
|
||||
|
@ -1146,7 +1146,8 @@ xenXMListDefinedDomains(virConnectPtr conn, char **const names, int maxnames)
|
||||
{
|
||||
xenUnifiedPrivatePtr priv = conn->privateData;
|
||||
struct xenXMListIteratorContext ctx;
|
||||
int i, ret = -1;
|
||||
size_t i;
|
||||
int ret = -1;
|
||||
|
||||
xenUnifiedLock(priv);
|
||||
|
||||
@ -1313,7 +1314,7 @@ xenXMDomainDetachDeviceFlags(virConnectPtr conn,
|
||||
virDomainDeviceDefPtr dev = NULL;
|
||||
virDomainDefPtr def;
|
||||
int ret = -1;
|
||||
int i;
|
||||
size_t i;
|
||||
xenUnifiedPrivatePtr priv = conn->privateData;
|
||||
|
||||
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG, -1);
|
||||
|
@ -223,7 +223,8 @@ xenStoreNumOfDomains(virConnectPtr conn)
|
||||
{
|
||||
unsigned int num;
|
||||
char **idlist = NULL, *endptr;
|
||||
int i, ret = -1, realnum = 0;
|
||||
size_t i;
|
||||
int ret = -1, realnum = 0;
|
||||
long id;
|
||||
xenUnifiedPrivatePtr priv = conn->privateData;
|
||||
|
||||
@ -264,7 +265,8 @@ xenStoreDoListDomains(virConnectPtr conn,
|
||||
int maxids)
|
||||
{
|
||||
char **idlist = NULL, *endptr;
|
||||
unsigned int num, i;
|
||||
unsigned int num;
|
||||
size_t i;
|
||||
int ret = -1;
|
||||
long id;
|
||||
|
||||
@ -404,7 +406,8 @@ char *
|
||||
xenStoreDomainGetNetworkID(virConnectPtr conn, int id, const char *mac)
|
||||
{
|
||||
char dir[80], path[128], **list = NULL, *val = NULL;
|
||||
unsigned int len, i, num;
|
||||
unsigned int len, num;
|
||||
size_t i;
|
||||
char *ret = NULL;
|
||||
xenUnifiedPrivatePtr priv = conn->privateData;
|
||||
|
||||
@ -453,7 +456,8 @@ char *
|
||||
xenStoreDomainGetDiskID(virConnectPtr conn, int id, const char *dev)
|
||||
{
|
||||
char dir[80], path[128], **list = NULL, *val = NULL;
|
||||
unsigned int devlen, len, i, num;
|
||||
unsigned int devlen, len, num;
|
||||
size_t i;
|
||||
char *ret = NULL;
|
||||
xenUnifiedPrivatePtr priv = conn->privateData;
|
||||
|
||||
@ -525,7 +529,8 @@ char *
|
||||
xenStoreDomainGetPCIID(virConnectPtr conn, int id, const char *bdf)
|
||||
{
|
||||
char dir[80], path[128], **list = NULL, *val = NULL;
|
||||
unsigned int len, i, num;
|
||||
unsigned int len, num;
|
||||
size_t i;
|
||||
char *ret = NULL;
|
||||
xenUnifiedPrivatePtr priv = conn->privateData;
|
||||
|
||||
@ -610,7 +615,7 @@ xenStoreDomainGetUUID(virConnectPtr conn, int id, unsigned char *uuid)
|
||||
static void
|
||||
xenStoreWatchListFree(xenStoreWatchListPtr list)
|
||||
{
|
||||
int i;
|
||||
size_t i;
|
||||
for (i=0; i<list->count; i++) {
|
||||
VIR_FREE(list->watches[i]->path);
|
||||
VIR_FREE(list->watches[i]->token);
|
||||
@ -687,7 +692,7 @@ xenStoreAddWatch(virConnectPtr conn,
|
||||
int
|
||||
xenStoreRemoveWatch(virConnectPtr conn, const char *path, const char *token)
|
||||
{
|
||||
int i;
|
||||
size_t i;
|
||||
xenStoreWatchListPtr list;
|
||||
xenUnifiedPrivatePtr priv = conn->privateData;
|
||||
|
||||
@ -736,7 +741,7 @@ xenStoreFindWatch(xenStoreWatchListPtr list,
|
||||
const char *path,
|
||||
const char *token)
|
||||
{
|
||||
int i;
|
||||
size_t i;
|
||||
for (i = 0; i < list->count; i++)
|
||||
if (STREQ(path, list->watches[i]->path) &&
|
||||
STREQ(token, list->watches[i]->token))
|
||||
@ -797,7 +802,8 @@ xenStoreDomainIntroduced(virConnectPtr conn,
|
||||
const char *token ATTRIBUTE_UNUSED,
|
||||
void *opaque)
|
||||
{
|
||||
int i, j, found, missing = 0, retries = 20;
|
||||
size_t i, j;
|
||||
int found, missing = 0, retries = 20;
|
||||
int new_domain_cnt;
|
||||
int *new_domids;
|
||||
int nread;
|
||||
@ -877,7 +883,8 @@ xenStoreDomainReleased(virConnectPtr conn,
|
||||
const char *token ATTRIBUTE_UNUSED,
|
||||
void *opaque)
|
||||
{
|
||||
int i, j, found, removed, retries = 20;
|
||||
size_t i, j;
|
||||
int found, removed, retries = 20;
|
||||
int new_domain_cnt;
|
||||
int *new_domids;
|
||||
int nread;
|
||||
|
@ -295,7 +295,8 @@ xenapiConnectGetVersion(virConnectPtr conn, unsigned long *hvVer)
|
||||
xen_host host;
|
||||
xen_session *session = ((struct _xenapiPrivate *)(conn->privateData))->session;
|
||||
xen_string_string_map *result = NULL;
|
||||
int i, ret = -1;
|
||||
size_t i;
|
||||
int ret = -1;
|
||||
char *version = NULL;
|
||||
if (!(xen_session_get_this_host(session, &host, session))) {
|
||||
xenapiSessionErrorHandler(conn, VIR_ERR_INTERNAL_ERROR, NULL);
|
||||
@ -459,7 +460,7 @@ xenapiConnectListDomains(virConnectPtr conn, int *ids, int maxids)
|
||||
xen_host host;
|
||||
xen_vm_set *result = NULL;
|
||||
int64_t t0;
|
||||
int i;
|
||||
size_t i;
|
||||
xen_session *session = ((struct _xenapiPrivate *)(conn->privateData))->session;
|
||||
if (xen_session_get_this_host(session, &host, session)) {
|
||||
xen_host_get_resident_vms(session, &result, host);
|
||||
@ -573,7 +574,7 @@ xenapiDomainCreateXML(virConnectPtr conn,
|
||||
static virDomainPtr
|
||||
xenapiDomainLookupByID(virConnectPtr conn, int id)
|
||||
{
|
||||
int i;
|
||||
size_t i;
|
||||
int64_t domID;
|
||||
char *uuid;
|
||||
xen_host host;
|
||||
@ -1217,7 +1218,8 @@ xenapiDomainGetVcpus(virDomainPtr dom,
|
||||
xen_vm_set *vms = NULL;
|
||||
xen_vm vm = NULL;
|
||||
xen_string_string_map *vcpu_params = NULL;
|
||||
int nvcpus = 0, i;
|
||||
int nvcpus = 0;
|
||||
size_t i;
|
||||
virDomainInfo domInfo;
|
||||
virNodeInfo nodeInfo;
|
||||
virVcpuInfoPtr ifptr;
|
||||
@ -1383,7 +1385,7 @@ xenapiDomainGetXMLDesc(virDomainPtr dom, unsigned int flags)
|
||||
}
|
||||
xen_vm_get_hvm_boot_params(session, &result, vm);
|
||||
if (result != NULL) {
|
||||
int i;
|
||||
size_t i;
|
||||
for (i = 0; i < result->size; i++) {
|
||||
if (STREQ(result->contents[i].key, "order")) {
|
||||
int cnt = 0;
|
||||
@ -1468,7 +1470,7 @@ xenapiDomainGetXMLDesc(virDomainPtr dom, unsigned int flags)
|
||||
}
|
||||
xen_vm_get_platform(session, &result, vm);
|
||||
if (result != NULL) {
|
||||
int i;
|
||||
size_t i;
|
||||
for (i = 0; i < result->size; i++) {
|
||||
if (STREQ(result->contents[i].val, "true")) {
|
||||
if (STREQ(result->contents[i].key, "acpi"))
|
||||
@ -1487,7 +1489,7 @@ xenapiDomainGetXMLDesc(virDomainPtr dom, unsigned int flags)
|
||||
}
|
||||
xen_vm_get_vifs(session, &vif_set, vm);
|
||||
if (vif_set) {
|
||||
int i;
|
||||
size_t i;
|
||||
xen_vif vif;
|
||||
xen_vif_record *vif_rec = NULL;
|
||||
xen_network network;
|
||||
@ -1543,13 +1545,15 @@ static int
|
||||
xenapiConnectListDefinedDomains(virConnectPtr conn, char **const names,
|
||||
int maxnames)
|
||||
{
|
||||
int i,j=0,doms;
|
||||
size_t i, j;
|
||||
int doms;
|
||||
xen_vm_set *result;
|
||||
xen_vm_record *record;
|
||||
xen_session *session = ((struct _xenapiPrivate *)(conn->privateData))->session;
|
||||
xen_vm_get_all(session, &result);
|
||||
memset(names, 0, sizeof(names[0])*maxnames);
|
||||
if (result != NULL) {
|
||||
for (i = 0; i < result->size && j < maxnames; i++) {
|
||||
for (i = 0, j = 0; i < result->size && j < maxnames; i++) {
|
||||
xen_vm_get_record(session, &record, result->contents[i]);
|
||||
if (record != NULL) {
|
||||
if (record->is_a_template == 0) {
|
||||
@ -1557,7 +1561,8 @@ xenapiConnectListDefinedDomains(virConnectPtr conn, char **const names,
|
||||
if (VIR_STRDUP(usenames, record->name_label) < 0) {
|
||||
xen_vm_record_free(record);
|
||||
xen_vm_set_free(result);
|
||||
while (--j >= 0) VIR_FREE(names[j]);
|
||||
for (i = 0; i < maxnames; i++)
|
||||
VIR_FREE(names[j]);
|
||||
return -1;
|
||||
}
|
||||
names[j++] = usenames;
|
||||
@ -1567,8 +1572,9 @@ xenapiConnectListDefinedDomains(virConnectPtr conn, char **const names,
|
||||
xenapiSessionErrorHandler(conn, VIR_ERR_INTERNAL_ERROR,
|
||||
_("Couldn't get VM record"));
|
||||
xen_vm_set_free(result);
|
||||
while (--j >= 0) VIR_FREE(names[j]);
|
||||
return -1;
|
||||
for (i = 0; i < maxnames; i++)
|
||||
VIR_FREE(names[j]);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
doms = j;
|
||||
@ -1590,7 +1596,8 @@ xenapiConnectNumOfDefinedDomains(virConnectPtr conn)
|
||||
{
|
||||
xen_vm_set *result;
|
||||
xen_vm_record *record;
|
||||
int DomNum = 0, i;
|
||||
int DomNum = 0;
|
||||
size_t i;
|
||||
xen_session *session = ((struct _xenapiPrivate *)(conn->privateData))->session;
|
||||
xen_vm_get_all(session, &result);
|
||||
if (result != NULL) {
|
||||
@ -1762,7 +1769,8 @@ xenapiDomainUndefine(virDomainPtr dom)
|
||||
static int
|
||||
xenapiDomainGetAutostart(virDomainPtr dom, int *autostart)
|
||||
{
|
||||
int i,flag=0;
|
||||
size_t i;
|
||||
int flag = 0;
|
||||
xen_vm_set *vms;
|
||||
xen_vm vm;
|
||||
xen_string_string_map *result;
|
||||
|
@ -41,7 +41,7 @@
|
||||
void
|
||||
xenSessionFree(xen_session *session)
|
||||
{
|
||||
int i;
|
||||
size_t i;
|
||||
if (session->error_description != NULL) {
|
||||
for (i = 0; i < session->error_description_count; i++)
|
||||
VIR_FREE(session->error_description[i]);
|
||||
@ -95,7 +95,7 @@ int
|
||||
xenapiUtil_ParseQuery(virConnectPtr conn, virURIPtr uri, int *noVerify)
|
||||
{
|
||||
int result = 0;
|
||||
int i;
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < uri->paramsCount; i++) {
|
||||
virURIParamPtr queryParam = &uri->params[i];
|
||||
@ -161,7 +161,7 @@ createXenAPIBootOrderString(int nboot, int *bootDevs)
|
||||
{
|
||||
virBuffer ret = VIR_BUFFER_INITIALIZER;
|
||||
char *val = NULL;
|
||||
int i;
|
||||
size_t i;
|
||||
for (i = 0; i < nboot; i++) {
|
||||
if (bootDevs[i] == VIR_DOMAIN_BOOT_FLOPPY)
|
||||
val = (char *)"a";
|
||||
@ -253,7 +253,7 @@ getStorageVolumeType(char *type)
|
||||
char *
|
||||
returnErrorFromSession(xen_session *session)
|
||||
{
|
||||
int i;
|
||||
size_t i;
|
||||
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
||||
for (i = 0; i < session->error_description_count; i++) {
|
||||
if (!i)
|
||||
@ -273,11 +273,11 @@ mapDomainPinVcpu(unsigned char *cpumap, int maplen)
|
||||
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
||||
size_t len;
|
||||
char *ret = NULL;
|
||||
int i, j;
|
||||
size_t i, j;
|
||||
for (i = 0; i < maplen; i++) {
|
||||
for (j = 0; j < 8; j++) {
|
||||
if (cpumap[i] & (1 << j)) {
|
||||
virBufferAsprintf(&buf, "%d,", (8*i)+j);
|
||||
virBufferAsprintf(&buf, "%zu,", (8*i)+j);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -450,7 +450,7 @@ createVMRecordFromXml(virConnectPtr conn, virDomainDefPtr def,
|
||||
char uuidStr[VIR_UUID_STRING_BUFLEN];
|
||||
xen_string_string_map *strings = NULL;
|
||||
int device_number = 0;
|
||||
int i;
|
||||
size_t i;
|
||||
|
||||
*record = xen_vm_record_alloc();
|
||||
if (VIR_STRDUP((*record)->name_label, def->name) < 0)
|
||||
|
@ -628,7 +628,7 @@ xenParseSxprSound(virDomainDefPtr def,
|
||||
const char *str)
|
||||
{
|
||||
if (STREQ(str, "all")) {
|
||||
int i;
|
||||
size_t i;
|
||||
|
||||
/*
|
||||
* Special compatibility code for Xen with a bogus
|
||||
@ -1338,7 +1338,7 @@ xenParseSxpr(const struct sexpr *root,
|
||||
/* Floppy disk config */
|
||||
if (hvm) {
|
||||
const char *const fds[] = { "fda", "fdb" };
|
||||
int i;
|
||||
size_t i;
|
||||
for (i = 0; i < ARRAY_CARDINALITY(fds); i++) {
|
||||
tmp = sexpr_fmt_node(root, "domain/image/hvm/%s", fds[i]);
|
||||
if ((tmp != NULL) && (tmp[0] != 0)) {
|
||||
@ -2049,7 +2049,7 @@ xenFormatSxprAllPCI(virDomainDefPtr def,
|
||||
virBufferPtr buf)
|
||||
{
|
||||
int hasPCI = 0;
|
||||
int i;
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < def->nhostdevs; i++)
|
||||
if (def->hostdevs[i]->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
|
||||
@ -2106,7 +2106,7 @@ xenFormatSxprSound(virDomainDefPtr def,
|
||||
virBufferPtr buf)
|
||||
{
|
||||
const char *str;
|
||||
int i;
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < def->nsounds; i++) {
|
||||
if (!(str = virDomainSoundModelTypeToString(def->sounds[i]->model))) {
|
||||
@ -2184,7 +2184,8 @@ xenFormatSxpr(virConnectPtr conn,
|
||||
char uuidstr[VIR_UUID_STRING_BUFLEN];
|
||||
const char *tmp;
|
||||
char *bufout;
|
||||
int hvm = 0, i, vmlocaltime = -1;
|
||||
int hvm = 0, vmlocaltime = -1;
|
||||
size_t i;
|
||||
bool in_image = false;
|
||||
|
||||
VIR_DEBUG("Formatting domain sexpr");
|
||||
@ -2361,21 +2362,21 @@ xenFormatSxpr(virConnectPtr conn,
|
||||
}
|
||||
if (def->serials) {
|
||||
if ((def->nserials > 1) || (def->serials[0]->target.port != 0)) {
|
||||
int maxport = -1;
|
||||
int j = 0;
|
||||
int maxport = -1, port;
|
||||
size_t j = 0;
|
||||
|
||||
virBufferAddLit(&buf, "(serial (");
|
||||
for (i = 0; i < def->nserials; i++)
|
||||
if (def->serials[i]->target.port > maxport)
|
||||
maxport = def->serials[i]->target.port;
|
||||
|
||||
for (i = 0; i <= maxport; i++) {
|
||||
for (port = 0; port <= maxport; port++) {
|
||||
virDomainChrDefPtr chr = NULL;
|
||||
|
||||
if (i)
|
||||
if (port)
|
||||
virBufferAddLit(&buf, " ");
|
||||
for (j = 0; j < def->nserials; j++) {
|
||||
if (def->serials[j]->target.port == i) {
|
||||
if (def->serials[j]->target.port == port) {
|
||||
chr = def->serials[j];
|
||||
break;
|
||||
}
|
||||
|
@ -258,7 +258,7 @@ xenParseXM(virConfPtr conf, int xendConfigVersion,
|
||||
virDomainNetDefPtr net = NULL;
|
||||
virDomainGraphicsDefPtr graphics = NULL;
|
||||
virDomainHostdevDefPtr hostdev = NULL;
|
||||
int i;
|
||||
size_t i;
|
||||
const char *defaultMachine;
|
||||
int vmlocaltime = 0;
|
||||
unsigned long count;
|
||||
@ -1416,7 +1416,7 @@ xenFormatXMPCI(virConfPtr conf,
|
||||
|
||||
virConfValuePtr pciVal = NULL;
|
||||
int hasPCI = 0;
|
||||
int i;
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < def->nhostdevs; i++)
|
||||
if (def->hostdevs[i]->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
|
||||
@ -1485,7 +1485,8 @@ virConfPtr xenFormatXM(virConnectPtr conn,
|
||||
virDomainDefPtr def,
|
||||
int xendConfigVersion) {
|
||||
virConfPtr conf = NULL;
|
||||
int hvm = 0, i, vmlocaltime = 0;
|
||||
int hvm = 0, vmlocaltime = 0;
|
||||
size_t i;
|
||||
char *cpus = NULL;
|
||||
const char *lifecycle;
|
||||
char uuid[VIR_UUID_STRING_BUFLEN];
|
||||
@ -1935,8 +1936,8 @@ virConfPtr xenFormatXM(virConnectPtr conn,
|
||||
if (ret < 0)
|
||||
goto cleanup;
|
||||
} else {
|
||||
int j = 0;
|
||||
int maxport = -1;
|
||||
size_t j = 0;
|
||||
int maxport = -1, port;
|
||||
virConfValuePtr serialVal = NULL;
|
||||
|
||||
if (VIR_ALLOC(serialVal) < 0)
|
||||
@ -1948,10 +1949,10 @@ virConfPtr xenFormatXM(virConnectPtr conn,
|
||||
if (def->serials[i]->target.port > maxport)
|
||||
maxport = def->serials[i]->target.port;
|
||||
|
||||
for (i = 0; i <= maxport; i++) {
|
||||
for (port = 0; port <= maxport; port++) {
|
||||
virDomainChrDefPtr chr = NULL;
|
||||
for (j = 0; j < def->nserials; j++) {
|
||||
if (def->serials[j]->target.port == i) {
|
||||
if (def->serials[j]->target.port == port) {
|
||||
chr = def->serials[j];
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user