diff options
author | Yifan Hong <elsk@google.com> | 2019-09-16 13:18:22 -0700 |
---|---|---|
committer | Yifan Hong <elsk@google.com> | 2019-09-23 19:38:27 -0700 |
commit | 13d41cb2accc1e2e1271b22a53f0dce6db0493f5 (patch) | |
tree | a3f1a02ee80743e96abdd8be437411402b02b16d /common/boot_control_interface.h | |
parent | 87ea73fe5a48c54ad56ba769375d180d1ce5c614 (diff) |
[REFACTOR] Pass DeltaArchiveManifest to DynamicPartitionControl
DynamicPartitionControl need the list of operations to calculate
COW sizes.
- Remove BootControlInterface::PartitionMetadata. Replace all references
with DeltaArchiveManifest. DeltaArchiveManifest has all information
that PartitionMetadata has.
- Rename all InitPartitionMetadata to PreparePartitionsForUpdate
- Change all PreparePartitionsForUpdate to use new signature
Bug: 138816109
Test: update_enigne_unittests --gtest_filter=*BootControl*:*Dynamic*
Change-Id: I4389ba2b1801addf8c3bc8395e2ea6a9a3ed27a0
Diffstat (limited to 'common/boot_control_interface.h')
-rw-r--r-- | common/boot_control_interface.h | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/common/boot_control_interface.h b/common/boot_control_interface.h index 392d7851..9bf639a6 100644 --- a/common/boot_control_interface.h +++ b/common/boot_control_interface.h @@ -25,6 +25,8 @@ #include <base/callback.h> #include <base/macros.h> +#include "update_engine/update_metadata.pb.h" + namespace chromeos_update_engine { // The abstract boot control interface defines the interaction with the @@ -35,19 +37,6 @@ class BootControlInterface { public: using Slot = unsigned int; - struct PartitionMetadata { - struct Partition { - std::string name; - uint64_t size; - }; - struct Group { - std::string name; - uint64_t size; - std::vector<Partition> partitions; - }; - std::vector<Group> groups; - }; - static const Slot kInvalidSlot = UINT_MAX; virtual ~BootControlInterface() = default; @@ -67,9 +56,9 @@ class BootControlInterface { // The |slot| number must be between 0 and GetNumSlots() - 1 and the // |partition_name| is a platform-specific name that identifies a partition on // every slot. In order to access the dynamic partitions in the target slot, - // InitPartitionMetadata() must be called (once per payload) prior to calling - // this function. On success, returns true and stores the block device in - // |device|. + // PreparePartitionsForUpdate() must be called (once per payload) prior to + // calling this function. On success, returns true and stores the block device + // in |device|. virtual bool GetPartitionDevice(const std::string& partition_name, Slot slot, std::string* device) const = 0; @@ -96,12 +85,11 @@ class BootControlInterface { // Initializes the metadata of the underlying partitions for a given |slot| // and sets up the states for accessing dynamic partitions. - // |partition_metadata| will be written to the specified |slot| if + // Metadata will be written to the specified |slot| if // |update_metadata| is set. - virtual bool InitPartitionMetadata( - Slot slot, - const PartitionMetadata& partition_metadata, - bool update_metadata) = 0; + virtual bool PreparePartitionsForUpdate(Slot slot, + const DeltaArchiveManifest& manifest, + bool update_metadata) = 0; // Do necessary clean-up operations after the whole update. virtual void Cleanup() = 0; |