diff options
author | Daniel Rosenberg <drosen@google.com> | 2018-10-02 17:40:44 -0700 |
---|---|---|
committer | Daniel Rosenberg <drosen@google.com> | 2018-10-03 15:39:25 -0700 |
commit | d3992498556fb1dce783d9d5e59f38cad492a6c3 (patch) | |
tree | 2c8cbf4f2a7e839e80af0dc3808c8813b3701284 /vdc.cpp | |
parent | ac244261c8abaaaab5cd24506dc464fb6d762043 (diff) | |
download | vold-d3992498556fb1dce783d9d5e59f38cad492a6c3.tar.gz |
Add checkpointing support for A/B updates
This adds implicit rollback support during A/B style updates.
If you explicitly start a checkpoint with -1, needsRollback will
trigger if the update fails, and should be used if any additional
cleanup is needed that is not covered by A/B itself.
Test: All Checkpoint tests pass
Bug: 111020314
Change-Id: I88b4a1098c6bac4dc1438a54c8a8f59577a6c17b
Diffstat (limited to 'vdc.cpp')
-rw-r--r-- | vdc.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -115,6 +115,10 @@ int main(int argc, char** argv) { bool enabled = false; checkStatus(vold->needsCheckpoint(&enabled)); return enabled ? 1 : 0; + } else if (args[0] == "checkpoint" && args[1] == "needsRollback" && args.size() == 2) { + bool enabled = false; + checkStatus(vold->needsRollback(&enabled)); + return enabled ? 1 : 0; } else if (args[0] == "checkpoint" && args[1] == "commitChanges" && args.size() == 2) { bool success = false; checkStatus(vold->commitChanges(&success)); |