diff --git a/src/esx/esx_vi.c b/src/esx/esx_vi.c index 43ff7ea0488d92349f29e04162ef3783ae6e007a..0bdfc5a8bec6175a70bf7a5429a59bcf418fc71e 100644 --- a/src/esx/esx_vi.c +++ b/src/esx/esx_vi.c @@ -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;