vz: reset errors after ignoring return values
If we are going to ignore return value of a functions that can raise an error, it's not enough to use ignore_value construction. We should explicitly call virResetLastError Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
This commit is contained in:
parent
d9e0d4ecbb
commit
0f13dc81d7
@ -331,6 +331,11 @@ vzDriverObjNew(void)
|
|||||||
|
|
||||||
driver->hostsysinfo = virSysinfoRead();
|
driver->hostsysinfo = virSysinfoRead();
|
||||||
ignore_value(prlsdkLoadDomains(driver));
|
ignore_value(prlsdkLoadDomains(driver));
|
||||||
|
|
||||||
|
/* As far as waitDomainJob finally calls virReportErrorHelper
|
||||||
|
* and we are not going to report it, reset it expicitly*/
|
||||||
|
virResetLastError();
|
||||||
|
|
||||||
return driver;
|
return driver;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3114,6 +3114,9 @@ static int prlsdkConfigureGateways(PRL_HANDLE sdknet, virDomainNetDefPtr net)
|
|||||||
? VIR_SOCKET_ADDR_IPV4_ALL
|
? VIR_SOCKET_ADDR_IPV4_ALL
|
||||||
: VIR_SOCKET_ADDR_IPV6_ALL),
|
: VIR_SOCKET_ADDR_IPV6_ALL),
|
||||||
VIR_SOCKET_ADDR_FAMILY(addrdst)));
|
VIR_SOCKET_ADDR_FAMILY(addrdst)));
|
||||||
|
/* virSocketAddrParse raises an error
|
||||||
|
* and we are not going to report it, reset it expicitly*/
|
||||||
|
virResetLastError();
|
||||||
|
|
||||||
if (!virSocketAddrEqual(addrdst, &zero)) {
|
if (!virSocketAddrEqual(addrdst, &zero)) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
@ -3360,6 +3363,10 @@ prlsdkCleanupBridgedNet(vzDriverPtr driver,
|
|||||||
job = PrlSrv_DeleteVirtualNetwork(driver->server, vnet, 0);
|
job = PrlSrv_DeleteVirtualNetwork(driver->server, vnet, 0);
|
||||||
ignore_value(waitDomainJob(job, dom));
|
ignore_value(waitDomainJob(job, dom));
|
||||||
|
|
||||||
|
/* As far as waitDomainJob finally calls virReportErrorHelper
|
||||||
|
* and we are not going to report it, reset it expicitly*/
|
||||||
|
virResetLastError();
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
PrlHandle_Free(vnet);
|
PrlHandle_Free(vnet);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user