mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 19:11:16 +00:00
openvz: refactor openvzSetDiskQuota
Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
8690caf5d4
commit
83b063ca60
@ -196,9 +196,8 @@ openvzSetDiskQuota(virDomainDef *vmdef,
|
|||||||
virDomainFSDef *fss,
|
virDomainFSDef *fss,
|
||||||
bool persist)
|
bool persist)
|
||||||
{
|
{
|
||||||
int ret = -1;
|
|
||||||
unsigned long long sl, hl;
|
unsigned long long sl, hl;
|
||||||
virCommand *cmd = virCommandNewArgList(VZCTL,
|
g_autoptr(virCommand) cmd = virCommandNewArgList(VZCTL,
|
||||||
"--quiet",
|
"--quiet",
|
||||||
"set",
|
"set",
|
||||||
vmdef->name,
|
vmdef->name,
|
||||||
@ -220,18 +219,14 @@ openvzSetDiskQuota(virDomainDef *vmdef,
|
|||||||
} else if (fss->space_soft_limit) {
|
} else if (fss->space_soft_limit) {
|
||||||
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("Can't set soft limit without hard limit"));
|
_("Can't set soft limit without hard limit"));
|
||||||
goto cleanup;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virCommandRun(cmd, NULL) < 0)
|
if (virCommandRun(cmd, NULL) < 0)
|
||||||
goto cleanup;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
return 0;
|
||||||
cleanup:
|
|
||||||
virCommandFree(cmd);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user