mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 07:05:28 +00:00
lxc: Remove unnecessary error label
Since lxcConvertSize already creates an error message, there is no need to use an error: label in lxcSetMemTune to just overwrite or essentially rewrite the same error. So remove the label. Signed-off-by: John Ferlan <jferlan@redhat.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
parent
7eb56dcd9e
commit
f6399b9d89
@ -763,7 +763,7 @@ lxcSetMemTune(virDomainDefPtr def, virConfPtr properties)
|
|||||||
"lxc.cgroup.memory.limit_in_bytes",
|
"lxc.cgroup.memory.limit_in_bytes",
|
||||||
&value) > 0) {
|
&value) > 0) {
|
||||||
if (lxcConvertSize(value, &size) < 0)
|
if (lxcConvertSize(value, &size) < 0)
|
||||||
goto error;
|
return -1;
|
||||||
size = size / 1024;
|
size = size / 1024;
|
||||||
virDomainDefSetMemoryTotal(def, size);
|
virDomainDefSetMemoryTotal(def, size);
|
||||||
def->mem.hard_limit = virMemoryLimitTruncate(size);
|
def->mem.hard_limit = virMemoryLimitTruncate(size);
|
||||||
@ -773,7 +773,7 @@ lxcSetMemTune(virDomainDefPtr def, virConfPtr properties)
|
|||||||
"lxc.cgroup.memory.soft_limit_in_bytes",
|
"lxc.cgroup.memory.soft_limit_in_bytes",
|
||||||
&value) > 0) {
|
&value) > 0) {
|
||||||
if (lxcConvertSize(value, &size) < 0)
|
if (lxcConvertSize(value, &size) < 0)
|
||||||
goto error;
|
return -1;
|
||||||
def->mem.soft_limit = virMemoryLimitTruncate(size / 1024);
|
def->mem.soft_limit = virMemoryLimitTruncate(size / 1024);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -781,16 +781,10 @@ lxcSetMemTune(virDomainDefPtr def, virConfPtr properties)
|
|||||||
"lxc.cgroup.memory.memsw.limit_in_bytes",
|
"lxc.cgroup.memory.memsw.limit_in_bytes",
|
||||||
&value) > 0) {
|
&value) > 0) {
|
||||||
if (lxcConvertSize(value, &size) < 0)
|
if (lxcConvertSize(value, &size) < 0)
|
||||||
goto error;
|
return -1;
|
||||||
def->mem.swap_hard_limit = virMemoryLimitTruncate(size / 1024);
|
def->mem.swap_hard_limit = virMemoryLimitTruncate(size / 1024);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
|
||||||
_("failed to parse integer: '%s'"), value);
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
Loading…
Reference in New Issue
Block a user