blob: 6eaa35b2023352c5ba099c4e25099d8f1cde981c [file] [log] [blame]
Yifan Hongdad0af82020-02-19 17:19:49 -08001//
2// Copyright (C) 2020 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
Amin Hassaniec7bc112020-10-29 16:47:58 -070016#include "update_engine/aosp/cleanup_previous_update_action.h"
Yifan Hongdad0af82020-02-19 17:19:49 -080017
Yifan Hongd976cc52020-02-25 14:51:42 -080018#include <chrono> // NOLINT(build/c++11) -- for merge times
Yifan Hongdad0af82020-02-19 17:19:49 -080019#include <functional>
20#include <string>
Yifan Hong24031712020-03-19 19:25:38 -070021#include <type_traits>
Yifan Hongdad0af82020-02-19 17:19:49 -080022
23#include <android-base/properties.h>
24#include <base/bind.h>
25
Yifan Hongd976cc52020-02-25 14:51:42 -080026#ifndef __ANDROID_RECOVERY__
27#include <statslog.h>
28#endif
29
Yifan Hongdad0af82020-02-19 17:19:49 -080030#include "update_engine/common/utils.h"
31#include "update_engine/payload_consumer/delta_performer.h"
32
Howard Chen224aed92020-04-17 11:22:13 +080033using android::base::GetBoolProperty;
Yifan Hongf9cb4492020-04-15 13:00:20 -070034using android::snapshot::ISnapshotManager;
Yifan Hongd976cc52020-02-25 14:51:42 -080035using android::snapshot::SnapshotMergeStats;
Yifan Hongdad0af82020-02-19 17:19:49 -080036using android::snapshot::UpdateState;
37using brillo::MessageLoop;
38
39constexpr char kBootCompletedProp[] = "sys.boot_completed";
40// Interval to check sys.boot_completed.
41constexpr auto kCheckBootCompletedInterval = base::TimeDelta::FromSeconds(2);
42// Interval to check IBootControl::isSlotMarkedSuccessful
43constexpr auto kCheckSlotMarkedSuccessfulInterval =
44 base::TimeDelta::FromSeconds(2);
45// Interval to call SnapshotManager::ProcessUpdateState
46constexpr auto kWaitForMergeInterval = base::TimeDelta::FromSeconds(2);
47
Yifan Hong5cd63fa2020-03-16 12:31:16 -070048#ifdef __ANDROID_RECOVERY__
49static constexpr bool kIsRecovery = true;
50#else
51static constexpr bool kIsRecovery = false;
52#endif
53
Yifan Hongdad0af82020-02-19 17:19:49 -080054namespace chromeos_update_engine {
55
56CleanupPreviousUpdateAction::CleanupPreviousUpdateAction(
57 PrefsInterface* prefs,
58 BootControlInterface* boot_control,
Yifan Hongf9cb4492020-04-15 13:00:20 -070059 android::snapshot::ISnapshotManager* snapshot,
Yifan Hongdad0af82020-02-19 17:19:49 -080060 CleanupPreviousUpdateActionDelegateInterface* delegate)
61 : prefs_(prefs),
62 boot_control_(boot_control),
63 snapshot_(snapshot),
64 delegate_(delegate),
65 running_(false),
66 cancel_failed_(false),
Yifan Hongd976cc52020-02-25 14:51:42 -080067 last_percentage_(0),
Yifan Hongf9cb4492020-04-15 13:00:20 -070068 merge_stats_(nullptr) {}
Yifan Hongdad0af82020-02-19 17:19:49 -080069
Yifan Hongd1d52a02020-09-25 15:09:07 -070070CleanupPreviousUpdateAction::~CleanupPreviousUpdateAction() {
71 StopActionInternal();
72}
73
Yifan Hongdad0af82020-02-19 17:19:49 -080074void CleanupPreviousUpdateAction::PerformAction() {
Yifan Hongd506dee2020-09-25 15:08:19 -070075 StartActionInternal();
Yifan Hongdad0af82020-02-19 17:19:49 -080076}
77
78void CleanupPreviousUpdateAction::TerminateProcessing() {
Yifan Hongd506dee2020-09-25 15:08:19 -070079 StopActionInternal();
Yifan Hongdad0af82020-02-19 17:19:49 -080080}
81
82void CleanupPreviousUpdateAction::ResumeAction() {
Yifan Hongdad0af82020-02-19 17:19:49 -080083 StartActionInternal();
84}
85
86void CleanupPreviousUpdateAction::SuspendAction() {
Yifan Hongd506dee2020-09-25 15:08:19 -070087 StopActionInternal();
Yifan Hongdad0af82020-02-19 17:19:49 -080088}
89
90void CleanupPreviousUpdateAction::ActionCompleted(ErrorCode error_code) {
Yifan Hongd506dee2020-09-25 15:08:19 -070091 StopActionInternal();
Yifan Hongd976cc52020-02-25 14:51:42 -080092 ReportMergeStats();
Yifan Hong5cd63fa2020-03-16 12:31:16 -070093 metadata_device_ = nullptr;
Yifan Hongdad0af82020-02-19 17:19:49 -080094}
95
96std::string CleanupPreviousUpdateAction::Type() const {
97 return StaticType();
98}
99
100std::string CleanupPreviousUpdateAction::StaticType() {
101 return "CleanupPreviousUpdateAction";
102}
103
Yifan Hongd1d52a02020-09-25 15:09:07 -0700104// This function is called at the beginning of all delayed functions. By
105// resetting |scheduled_task_|, the delayed function acknowledges that the task
106// has already been executed, therefore there's no need to cancel it in the
107// future. This avoids StopActionInternal() from resetting task IDs in an
108// unexpected way because task IDs could be reused.
109void CleanupPreviousUpdateAction::AcknowledgeTaskExecuted() {
110 if (scheduled_task_ != MessageLoop::kTaskIdNull) {
111 LOG(INFO) << "Executing task " << scheduled_task_;
112 }
113 scheduled_task_ = MessageLoop::kTaskIdNull;
114}
115
116// Check that scheduled_task_ is a valid task ID. Otherwise, terminate the
117// action.
118void CleanupPreviousUpdateAction::CheckTaskScheduled(std::string_view name) {
119 if (scheduled_task_ == MessageLoop::kTaskIdNull) {
120 LOG(ERROR) << "Unable to schedule " << name;
121 processor_->ActionComplete(this, ErrorCode::kError);
122 } else {
123 LOG(INFO) << "CleanupPreviousUpdateAction scheduled task ID "
124 << scheduled_task_ << " for " << name;
125 }
126}
127
Yifan Hongd506dee2020-09-25 15:08:19 -0700128void CleanupPreviousUpdateAction::StopActionInternal() {
129 LOG(INFO) << "Stopping/suspending/completing CleanupPreviousUpdateAction";
130 running_ = false;
Yifan Hongd1d52a02020-09-25 15:09:07 -0700131
132 if (scheduled_task_ != MessageLoop::kTaskIdNull) {
133 if (MessageLoop::current()->CancelTask(scheduled_task_)) {
134 LOG(INFO) << "CleanupPreviousUpdateAction cancelled pending task ID "
135 << scheduled_task_;
136 } else {
137 LOG(ERROR) << "CleanupPreviousUpdateAction unable to cancel task ID "
138 << scheduled_task_;
139 }
140 }
141 scheduled_task_ = MessageLoop::kTaskIdNull;
Yifan Hongd506dee2020-09-25 15:08:19 -0700142}
143
Yifan Hongdad0af82020-02-19 17:19:49 -0800144void CleanupPreviousUpdateAction::StartActionInternal() {
Yifan Hongd506dee2020-09-25 15:08:19 -0700145 CHECK(prefs_);
146 CHECK(boot_control_);
147
148 LOG(INFO) << "Starting/resuming CleanupPreviousUpdateAction";
149 running_ = true;
Yifan Hongdad0af82020-02-19 17:19:49 -0800150 // Do nothing on non-VAB device.
151 if (!boot_control_->GetDynamicPartitionControl()
152 ->GetVirtualAbFeatureFlag()
153 .IsEnabled()) {
154 processor_->ActionComplete(this, ErrorCode::kSuccess);
155 return;
156 }
Yifan Hongf9cb4492020-04-15 13:00:20 -0700157 // SnapshotManager must be available on VAB devices.
158 CHECK(snapshot_ != nullptr);
159 merge_stats_ = snapshot_->GetSnapshotMergeStatsInstance();
160 CHECK(merge_stats_ != nullptr);
Yifan Hongdad0af82020-02-19 17:19:49 -0800161 WaitBootCompletedOrSchedule();
162}
163
164void CleanupPreviousUpdateAction::ScheduleWaitBootCompleted() {
165 TEST_AND_RETURN(running_);
Yifan Hongd1d52a02020-09-25 15:09:07 -0700166 scheduled_task_ = MessageLoop::current()->PostDelayedTask(
Yifan Hongdad0af82020-02-19 17:19:49 -0800167 FROM_HERE,
168 base::Bind(&CleanupPreviousUpdateAction::WaitBootCompletedOrSchedule,
169 base::Unretained(this)),
170 kCheckBootCompletedInterval);
Yifan Hongd1d52a02020-09-25 15:09:07 -0700171 CheckTaskScheduled("WaitBootCompleted");
Yifan Hongdad0af82020-02-19 17:19:49 -0800172}
173
174void CleanupPreviousUpdateAction::WaitBootCompletedOrSchedule() {
Yifan Hongd1d52a02020-09-25 15:09:07 -0700175 AcknowledgeTaskExecuted();
Yifan Hongdad0af82020-02-19 17:19:49 -0800176 TEST_AND_RETURN(running_);
Yifan Hong5cd63fa2020-03-16 12:31:16 -0700177 if (!kIsRecovery &&
178 !android::base::GetBoolProperty(kBootCompletedProp, false)) {
Yifan Hongdad0af82020-02-19 17:19:49 -0800179 // repeat
180 ScheduleWaitBootCompleted();
181 return;
182 }
183
184 LOG(INFO) << "Boot completed, waiting on markBootSuccessful()";
185 CheckSlotMarkedSuccessfulOrSchedule();
186}
187
188void CleanupPreviousUpdateAction::ScheduleWaitMarkBootSuccessful() {
189 TEST_AND_RETURN(running_);
Yifan Hongd1d52a02020-09-25 15:09:07 -0700190 scheduled_task_ = MessageLoop::current()->PostDelayedTask(
Yifan Hongdad0af82020-02-19 17:19:49 -0800191 FROM_HERE,
192 base::Bind(
193 &CleanupPreviousUpdateAction::CheckSlotMarkedSuccessfulOrSchedule,
194 base::Unretained(this)),
195 kCheckSlotMarkedSuccessfulInterval);
Yifan Hongd1d52a02020-09-25 15:09:07 -0700196 CheckTaskScheduled("WaitMarkBootSuccessful");
Yifan Hongdad0af82020-02-19 17:19:49 -0800197}
198
199void CleanupPreviousUpdateAction::CheckSlotMarkedSuccessfulOrSchedule() {
Yifan Hongd1d52a02020-09-25 15:09:07 -0700200 AcknowledgeTaskExecuted();
Yifan Hongdad0af82020-02-19 17:19:49 -0800201 TEST_AND_RETURN(running_);
Yifan Hong5cd63fa2020-03-16 12:31:16 -0700202 if (!kIsRecovery &&
203 !boot_control_->IsSlotMarkedSuccessful(boot_control_->GetCurrentSlot())) {
Yifan Hongdad0af82020-02-19 17:19:49 -0800204 ScheduleWaitMarkBootSuccessful();
205 }
Yifan Hong5cd63fa2020-03-16 12:31:16 -0700206
207 if (metadata_device_ == nullptr) {
208 metadata_device_ = snapshot_->EnsureMetadataMounted();
209 }
210
211 if (metadata_device_ == nullptr) {
212 LOG(ERROR) << "Failed to mount /metadata.";
Yifan Hong4d7c5eb2020-04-03 11:31:50 -0700213 // If metadata is erased but not formatted, it is possible to not mount
214 // it in recovery. It is safe to skip CleanupPreviousUpdateAction.
215 processor_->ActionComplete(
216 this, kIsRecovery ? ErrorCode::kSuccess : ErrorCode::kError);
Yifan Hong5cd63fa2020-03-16 12:31:16 -0700217 return;
218 }
219
Yifan Hong24031712020-03-19 19:25:38 -0700220 if (kIsRecovery) {
221 auto snapshots_created =
222 snapshot_->RecoveryCreateSnapshotDevices(metadata_device_);
223 switch (snapshots_created) {
224 case android::snapshot::CreateResult::CREATED: {
225 // If previous update has not finished merging, snapshots exists and are
226 // created here so that ProcessUpdateState can proceed.
227 LOG(INFO) << "Snapshot devices are created";
228 break;
229 }
230 case android::snapshot::CreateResult::NOT_CREATED: {
231 // If there is no previous update, no snapshot devices are created and
232 // ProcessUpdateState will return immediately. Hence, NOT_CREATED is not
233 // considered an error.
234 LOG(INFO) << "Snapshot devices are not created";
235 break;
236 }
237 case android::snapshot::CreateResult::ERROR:
238 default: {
239 LOG(ERROR)
240 << "Failed to create snapshot devices (CreateResult = "
241 << static_cast<
242 std::underlying_type_t<android::snapshot::CreateResult>>(
243 snapshots_created);
244 processor_->ActionComplete(this, ErrorCode::kError);
245 return;
246 }
247 }
248 }
249
Yifan Hongd976cc52020-02-25 14:51:42 -0800250 if (!merge_stats_->Start()) {
251 // Not an error because CleanupPreviousUpdateAction may be paused and
252 // resumed while kernel continues merging snapshots in the background.
253 LOG(WARNING) << "SnapshotMergeStats::Start failed.";
254 }
Yifan Hongdad0af82020-02-19 17:19:49 -0800255 LOG(INFO) << "Waiting for any previous merge request to complete. "
256 << "This can take up to several minutes.";
257 WaitForMergeOrSchedule();
258}
259
260void CleanupPreviousUpdateAction::ScheduleWaitForMerge() {
261 TEST_AND_RETURN(running_);
Yifan Hongd1d52a02020-09-25 15:09:07 -0700262 scheduled_task_ = MessageLoop::current()->PostDelayedTask(
Yifan Hongdad0af82020-02-19 17:19:49 -0800263 FROM_HERE,
264 base::Bind(&CleanupPreviousUpdateAction::WaitForMergeOrSchedule,
265 base::Unretained(this)),
266 kWaitForMergeInterval);
Yifan Hongd1d52a02020-09-25 15:09:07 -0700267 CheckTaskScheduled("WaitForMerge");
Yifan Hongdad0af82020-02-19 17:19:49 -0800268}
269
270void CleanupPreviousUpdateAction::WaitForMergeOrSchedule() {
Yifan Hongd1d52a02020-09-25 15:09:07 -0700271 AcknowledgeTaskExecuted();
Yifan Hongdad0af82020-02-19 17:19:49 -0800272 TEST_AND_RETURN(running_);
David Anderson9661fb32021-02-04 17:58:51 -0800273 auto update_uses_compression = snapshot_->UpdateUsesCompression();
Yifan Hongdad0af82020-02-19 17:19:49 -0800274 auto state = snapshot_->ProcessUpdateState(
275 std::bind(&CleanupPreviousUpdateAction::OnMergePercentageUpdate, this),
276 std::bind(&CleanupPreviousUpdateAction::BeforeCancel, this));
David Anderson9661fb32021-02-04 17:58:51 -0800277 merge_stats_->set_state(state, update_uses_compression);
Yifan Hongdad0af82020-02-19 17:19:49 -0800278
Yifan Hongdad0af82020-02-19 17:19:49 -0800279 switch (state) {
280 case UpdateState::None: {
281 LOG(INFO) << "Can't find any snapshot to merge.";
Yifan Hong16b594a2020-03-05 21:02:36 -0800282 ErrorCode error_code = ErrorCode::kSuccess;
283 if (!snapshot_->CancelUpdate()) {
284 error_code = ErrorCode::kError;
285 LOG(INFO) << "Failed to call SnapshotManager::CancelUpdate().";
286 }
287 processor_->ActionComplete(this, error_code);
Yifan Hongdad0af82020-02-19 17:19:49 -0800288 return;
289 }
290
291 case UpdateState::Initiated: {
292 LOG(ERROR) << "Previous update has not been completed, not cleaning up";
293 processor_->ActionComplete(this, ErrorCode::kSuccess);
294 return;
295 }
296
297 case UpdateState::Unverified: {
298 InitiateMergeAndWait();
299 return;
300 }
301
302 case UpdateState::Merging: {
303 ScheduleWaitForMerge();
304 return;
305 }
306
307 case UpdateState::MergeNeedsReboot: {
308 LOG(ERROR) << "Need reboot to finish merging.";
309 processor_->ActionComplete(this, ErrorCode::kError);
310 return;
311 }
312
313 case UpdateState::MergeCompleted: {
314 LOG(INFO) << "Merge finished with state MergeCompleted.";
315 processor_->ActionComplete(this, ErrorCode::kSuccess);
316 return;
317 }
318
319 case UpdateState::MergeFailed: {
320 LOG(ERROR) << "Merge failed. Device may be corrupted.";
321 processor_->ActionComplete(this, ErrorCode::kDeviceCorrupted);
322 return;
323 }
324
325 case UpdateState::Cancelled: {
326 // DeltaPerformer::ResetUpdateProgress failed, hence snapshots are
327 // not deleted to avoid inconsistency.
328 // Nothing can be done here; just try next time.
329 ErrorCode error_code =
330 cancel_failed_ ? ErrorCode::kError : ErrorCode::kSuccess;
331 processor_->ActionComplete(this, error_code);
332 return;
333 }
334
335 default: {
336 // Protobuf has some reserved enum values, so a default case is needed.
337 LOG(FATAL) << "SnapshotManager::ProcessUpdateState returns "
338 << static_cast<int32_t>(state);
339 }
340 }
341}
342
343bool CleanupPreviousUpdateAction::OnMergePercentageUpdate() {
344 double percentage = 0.0;
345 snapshot_->GetUpdateState(&percentage);
346 if (delegate_) {
347 // libsnapshot uses [0, 100] percentage but update_engine uses [0, 1].
348 delegate_->OnCleanupProgressUpdate(percentage / 100);
349 }
350
351 // Log if percentage increments by at least 1.
352 if (last_percentage_ < static_cast<unsigned int>(percentage)) {
353 last_percentage_ = percentage;
354 LOG(INFO) << "Waiting for merge to complete: " << last_percentage_ << "%.";
355 }
356
357 // Do not continue to wait for merge. Instead, let ProcessUpdateState
358 // return Merging directly so that we can ScheduleWaitForMerge() in
359 // MessageLoop.
360 return false;
361}
362
363bool CleanupPreviousUpdateAction::BeforeCancel() {
364 if (DeltaPerformer::ResetUpdateProgress(
365 prefs_,
366 false /* quick */,
367 false /* skip dynamic partitions metadata*/)) {
368 return true;
369 }
370
371 // ResetUpdateProgress might not work on stub prefs. Do additional checks.
372 LOG(WARNING) << "ProcessUpdateState returns Cancelled but cleanup failed.";
373
374 std::string val;
375 ignore_result(prefs_->GetString(kPrefsDynamicPartitionMetadataUpdated, &val));
376 if (val.empty()) {
377 LOG(INFO) << kPrefsDynamicPartitionMetadataUpdated
378 << " is empty, assuming successful cleanup";
379 return true;
380 }
381 LOG(WARNING)
382 << kPrefsDynamicPartitionMetadataUpdated << " is " << val
383 << ", not deleting snapshots even though UpdateState is Cancelled.";
384 cancel_failed_ = true;
385 return false;
386}
387
388void CleanupPreviousUpdateAction::InitiateMergeAndWait() {
389 TEST_AND_RETURN(running_);
390 LOG(INFO) << "Attempting to initiate merge.";
Howard Chen224aed92020-04-17 11:22:13 +0800391 // suspend the VAB merge when running a DSU
392 if (GetBoolProperty("ro.gsid.image_running", false)) {
393 LOG(WARNING) << "Suspend the VAB merge when running a DSU.";
394 processor_->ActionComplete(this, ErrorCode::kError);
395 return;
396 }
Yifan Hongdad0af82020-02-19 17:19:49 -0800397
David Anderson8bda8212021-03-03 18:33:38 -0800398 snapshot_->UpdateCowStats(merge_stats_);
399
400 if (snapshot_->InitiateMerge()) {
Yifan Hongdad0af82020-02-19 17:19:49 -0800401 WaitForMergeOrSchedule();
402 return;
403 }
404
405 LOG(WARNING) << "InitiateMerge failed.";
406 auto state = snapshot_->GetUpdateState();
David Anderson9661fb32021-02-04 17:58:51 -0800407 merge_stats_->set_state(state, snapshot_->UpdateUsesCompression());
Yifan Hongdad0af82020-02-19 17:19:49 -0800408 if (state == UpdateState::Unverified) {
409 // We are stuck at unverified state. This can happen if the update has
410 // been applied, but it has not even been attempted yet (in libsnapshot,
411 // rollback indicator does not exist); for example, if update_engine
412 // restarts before the device reboots, then this state may be reached.
413 // Nothing should be done here.
414 LOG(WARNING) << "InitiateMerge leaves the device at "
415 << "UpdateState::Unverified. (Did update_engine "
416 << "restarted?)";
417 processor_->ActionComplete(this, ErrorCode::kSuccess);
418 return;
419 }
420
421 // State does seems to be advanced.
422 // It is possibly racy. For example, on a userdebug build, the user may
423 // manually initiate a merge with snapshotctl between last time
424 // update_engine checks UpdateState. Hence, just call
425 // WaitForMergeOrSchedule one more time.
426 LOG(WARNING) << "IniitateMerge failed but GetUpdateState returned "
427 << android::snapshot::UpdateState_Name(state)
428 << ", try to wait for merge again.";
429 WaitForMergeOrSchedule();
430 return;
431}
432
Yifan Hongd976cc52020-02-25 14:51:42 -0800433void CleanupPreviousUpdateAction::ReportMergeStats() {
434 auto result = merge_stats_->Finish();
435 if (result == nullptr) {
436 LOG(WARNING) << "Not reporting merge stats because "
437 "SnapshotMergeStats::Finish failed.";
438 return;
439 }
440
441#ifdef __ANDROID_RECOVERY__
442 LOG(INFO) << "Skip reporting merge stats in recovery.";
443#else
444 const auto& report = result->report();
445
446 if (report.state() == UpdateState::None ||
447 report.state() == UpdateState::Initiated ||
448 report.state() == UpdateState::Unverified) {
449 LOG(INFO) << "Not reporting merge stats because state is "
450 << android::snapshot::UpdateState_Name(report.state());
451 return;
452 }
453
454 auto passed_ms = std::chrono::duration_cast<std::chrono::milliseconds>(
455 result->merge_time());
Alessio Balsini4ed05122020-05-26 22:17:03 +0100456
457 bool vab_retrofit = boot_control_->GetDynamicPartitionControl()
458 ->GetVirtualAbFeatureFlag()
459 .IsRetrofit();
Yifan Hongbab11c52021-02-03 15:05:05 -0800460 bool vab_compression_enabled = boot_control_->GetDynamicPartitionControl()
461 ->GetVirtualAbCompressionFeatureFlag()
462 .IsEnabled();
463 // The snapshot has been merged, so we can no longer call
464 // DynamicPartitionControlInterface::UpdateUsesSnapshotCompression.
465 // However, we have saved the flag in the snapshot report.
466 bool vab_compression_used = report.compression_enabled();
Alessio Balsini4ed05122020-05-26 22:17:03 +0100467
Yifan Hongd976cc52020-02-25 14:51:42 -0800468 LOG(INFO) << "Reporting merge stats: "
469 << android::snapshot::UpdateState_Name(report.state()) << " in "
470 << passed_ms.count() << "ms (resumed " << report.resume_count()
Alessio Balsini4ed05122020-05-26 22:17:03 +0100471 << " times), using " << report.cow_file_size()
472 << " bytes of COW image.";
Yifan Hongbe59a002020-03-02 15:45:14 -0800473 android::util::stats_write(android::util::SNAPSHOT_MERGE_REPORTED,
474 static_cast<int32_t>(report.state()),
475 static_cast<int64_t>(passed_ms.count()),
Alessio Balsini4ed05122020-05-26 22:17:03 +0100476 static_cast<int32_t>(report.resume_count()),
477 vab_retrofit,
Yifan Hongbab11c52021-02-03 15:05:05 -0800478 static_cast<int64_t>(report.cow_file_size()),
479 vab_compression_enabled,
480 vab_compression_used);
Yifan Hongd976cc52020-02-25 14:51:42 -0800481#endif
482}
483
Yifan Hongdad0af82020-02-19 17:19:49 -0800484} // namespace chromeos_update_engine