Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e69b2d42 authored by Akilesh Kailash's avatar Akilesh Kailash
Browse files

snapshotctl: Initialize snapshot pointer when reverting snapshots



Test: snapshotctl revert-snapshots
Bug: 368487904
Change-Id: I9743bf412d4bfcf508aeb046ec329568da4e2be1
Signed-off-by: default avatarAkilesh Kailash <akailash@google.com>
parent 5684f3e0
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -105,7 +105,7 @@ class MapSnapshots {
    bool FinishSnapshotWrites();
    bool UnmapCowImagePath(std::string& name);
    bool DeleteSnapshots();
    bool CleanupSnapshot() { return sm_->PrepareDeviceToBootWithoutSnapshot(); }
    bool CleanupSnapshot();
    bool BeginUpdate();
    bool ApplyUpdate();

@@ -495,6 +495,11 @@ bool MapSnapshots::UnmapCowImagePath(std::string& name) {
    return sm_->UnmapCowImage(name);
}

bool MapSnapshots::CleanupSnapshot() {
    sm_ = SnapshotManager::New();
    return sm_->PrepareDeviceToBootWithoutSnapshot();
}

bool MapSnapshots::DeleteSnapshots() {
    sm_ = SnapshotManager::New();
    lock_ = sm_->LockExclusive();