mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
vz: BUG: fix connecting hang in case of init failure
In case of prlsdkLoadDomains fails, vzOpenDefault should clear connection privateData pointer every time its memory is actually freed. Also it is not necessary to call vzConnectClose if a call to vzOpenDefault fails, because they both make cleanup of connection privateData. Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
This commit is contained in:
parent
53a15aed39
commit
635daa2556
@ -266,6 +266,7 @@ vzOpenDefault(virConnectPtr conn)
|
||||
prlsdkDisconnect(privconn);
|
||||
prlsdkDeinit();
|
||||
err_free:
|
||||
conn->privateData = NULL;
|
||||
VIR_FREE(privconn);
|
||||
return VIR_DRV_OPEN_ERROR;
|
||||
}
|
||||
@ -307,10 +308,8 @@ vzConnectOpen(virConnectPtr conn,
|
||||
return VIR_DRV_OPEN_ERROR;
|
||||
}
|
||||
|
||||
if ((ret = vzOpenDefault(conn)) != VIR_DRV_OPEN_SUCCESS) {
|
||||
vzConnectClose(conn);
|
||||
if ((ret = vzOpenDefault(conn)) != VIR_DRV_OPEN_SUCCESS)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return VIR_DRV_OPEN_SUCCESS;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user