Add VerifyMergeOps() to CowReader interface

update_engine only sees ICowReader, so in order for update_engine to
consume this API, it has to be in the base interface class.

Test: th
Change-Id: I9100b6aa1db6eb6a884752620098172bdd51f200
This commit is contained in:
Kelvin Zhang 2021-09-27 18:26:23 -07:00
parent be17619ccc
commit f2e1f20fd7

View file

@ -68,6 +68,7 @@ class ICowReader {
// Return the file footer.
virtual bool GetFooter(CowFooter* footer) = 0;
virtual bool VerifyMergeOps() = 0;
// Return the last valid label
virtual bool GetLastLabel(uint64_t* label) = 0;
@ -101,7 +102,7 @@ class ICowOpIter {
virtual void Next() = 0;
};
class CowReader : public ICowReader {
class CowReader final : public ICowReader {
public:
CowReader();
~CowReader() { owned_fd_ = {}; }
@ -112,7 +113,7 @@ class CowReader : public ICowReader {
bool Parse(android::base::borrowed_fd fd, std::optional<uint64_t> label = {});
bool InitForMerge(android::base::unique_fd&& fd);
bool VerifyMergeOps();
bool VerifyMergeOps() override;
bool GetHeader(CowHeader* header) override;
bool GetFooter(CowFooter* footer) override;