mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-24 05:25:18 +00:00
esx: don't ignore failure on close
Another warning caught by coverity. Continue to perform best-effort closing and resource release, but warn the caller about the failure. * src/esx/esx_driver.c (esxClose): Return an error on failure to close.
This commit is contained in:
parent
4acbb29821
commit
a8464c516b
@ -2,6 +2,7 @@
|
|||||||
/*
|
/*
|
||||||
* esx_driver.c: core driver methods for managing VMware ESX hosts
|
* esx_driver.c: core driver methods for managing VMware ESX hosts
|
||||||
*
|
*
|
||||||
|
* Copyright (C) 2010 Red Hat, Inc.
|
||||||
* Copyright (C) 2009, 2010 Matthias Bolte <matthias.bolte@googlemail.com>
|
* Copyright (C) 2009, 2010 Matthias Bolte <matthias.bolte@googlemail.com>
|
||||||
* Copyright (C) 2009 Maximilian Wilhelm <max@rfc2324.org>
|
* Copyright (C) 2009 Maximilian Wilhelm <max@rfc2324.org>
|
||||||
*
|
*
|
||||||
@ -559,16 +560,19 @@ static int
|
|||||||
esxClose(virConnectPtr conn)
|
esxClose(virConnectPtr conn)
|
||||||
{
|
{
|
||||||
esxPrivate *priv = conn->privateData;
|
esxPrivate *priv = conn->privateData;
|
||||||
|
int result = 0;
|
||||||
|
|
||||||
esxVI_EnsureSession(priv->host);
|
if (esxVI_EnsureSession(priv->host) < 0 ||
|
||||||
|
esxVI_Logout(priv->host) < 0) {
|
||||||
esxVI_Logout(priv->host);
|
result = -1;
|
||||||
|
}
|
||||||
esxVI_Context_Free(&priv->host);
|
esxVI_Context_Free(&priv->host);
|
||||||
|
|
||||||
if (priv->vCenter != NULL) {
|
if (priv->vCenter != NULL) {
|
||||||
esxVI_EnsureSession(priv->vCenter);
|
if (esxVI_EnsureSession(priv->vCenter) < 0 ||
|
||||||
|
esxVI_Logout(priv->vCenter) < 0) {
|
||||||
esxVI_Logout(priv->vCenter);
|
result = -1;
|
||||||
|
}
|
||||||
esxVI_Context_Free(&priv->vCenter);
|
esxVI_Context_Free(&priv->vCenter);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -579,7 +583,7 @@ esxClose(virConnectPtr conn)
|
|||||||
|
|
||||||
conn->privateData = NULL;
|
conn->privateData = NULL;
|
||||||
|
|
||||||
return 0;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user