提交 d999b601 编写于 作者: M Michal Privoznik

esx: De-duplicate @virtualMachine check in esxDomainLookupByName

The function call esxVI_LookupVirtualMachineByName(occurrence =
OptionalItem) and then checks if @virtualMachine is NULL. If it
is an error is reported. The same result can be achieved by
setting occurrence to RequiredItem.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 5feb9f94
......@@ -1577,12 +1577,7 @@ esxDomainLookupByName(virConnectPtr conn, const char *name)
"config.uuid\0") < 0 ||
esxVI_LookupVirtualMachineByName(priv->primary, name, propertyNameList,
&virtualMachine,
esxVI_Occurrence_OptionalItem) < 0) {
goto cleanup;
}
if (!virtualMachine) {
virReportError(VIR_ERR_NO_DOMAIN, _("No domain with name '%s'"), name);
esxVI_Occurrence_RequiredItem) < 0) {
goto cleanup;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册