Add retry to sendFile handler
In cases where the ipmi interface is interrupted, we want to be able to
recover automatically without having to retrigger it again. For example,
this may happen if the ipminet interface gets reconfigure in the middle
of transfering an image.
The inital goal was to have the retry for ipminet only with and restart
at the remaining data instead of from the beginning. The issue there is
that we needed to restart the ipmi blob session to write again and doing
so will clear out the existing written data. When trying to write to
existing session will caused the update to be stalled and required a
ipmi restart to recover.
Tested:
images is able to be tranfered fully and validated after we interrupted
the ipminet interface in the middle.
Change-Id: Id734f6a92625bc6a1256fea010fb4b068f7bf1d5
Signed-off-by: Willy Tu <wltu@google.com>
diff --git a/tools/handler.hpp b/tools/handler.hpp
index f4bf843..4d2fe50 100644
--- a/tools/handler.hpp
+++ b/tools/handler.hpp
@@ -76,6 +76,11 @@
void sendFile(const std::string& target, const std::string& path) override;
/**
+ * @throw ToolException on failure.
+ */
+ void retrySendFile(const std::string& target, const std::string& path);
+
+ /**
* @throw ToolException on failure (TODO: throw on timeout.)
*/
bool verifyFile(const std::string& target, bool ignoreStatus) override;