提交 7a056d06 编写于 作者: M Matthias Bolte

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.
上级 1d8099f4
...@@ -1968,6 +1968,13 @@ esxVI_LookupHostSystemByIp(esxVI_Context *ctx, const char *ipAddress, ...@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册