]> xenbits.xensource.com Git - libvirt.git/commitdiff
vmware: Add more descriptive error message on Find failure
authorJohn Ferlan <jferlan@redhat.com>
Fri, 9 Mar 2018 14:46:47 +0000 (09:46 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Fri, 20 Apr 2018 11:50:35 +0000 (07:50 -0400)
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>
src/vmware/vmware_driver.c

index 4a9b821fab8ae3d5b48bf6764be7bddcbec8321f..cabcde6f85675dd5404efcd3a13c7cf4073d46a4 100644 (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;
     }