[PATCH 6/6] hyperv: do not overwrite errors from hypervInvokeMethod()

Matt Coleman mcoleman at datto.com
Thu Oct 22 16:38:24 UTC 2020


Signed-off-by: Matt Coleman <matt at datto.com>
---
 src/hyperv/hyperv_driver.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c
index fba1e355db..a71d0d6261 100644
--- a/src/hyperv/hyperv_driver.c
+++ b/src/hyperv/hyperv_driver.c
@@ -1800,11 +1800,8 @@ hypervDomainSendKey(virDomainPtr domain, unsigned int codeset,
         if (hypervAddSimpleParam(params, "keyCode", keycodeStr) < 0)
             goto cleanup;
 
-        if (hypervInvokeMethod(priv, &params, NULL) < 0) {
-            virReportError(VIR_ERR_INTERNAL_ERROR, _("Could not press key %d"),
-                           translatedKeycodes[i]);
+        if (hypervInvokeMethod(priv, &params, NULL) < 0)
             goto cleanup;
-        }
     }
 
     /* simulate holdtime by sleeping */
@@ -1823,11 +1820,8 @@ hypervDomainSendKey(virDomainPtr domain, unsigned int codeset,
         if (hypervAddSimpleParam(params, "keyCode", keycodeStr) < 0)
             goto cleanup;
 
-        if (hypervInvokeMethod(priv, &params, NULL) < 0) {
-            virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("Could not release key %s"), keycodeStr);
+        if (hypervInvokeMethod(priv, &params, NULL) < 0)
             goto cleanup;
-        }
     }
 
     result = 0;
@@ -1919,10 +1913,8 @@ hypervDomainSetMemoryFlags(virDomainPtr domain, unsigned long memory,
         }
     }
 
-    if (hypervInvokeMethod(priv, &params, NULL) < 0) {
-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Could not set memory"));
+    if (hypervInvokeMethod(priv, &params, NULL) < 0)
         goto cleanup;
-    }
 
     result = 0;
 
-- 
2.27.0





More information about the libvir-list mailing list