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: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
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;