mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user