mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-27 08:05:24 +00:00
esx: Fix FindByIp response handling
FindByIp may return nothing if there is no host or virtual machine with the given IP address. Handle that case properly.
This commit is contained in:
parent
1d8099f4b6
commit
7a056d0648
@ -1968,6 +1968,13 @@ esxVI_LookupHostSystemByIp(esxVI_Context *ctx, const char *ipAddress,
|
|||||||
goto failure;
|
goto failure;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (managedObjectReference == NULL) {
|
||||||
|
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
|
||||||
|
_("Could not find host system with IP address '%s'"),
|
||||||
|
ipAddress);
|
||||||
|
goto failure;
|
||||||
|
}
|
||||||
|
|
||||||
if (esxVI_LookupObjectContentByType(ctx, managedObjectReference,
|
if (esxVI_LookupObjectContentByType(ctx, managedObjectReference,
|
||||||
"HostSystem", propertyNameList,
|
"HostSystem", propertyNameList,
|
||||||
esxVI_Boolean_False, hostSystem) < 0) {
|
esxVI_Boolean_False, hostSystem) < 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user