mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 23:25: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;
|
||||
}
|
||||
|
||||
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,
|
||||
"HostSystem", propertyNameList,
|
||||
esxVI_Boolean_False, hostSystem) < 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user