summaryrefslogtreecommitdiff
path: root/common/dynamic_partition_control_interface.h
diff options
context:
space:
mode:
authorYifan Hong <elsk@google.com>2020-03-11 13:20:52 -0700
committerYifan Hong <elsk@google.com>2020-03-17 15:55:39 -0700
commit6a6d0f13d4b4ecb8357e8bdb22be6fec626510df (patch)
treec17ba9118bcd3cba314ecd7104d09dc480881abb /common/dynamic_partition_control_interface.h
parent5cd63faf5f81c3cc45162a87d09167e2d268b038 (diff)
ResetStatus deletes snapshots for VAB.
When ResetStatus() is called, delete snapshots to free up space on VAB devices. On regular A/B, there is no need to cancel the update completely so that the update may be resumed next time. However, on VAB devices, a cancelled update should not occupy previously allocated space. Test: manually call update_engine_client --cancel when an update is in progress, then call update_engine_client --reset_status, then call snapshotctl dump to check that snapshots are deleted. Then, re-apply the update. Test: manually kill update_engine when an update is in progress, then call update_engine_client --reset_status, then call snapshotctl dump to check that snapshots are deleted. Then, re-apply the update. Test: manually apply an update until UPDATED_NEED_REBOOT, then call update_engine_client --reset_status, then call snapshotctl dump to check that snapshots are deleted. Then, re-apply the update. Test: manually apply an update until UPDATED_NEED_REBOOT, then kill update_engine, then call update_engine_client --reset_status, then call snapshotctl dump to check that snapshots are deleted. Then, re-apply the update. Bug: 147696014 Change-Id: Ic7049772091a34e0e666fd7ae361ef474d5a28aa Merged-In: Ic7049772091a34e0e666fd7ae361ef474d5a28aa
Diffstat (limited to 'common/dynamic_partition_control_interface.h')
-rw-r--r--common/dynamic_partition_control_interface.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/common/dynamic_partition_control_interface.h b/common/dynamic_partition_control_interface.h
index a878f2e9..d5db9bcd 100644
--- a/common/dynamic_partition_control_interface.h
+++ b/common/dynamic_partition_control_interface.h
@@ -98,10 +98,26 @@ class DynamicPartitionControlInterface {
// - If any error, but caller should retry after reboot, action completes with
// kError.
// - If any irrecoverable failures, action completes with kDeviceCorrupted.
+ //
+ // See ResetUpdate for differences between CleanuPreviousUpdateAction and
+ // ResetUpdate.
virtual std::unique_ptr<AbstractAction> GetCleanupPreviousUpdateAction(
BootControlInterface* boot_control,
PrefsInterface* prefs,
CleanupPreviousUpdateActionDelegateInterface* delegate) = 0;
+
+ // Called after an unwanted payload has been successfully applied and the
+ // device has not yet been rebooted.
+ //
+ // For snapshot updates (Virtual A/B), it calls
+ // DeltaPerformer::ResetUpdateProgress(false /* quick */) and
+ // frees previously allocated space; the next update will need to be
+ // started over.
+ //
+ // Note: CleanupPreviousUpdateAction does not do anything if an update is in
+ // progress, while ResetUpdate() forcefully free previously
+ // allocated space for snapshot updates.
+ virtual bool ResetUpdate(PrefsInterface* prefs) = 0;
};
} // namespace chromeos_update_engine