mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-23 11:52:20 +00:00
qemu: Return -EINVAL to keep qemuDomainOpenFile() consistent
The description of the function says that the return value is a file descriptor on success and negative errno on failure which is not true. If the 'if' case with check on security labels fails, the return value is -1 not -errno. The solution is to return '-EINVAL' instead. Signed-off-by: Kristina Hanicova <khanicov@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
bcdaa91a27
commit
b6b6725c95
@ -11509,7 +11509,7 @@ qemuDomainOpenFile(virQEMUDriver *driver,
|
||||
(seclabel = virDomainDefGetSecurityLabelDef(vm->def, "dac")) != NULL &&
|
||||
seclabel->label != NULL &&
|
||||
(virParseOwnershipIds(seclabel->label, &user, &group) < 0))
|
||||
return -1;
|
||||
return -EINVAL;
|
||||
|
||||
return virQEMUFileOpenAs(user, group, dynamicOwnership,
|
||||
path, oflags, needUnlink);
|
||||
|
Loading…
x
Reference in New Issue
Block a user