vmware: Add more descriptive error message on Find failure

If vmwareDomainLookupByID or vmwareDomainLookupByName fails
to find a vm, let's be a bit more descriptive by providing
the failing id or name in the error message.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
John Ferlan 2018-03-09 09:46:47 -05:00
parent 68a6861902
commit 7b324eedb7

View File

@ -835,7 +835,8 @@ vmwareDomainLookupByID(virConnectPtr conn, int id)
vmwareDriverUnlock(driver);
if (!vm) {
virReportError(VIR_ERR_NO_DOMAIN, NULL);
virReportError(VIR_ERR_NO_DOMAIN,
_("no domain with matching id '%d'"), id);
goto cleanup;
}
@ -894,7 +895,8 @@ vmwareDomainLookupByName(virConnectPtr conn, const char *name)
vmwareDriverUnlock(driver);
if (!vm) {
virReportError(VIR_ERR_NO_DOMAIN, NULL);
virReportError(VIR_ERR_NO_DOMAIN,
_("no domain with matching name '%s'"), name);
goto cleanup;
}