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: Michal Privoznik <mprivozn@redhat.com>
"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;
}