summaryrefslogtreecommitdiff
path: root/common/dynamic_partition_control_interface.h
diff options
context:
space:
mode:
authorYifan Hong <elsk@google.com>2020-01-07 18:13:56 -0800
committerYifan Hong <elsk@google.com>2020-01-16 05:05:48 +0000
commitf033ecb6329c9bab43c91b1a2af812d3d2dd7daa (patch)
tree99f2176378d28852e0dad5c1984453e73e6fcf0c /common/dynamic_partition_control_interface.h
parent0b664d1964f88d865643b7e157842bd9ee4eed0e (diff)
DynamicPartitionControl: Add required_size to Prepare
Add out parameter required_size to PreparePartitionsForUpdate to indicate the total size required on /userdata in order to apply the update. Bug: 138808058 Test: update_engine_unittests Change-Id: I2768d13671e212fd24a1a22811b50c9738834459
Diffstat (limited to 'common/dynamic_partition_control_interface.h')
-rw-r--r--common/dynamic_partition_control_interface.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/common/dynamic_partition_control_interface.h b/common/dynamic_partition_control_interface.h
index c171fb5d..19bb5231 100644
--- a/common/dynamic_partition_control_interface.h
+++ b/common/dynamic_partition_control_interface.h
@@ -64,10 +64,15 @@ class DynamicPartitionControlInterface {
// This is needed before calling MapPartitionOnDeviceMapper(), otherwise the
// device would be mapped in an inconsistent way.
// If |update| is set, create snapshots and writes super partition metadata.
+ // If |required_size| is not null and call fails due to insufficient space,
+ // |required_size| will be set to total free space required on userdata
+ // partition to apply the update. Otherwise (call succeeds, or fails
+ // due to other errors), |required_size| is set to zero.
virtual bool PreparePartitionsForUpdate(uint32_t source_slot,
uint32_t target_slot,
const DeltaArchiveManifest& manifest,
- bool update) = 0;
+ bool update,
+ uint64_t* required_size) = 0;
// After writing to new partitions, before rebooting into the new slot, call
// this function to indicate writes to new partitions are done.