mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
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: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
5feb9f9420
commit
d999b6016b
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user