diff options
author | Kelvin Zhang <zhangkelvin@google.com> | 2020-09-28 09:21:02 -0400 |
---|---|---|
committer | Kelvin Zhang <zhangkelvin@google.com> | 2020-10-23 09:52:19 -0400 |
commit | 34618521d487a37d21f25812f324380f1eb394a8 (patch) | |
tree | 45107761577a19fda261d73a6dfc1bba30d2e48d /common/dynamic_partition_control_interface.h | |
parent | 19e55297ac3805c7109325ea7d536887e302403e (diff) |
Add CowWriter interface methods to DynamicPartiitonControl
Test: treehugger
Change-Id: I110c65e75a4594af51e68390e570ac31b50de8b5
Diffstat (limited to 'common/dynamic_partition_control_interface.h')
-rw-r--r-- | common/dynamic_partition_control_interface.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/common/dynamic_partition_control_interface.h b/common/dynamic_partition_control_interface.h index 22f6db87..530b0af4 100644 --- a/common/dynamic_partition_control_interface.h +++ b/common/dynamic_partition_control_interface.h @@ -26,8 +26,14 @@ #include "update_engine/common/action.h" #include "update_engine/common/cleanup_previous_update_action_delegate.h" #include "update_engine/common/error_code.h" +#include "update_engine/payload_consumer/file_descriptor.h" #include "update_engine/update_metadata.pb.h" +// Forware declare for libsnapshot/snapshot_writer.h +namespace android::snapshot { +class ISnapshotWriter; +} + namespace chromeos_update_engine { struct FeatureFlag { @@ -139,6 +145,15 @@ class DynamicPartitionControlInterface { uint32_t source_slot, uint32_t target_slot, const std::vector<std::string>& partitions) = 0; + // Partition name is expected to be unsuffixed. e.g. system, vendor + // Return an interface to write to a snapshoted partition. + // If `is_append` is false, then existing COW data will be overwritten. + // Otherwise the cow writer will be opened on APPEND mode, existing COW data + // is preserved. + virtual std::unique_ptr<android::snapshot::ISnapshotWriter> OpenCowWriter( + const std::string& unsuffixed_partition_name, + const std::optional<std::string>&, + bool is_append = false) = 0; }; } // namespace chromeos_update_engine |