Loading fs_mgr/libsnapshot/include/libsnapshot/mock_snapshot.h +2 −4 Original line number Diff line number Diff line Loading @@ -39,11 +39,9 @@ class MockSnapshotManager : public ISnapshotManager { std::string* snapshot_path), (override)); MOCK_METHOD(std::unique_ptr<ICowWriter>, OpenSnapshotWriter, (const std::string& partition_name, std::chrono::milliseconds timeout_ms), (override)); (const android::fs_mgr::CreateLogicalPartitionParams& params), (override)); MOCK_METHOD(std::unique_ptr<FileDescriptor>, OpenSnapshotReader, (const std::string& partition_name, std::chrono::milliseconds timeout_ms), (override)); (const android::fs_mgr::CreateLogicalPartitionParams& params), (override)); MOCK_METHOD(bool, UnmapUpdateSnapshot, (const std::string& target_partition_name), (override)); MOCK_METHOD(bool, NeedSnapshotsInFirstStageMount, (), (override)); MOCK_METHOD(bool, CreateLogicalAndSnapshotPartitions, Loading fs_mgr/libsnapshot/include/libsnapshot/snapshot.h +7 −6 Original line number Diff line number Diff line Loading @@ -187,14 +187,15 @@ class ISnapshotManager { virtual bool MapUpdateSnapshot(const android::fs_mgr::CreateLogicalPartitionParams& params, std::string* snapshot_path) = 0; // Create an ICowWriter to build a snapshot against a target partition. // Create an ICowWriter to build a snapshot against a target partition. The partition name must // be suffixed. virtual std::unique_ptr<ICowWriter> OpenSnapshotWriter( const std::string& partition_name, std::chrono::milliseconds timeout_ms = {}) = 0; const android::fs_mgr::CreateLogicalPartitionParams& params) = 0; // Open a snapshot for reading. A file-like interface is provided through the FileDescriptor. // In this mode, writes are not supported. // In this mode, writes are not supported. The partition name must be suffixed. virtual std::unique_ptr<FileDescriptor> OpenSnapshotReader( const std::string& partition_name, std::chrono::milliseconds timeout_ms = {}) = 0; const android::fs_mgr::CreateLogicalPartitionParams& params) = 0; // Unmap a snapshot device or CowWriter that was previously opened with MapUpdateSnapshot, // OpenSnapshotWriter, or OpenSnapshotReader. All outstanding open descriptors, writers, Loading Loading @@ -310,9 +311,9 @@ class SnapshotManager final : public ISnapshotManager { bool MapUpdateSnapshot(const CreateLogicalPartitionParams& params, std::string* snapshot_path) override; std::unique_ptr<ICowWriter> OpenSnapshotWriter( const std::string& partition_name, std::chrono::milliseconds timeout_ms = {}) override; const android::fs_mgr::CreateLogicalPartitionParams& params) override; std::unique_ptr<FileDescriptor> OpenSnapshotReader( const std::string& partition_name, std::chrono::milliseconds timeout_ms = {}) override; const android::fs_mgr::CreateLogicalPartitionParams& params) override; bool UnmapUpdateSnapshot(const std::string& target_partition_name) override; bool NeedSnapshotsInFirstStageMount() override; bool CreateLogicalAndSnapshotPartitions( Loading fs_mgr/libsnapshot/include/libsnapshot/snapshot_stub.h +3 −3 Original line number Diff line number Diff line Loading @@ -36,10 +36,10 @@ class SnapshotManagerStub : public ISnapshotManager { const chromeos_update_engine::DeltaArchiveManifest& manifest) override; bool MapUpdateSnapshot(const android::fs_mgr::CreateLogicalPartitionParams& params, std::string* snapshot_path) override; std::unique_ptr<ICowWriter> OpenSnapshotWriter(const std::string& partition_name, std::chrono::milliseconds timeout_ms) override; std::unique_ptr<ICowWriter> OpenSnapshotWriter( const android::fs_mgr::CreateLogicalPartitionParams& params) override; std::unique_ptr<FileDescriptor> OpenSnapshotReader( const std::string& partition_name, std::chrono::milliseconds timeout_ms = {}) override; const android::fs_mgr::CreateLogicalPartitionParams& params) override; bool UnmapUpdateSnapshot(const std::string& target_partition_name) override; bool NeedSnapshotsInFirstStageMount() override; bool CreateLogicalAndSnapshotPartitions( Loading fs_mgr/libsnapshot/snapshot.cpp +6 −13 Original line number Diff line number Diff line Loading @@ -2442,25 +2442,18 @@ bool SnapshotManager::MapUpdateSnapshot(const CreateLogicalPartitionParams& para } std::unique_ptr<ICowWriter> SnapshotManager::OpenSnapshotWriter( const std::string& partition_name, std::chrono::milliseconds timeout_ms) { if (!IsCompressionEnabled()) { LOG(ERROR) << "OpenSnapshotWriter can only be called in compression mode."; return nullptr; } (void)partition_name; (void)timeout_ms; const android::fs_mgr::CreateLogicalPartitionParams& params) { (void)params; // Not yet implemented. LOG(ERROR) << "OpenSnapshotWriter not yet implemented"; return nullptr; } std::unique_ptr<FileDescriptor> SnapshotManager::OpenSnapshotReader( const std::string& partition_name, std::chrono::milliseconds timeout_ms) { (void)partition_name; (void)timeout_ms; const android::fs_mgr::CreateLogicalPartitionParams& params) { (void)params; // Not yet implemented. LOG(ERROR) << "OpenSnapshotReader not yet implemented"; return nullptr; } Loading fs_mgr/libsnapshot/snapshot_stub.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -130,14 +130,14 @@ ISnapshotMergeStats* SnapshotManagerStub::GetSnapshotMergeStatsInstance() { return &snapshot_merge_stats; } std::unique_ptr<ICowWriter> SnapshotManagerStub::OpenSnapshotWriter(const std::string&, std::chrono::milliseconds) { std::unique_ptr<ICowWriter> SnapshotManagerStub::OpenSnapshotWriter( const CreateLogicalPartitionParams&) { LOG(ERROR) << __FUNCTION__ << " should never be called."; return nullptr; } std::unique_ptr<FileDescriptor> SnapshotManagerStub::OpenSnapshotReader(const std::string&, std::chrono::milliseconds) { std::unique_ptr<FileDescriptor> SnapshotManagerStub::OpenSnapshotReader( const CreateLogicalPartitionParams&) { LOG(ERROR) << __FUNCTION__ << " should never be called."; return nullptr; } Loading Loading
fs_mgr/libsnapshot/include/libsnapshot/mock_snapshot.h +2 −4 Original line number Diff line number Diff line Loading @@ -39,11 +39,9 @@ class MockSnapshotManager : public ISnapshotManager { std::string* snapshot_path), (override)); MOCK_METHOD(std::unique_ptr<ICowWriter>, OpenSnapshotWriter, (const std::string& partition_name, std::chrono::milliseconds timeout_ms), (override)); (const android::fs_mgr::CreateLogicalPartitionParams& params), (override)); MOCK_METHOD(std::unique_ptr<FileDescriptor>, OpenSnapshotReader, (const std::string& partition_name, std::chrono::milliseconds timeout_ms), (override)); (const android::fs_mgr::CreateLogicalPartitionParams& params), (override)); MOCK_METHOD(bool, UnmapUpdateSnapshot, (const std::string& target_partition_name), (override)); MOCK_METHOD(bool, NeedSnapshotsInFirstStageMount, (), (override)); MOCK_METHOD(bool, CreateLogicalAndSnapshotPartitions, Loading
fs_mgr/libsnapshot/include/libsnapshot/snapshot.h +7 −6 Original line number Diff line number Diff line Loading @@ -187,14 +187,15 @@ class ISnapshotManager { virtual bool MapUpdateSnapshot(const android::fs_mgr::CreateLogicalPartitionParams& params, std::string* snapshot_path) = 0; // Create an ICowWriter to build a snapshot against a target partition. // Create an ICowWriter to build a snapshot against a target partition. The partition name must // be suffixed. virtual std::unique_ptr<ICowWriter> OpenSnapshotWriter( const std::string& partition_name, std::chrono::milliseconds timeout_ms = {}) = 0; const android::fs_mgr::CreateLogicalPartitionParams& params) = 0; // Open a snapshot for reading. A file-like interface is provided through the FileDescriptor. // In this mode, writes are not supported. // In this mode, writes are not supported. The partition name must be suffixed. virtual std::unique_ptr<FileDescriptor> OpenSnapshotReader( const std::string& partition_name, std::chrono::milliseconds timeout_ms = {}) = 0; const android::fs_mgr::CreateLogicalPartitionParams& params) = 0; // Unmap a snapshot device or CowWriter that was previously opened with MapUpdateSnapshot, // OpenSnapshotWriter, or OpenSnapshotReader. All outstanding open descriptors, writers, Loading Loading @@ -310,9 +311,9 @@ class SnapshotManager final : public ISnapshotManager { bool MapUpdateSnapshot(const CreateLogicalPartitionParams& params, std::string* snapshot_path) override; std::unique_ptr<ICowWriter> OpenSnapshotWriter( const std::string& partition_name, std::chrono::milliseconds timeout_ms = {}) override; const android::fs_mgr::CreateLogicalPartitionParams& params) override; std::unique_ptr<FileDescriptor> OpenSnapshotReader( const std::string& partition_name, std::chrono::milliseconds timeout_ms = {}) override; const android::fs_mgr::CreateLogicalPartitionParams& params) override; bool UnmapUpdateSnapshot(const std::string& target_partition_name) override; bool NeedSnapshotsInFirstStageMount() override; bool CreateLogicalAndSnapshotPartitions( Loading
fs_mgr/libsnapshot/include/libsnapshot/snapshot_stub.h +3 −3 Original line number Diff line number Diff line Loading @@ -36,10 +36,10 @@ class SnapshotManagerStub : public ISnapshotManager { const chromeos_update_engine::DeltaArchiveManifest& manifest) override; bool MapUpdateSnapshot(const android::fs_mgr::CreateLogicalPartitionParams& params, std::string* snapshot_path) override; std::unique_ptr<ICowWriter> OpenSnapshotWriter(const std::string& partition_name, std::chrono::milliseconds timeout_ms) override; std::unique_ptr<ICowWriter> OpenSnapshotWriter( const android::fs_mgr::CreateLogicalPartitionParams& params) override; std::unique_ptr<FileDescriptor> OpenSnapshotReader( const std::string& partition_name, std::chrono::milliseconds timeout_ms = {}) override; const android::fs_mgr::CreateLogicalPartitionParams& params) override; bool UnmapUpdateSnapshot(const std::string& target_partition_name) override; bool NeedSnapshotsInFirstStageMount() override; bool CreateLogicalAndSnapshotPartitions( Loading
fs_mgr/libsnapshot/snapshot.cpp +6 −13 Original line number Diff line number Diff line Loading @@ -2442,25 +2442,18 @@ bool SnapshotManager::MapUpdateSnapshot(const CreateLogicalPartitionParams& para } std::unique_ptr<ICowWriter> SnapshotManager::OpenSnapshotWriter( const std::string& partition_name, std::chrono::milliseconds timeout_ms) { if (!IsCompressionEnabled()) { LOG(ERROR) << "OpenSnapshotWriter can only be called in compression mode."; return nullptr; } (void)partition_name; (void)timeout_ms; const android::fs_mgr::CreateLogicalPartitionParams& params) { (void)params; // Not yet implemented. LOG(ERROR) << "OpenSnapshotWriter not yet implemented"; return nullptr; } std::unique_ptr<FileDescriptor> SnapshotManager::OpenSnapshotReader( const std::string& partition_name, std::chrono::milliseconds timeout_ms) { (void)partition_name; (void)timeout_ms; const android::fs_mgr::CreateLogicalPartitionParams& params) { (void)params; // Not yet implemented. LOG(ERROR) << "OpenSnapshotReader not yet implemented"; return nullptr; } Loading
fs_mgr/libsnapshot/snapshot_stub.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -130,14 +130,14 @@ ISnapshotMergeStats* SnapshotManagerStub::GetSnapshotMergeStatsInstance() { return &snapshot_merge_stats; } std::unique_ptr<ICowWriter> SnapshotManagerStub::OpenSnapshotWriter(const std::string&, std::chrono::milliseconds) { std::unique_ptr<ICowWriter> SnapshotManagerStub::OpenSnapshotWriter( const CreateLogicalPartitionParams&) { LOG(ERROR) << __FUNCTION__ << " should never be called."; return nullptr; } std::unique_ptr<FileDescriptor> SnapshotManagerStub::OpenSnapshotReader(const std::string&, std::chrono::milliseconds) { std::unique_ptr<FileDescriptor> SnapshotManagerStub::OpenSnapshotReader( const CreateLogicalPartitionParams&) { LOG(ERROR) << __FUNCTION__ << " should never be called."; return nullptr; } Loading