OSDN Git Service

Fail startCheckpoint if checkpoints not supported
authorPaul Lawrence <paullawrence@google.com>
Wed, 15 May 2019 16:42:04 +0000 (09:42 -0700)
committerPaul Lawrence <paullawrence@google.com>
Wed, 15 May 2019 17:16:15 +0000 (10:16 -0700)
Bug: 131815738
Test: vdc checkpoint startCheckpoint 2 succeeds on blueline
      It fails with a modified fstab with no checkpoint=fs flag

Change-Id: I6d55810a1f711a670f18fbd10d8779c15f4e3cba

Checkpoint.cpp

index ba9af11..56ec782 100644 (file)
@@ -125,6 +125,10 @@ Status cp_supportsFileCheckpoint(bool& result) {
 }
 
 Status cp_startCheckpoint(int retry) {
+    bool result;
+    if (!cp_supportsCheckpoint(result).isOk() || !result)
+        return error(ENOTSUP, "Checkpoints not supported");
+
     if (retry < -1) return error(EINVAL, "Retry count must be more than -1");
     std::string content = std::to_string(retry + 1);
     if (retry == -1) {