[igt-dev] [PATCH i-g-t 6/9] lib/chamelium: Clear error after checking if chamelium is reachable

Arkadiusz Hiler
2020-02-25T16:56:37Z

Otherwise this may get us stuck in perpetual failure mode.

Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
---
lib/igt_chamelium.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/lib/igt_chamelium.c b/lib/igt_chamelium.c
index aaf17d51..b347682d 100644
--- a/lib/igt_chamelium.c
+++ b/lib/igt_chamelium.c
@@ -361,11 +361,17 @@ static bool __chamelium_is_reachable(struct chamelium *chamelium)
if (res != NULL)
xmlrpc_DECREF(res);

- if (chamelium->env.fault_occurred)
+ if (chamelium->env.fault_occurred) {
igt_debug("Chamelium RPC call failed: %s\n",
chamelium->env.fault_string);

- return !chamelium->env.fault_occurred;
+ xmlrpc_env_clean(&chamelium->env);
+ xmlrpc_env_init(&chamelium->env);
+
+ return false;
+ }
+
+ return true;
}

void chamelium_wait_reachable(struct chamelium *chamelium, int timeout)
--
2.24.1