diff options
Diffstat (limited to 'partition_installer.h')
-rw-r--r-- | partition_installer.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/partition_installer.h b/partition_installer.h index 1503648..920af47 100644 --- a/partition_installer.h +++ b/partition_installer.h @@ -53,14 +53,17 @@ class PartitionInstaller final { static int WipeWritable(const std::string& active_dsu, const std::string& install_dir, const std::string& name); - // Clean up install state if gsid crashed and restarted. - void PostInstallCleanup(); - void PostInstallCleanup(ImageManager* manager); + // Finish a partition installation and release resources. + // If the installation is incomplete or corrupted, the backing image would + // be cleaned up and an error code is returned. + // No method other than FinishInstall() and ~PartitionInstaller() should be + // called after calling this method. + // This method is also called by the destructor to free up resources. + int FinishInstall(); const std::string& install_dir() const { return install_dir_; } private: - int Finish(); int PerformSanityChecks(); int Preallocate(); bool Format(); @@ -82,10 +85,12 @@ class PartitionInstaller final { bool readOnly_; // Remaining data we're waiting to receive for the GSI image. uint64_t gsi_bytes_written_ = 0; - bool succeeded_ = false; uint64_t ashmem_size_ = -1; void* ashmem_data_ = MAP_FAILED; + bool finished_ = false; + int finished_status_ = 0; + std::unique_ptr<MappedDevice> system_device_; }; |