mirror of https://gitee.com/openkylin/libvirt.git
vz: Fix return value in error path
If PrlVmDev_GetType(), PrlVmDev_GetIndex() or PrlVmCfg_GetBootDevCount()
fails, return false to indicate error. Returning -1 would be interpreted
as true when used in an if-statement.
Fixes: 8c9252aa6d
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
d9254cb0f0
commit
2ab1a55349
|
@ -1609,13 +1609,13 @@ prlsdkInBootList(PRL_HANDLE sdkdom,
|
|||
size_t i;
|
||||
|
||||
pret = PrlVmDev_GetType(sdktargetdev, &targetType);
|
||||
prlsdkCheckRetExit(pret, -1);
|
||||
prlsdkCheckRetExit(pret, false);
|
||||
|
||||
pret = PrlVmDev_GetIndex(sdktargetdev, &targetIndex);
|
||||
prlsdkCheckRetExit(pret, -1);
|
||||
prlsdkCheckRetExit(pret, false);
|
||||
|
||||
pret = PrlVmCfg_GetBootDevCount(sdkdom, &bootNum);
|
||||
prlsdkCheckRetExit(pret, -1);
|
||||
prlsdkCheckRetExit(pret, false);
|
||||
|
||||
for (i = 0; i < bootNum; ++i) {
|
||||
pret = PrlVmCfg_GetBootDev(sdkdom, i, &bootDev);
|
||||
|
|
Loading…
Reference in New Issue