g_autoptr(GError) err = NULL;
g_autoptr(GMatchInfo) info = NULL;
int nextents;
- int ret = -1;
const char *regex_unit = "(\\S+)\\((\\S+)\\)";
size_t i;
unsigned long long offset;
if (virStrToLong_i(groups[5], NULL, 10, &nextents) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("malformed volume extent stripes value"));
- goto cleanup;
+ return -1;
}
}
if (virStrToLong_ull(groups[6], NULL, 10, &length) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("malformed volume extent length value"));
- goto cleanup;
+ return -1;
}
if (virStrToLong_ull(groups[7], NULL, 10, &size) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("malformed volume extent size value"));
- goto cleanup;
+ return -1;
}
/* Allocate space for 'nextents' regex_unit strings plus a comma for each */
if (!g_regex_match(re, groups[3], 0, &info)) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("malformed volume extent devices value"));
- goto cleanup;
+ return -1;
}
/* Each extent has a "path:offset" pair, and match #0
if (virStrToLong_ull(offset_str, NULL, 10, &offset) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("malformed volume extent offset value"));
- goto cleanup;
+ return -1;
}
extent.path = g_match_info_fetch(info, j);
VIR_APPEND_ELEMENT(vol->source.extents, vol->source.nextent, extent);
}
- ret = 0;
-
- cleanup:
- return ret;
+ return 0;
}