提交 00d9edfe 编写于 作者: M Marcos Paulo de Souza 提交者: Michal Privoznik

esx_vi.c: Simplify error handling in MachineByName

The same pattern is used in lots of other places.
Also, reporting error message is not desired because all callers
check the return value and report errors on their own.
Signed-off-by: NMarcos Paulo de Souza <marcos.souza.org@gmail.com>
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 7ac08cc9
......@@ -3014,17 +3014,8 @@ esxVI_LookupVirtualMachineByName(esxVI_Context *ctx, const char *name,
break;
}
if (!(*virtualMachine)) {
if (occurrence == esxVI_Occurrence_OptionalItem) {
result = 0;
goto cleanup;
} else {
virReportError(VIR_ERR_NO_DOMAIN,
_("Could not find domain with name '%s'"), name);
goto cleanup;
}
}
if (!(*virtualMachine) && occurrence != esxVI_Occurrence_OptionalItem)
goto cleanup;
result = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册