[PATCH 11/12] hyperv: provide a more detailed error message for WSMan faults

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Matt Coleman <matt@xxxxxxxxx>
---
 src/hyperv/hyperv_wmi.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/src/hyperv/hyperv_wmi.c b/src/hyperv/hyperv_wmi.c
index 4c1bd5e0d2..c14ff0e64a 100644
--- a/src/hyperv/hyperv_wmi.c
+++ b/src/hyperv/hyperv_wmi.c
@@ -789,9 +789,18 @@ hypervInvokeMethod(hypervPrivate *priv,
 
     returnValue = ws_xml_get_xpath_value(response, returnValue_xpath);
     if (!returnValue) {
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Could not get return value for %s invocation"),
-                       params->method);
+        g_autofree char *faultReason_xpath = g_strdup("/s:Envelope/s:Body/s:Fault/s:Reason/s:Text");
+        g_autofree char *faultReason = ws_xml_get_xpath_value(response, faultReason_xpath);
+
+        if (faultReason)
+            virReportError(VIR_ERR_INTERNAL_ERROR,
+                           _("WS-Management fault during %s invocation: %s"),
+                           params->method, faultReason);
+        else
+            virReportError(VIR_ERR_INTERNAL_ERROR,
+                           _("Could not get return value for %s invocation"),
+                           params->method);
+
         return -1;
     }
 
-- 
2.30.0





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux