goto cleanup;
}
- ret = 0;
for (i = 0; i < *nparams; i++) {
virMemoryParameterPtr param = ¶ms[i];
val = 0;
if (rc != 0) {
virReportSystemError(-rc, "%s",
_("unable to get memory hard limit"));
- ret = -1;
- continue;
+ goto cleanup;
}
if (virStrcpyStatic(param->field, VIR_DOMAIN_MEMORY_HARD_LIMIT) == NULL) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Field memory hard limit too long for destination"));
- ret = -1;
- continue;
+ goto cleanup;
}
param->value.ul = val;
break;
if (rc != 0) {
virReportSystemError(-rc, "%s",
_("unable to get memory soft limit"));
- ret = -1;
- continue;
+ goto cleanup;
}
if (virStrcpyStatic(param->field, VIR_DOMAIN_MEMORY_SOFT_LIMIT) == NULL) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Field memory soft limit too long for destination"));
- ret = -1;
- continue;
+ goto cleanup;
}
param->value.ul = val;
break;
if (rc != 0) {
virReportSystemError(-rc, "%s",
_("unable to get swap hard limit"));
- ret = -1;
- continue;
+ goto cleanup;
}
if (virStrcpyStatic(param->field, VIR_DOMAIN_MEMORY_SWAP_HARD_LIMIT) == NULL) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Field swap hard limit too long for destination"));
- ret = -1;
- continue;
+ goto cleanup;
}
param->value.ul = val;
break;
}
}
+ ret = 0;
+
cleanup:
if (group)
virCgroupFree(&group);