mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 07:17:44 +00:00
lxc: fix error value of lxcNodeGetSecurityModel
When adding the ACL check and caps getter, we assumed that the default return value is -1, not 0 as usual. Fix the return value on error by assigning them explicitly. Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
00c4dd794a
commit
efe98ca98b
@ -1234,11 +1234,15 @@ static int lxcNodeGetSecurityModel(virConnectPtr conn,
|
|||||||
|
|
||||||
memset(secmodel, 0, sizeof(*secmodel));
|
memset(secmodel, 0, sizeof(*secmodel));
|
||||||
|
|
||||||
if (virNodeGetSecurityModelEnsureACL(conn) < 0)
|
if (virNodeGetSecurityModelEnsureACL(conn) < 0) {
|
||||||
|
ret = -1;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
if (!(caps = virLXCDriverGetCapabilities(driver, false)))
|
if (!(caps = virLXCDriverGetCapabilities(driver, false))) {
|
||||||
|
ret = -1;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
/* we treat no driver as success, but simply return no data in *secmodel */
|
/* we treat no driver as success, but simply return no data in *secmodel */
|
||||||
if (caps->host.nsecModels == 0
|
if (caps->host.nsecModels == 0
|
||||||
|
Loading…
Reference in New Issue
Block a user