android_system_core/fs_mgr/libsnapshot
David Anderson aca0beaf77 libsnapshot: Partially implement OpenSnapshotWriter.
This is a re-landing of the original CL, with a few changes:
 - The correct device is now returned in MapUpdateSnapshot.
 - The old API is used for tests, and the new API is only tested when
   used on a VABC device.
 - A sync() call has been added to ensure that writes to the base and
   target snapshot devices have been fully flushed. This makes
   IsPartitionUnchanged detect the MapUpdateSnapshot bug.

Implement OpenSnapshotWriter for non-compressed Virtual A/B. This is
done by adding an OnlineKernelSnapshotWriter class, which forwards all
writes to a dm-snapshot block device.

This also introduces a new ISnapshotWriter class which extends
ICowWriter, and adds features specific to libsnapshot (versus ICowWriter
which is intended only for the new COW format). The OpenSnapshotReader
call has been moved here since the writer retains all the information
needed to create the reader.

To test the new call, vts_libsnapshot_test has been modified to use
OpenSnapshotWriter.

As part of this change, all consumers of libsnapshot must now link to
libsnapshot_cow.

Bug: 168554689
Test: vts_libsnapshot_test
Test: full OTA with update_device.py
Test: incremental OTA with update_device.py
Change-Id: I90364a58902a4406a37cb14a816642c57a72bec2
2020-10-14 21:41:36 -07:00
..
android/snapshot libsnapshot: proto use correct index 2020-05-29 16:21:40 -07:00
corpus libsnapshot_fuzzer: add initial corpus 2020-05-06 17:10:34 -07:00
include/libsnapshot libsnapshot: Partially implement OpenSnapshotWriter. 2020-10-14 21:41:36 -07:00
include_test/libsnapshot libsnapshot: Partially implement OpenSnapshotWriter. 2020-10-14 21:41:36 -07:00
update_engine Update libsnapshot to handle partial update 2020-06-09 12:53:45 -07:00
Android.bp libsnapshot: Partially implement OpenSnapshotWriter. 2020-10-14 21:41:36 -07:00
cow_api_test.cpp libsnapshot: Add an append mode to CowWriter. 2020-09-15 16:15:41 -07:00
cow_decompress.cpp libsnapshot: Add support for brotli compression. 2020-09-15 16:15:33 -07:00
cow_decompress.h libsnapshot: Add support for brotli compression. 2020-09-15 16:15:33 -07:00
cow_reader.cpp libsnapshot: Add an append mode to CowWriter. 2020-09-15 16:15:41 -07:00
cow_snapuserd_test.cpp libsnapshot:snapuserd: Transitions for snapuserd 2020-10-02 18:41:11 +00:00
cow_writer.cpp libsnapshot: Partially implement OpenSnapshotWriter. 2020-10-14 21:41:36 -07:00
device_info.cpp libsnapshot: Restrict when snapshots can be deleted. 2020-02-05 17:16:17 -08:00
device_info.h libsnapshot: Add a helper for handling data wipes in recovery. 2019-11-10 23:07:11 -08:00
dm_snapshot_internals.h pragma once for header file 2019-10-28 16:38:35 +00:00
estimate_cow_from_nonab_ota.cpp libsnapshot: Add an append mode to CowWriter. 2020-09-15 16:15:41 -07:00
fuzz.sh Rename native code coverage paths env. variable in libsnapshot's fuzz test. 2020-06-10 13:04:53 +01:00
fuzz_utils.cpp libsnapshot_fuzzer: use protobuf 2020-04-30 23:05:36 -07:00
fuzz_utils.h Reland "libsnapshot_fuzzer: Add tests" 2020-05-15 14:34:01 -07:00
make_cow_from_ab_ota.cpp libsnapshot: Add an append mode to CowWriter. 2020-09-15 16:15:41 -07:00
OWNERS Add balsini@ as libsnapshot owner 2020-01-09 10:11:45 +00:00
partition_cow_creator.cpp Handle zero snapshot size appropriately. 2020-05-01 18:46:44 +00:00
partition_cow_creator.h PartitionCowCreator accounts for extra extents 2019-12-02 12:49:38 -08:00
partition_cow_creator_test.cpp libsnapshot_test: skip global setup on non-VAB devices. 2020-08-06 17:21:50 -07:00
power_test.cpp libsnapshot: Add a simple script and gtest to simulate power failures during snapshot-merge. 2020-04-14 23:32:38 -07:00
PowerTest.md libsnapshot: Add a simple script and gtest to simulate power failures during snapshot-merge. 2020-04-14 23:32:38 -07:00
return.cpp libsnapshot: delete WaitForMerge. 2020-03-03 13:19:49 -08:00
run_power_test.sh libsnapshot: Add a simple script and gtest to simulate power failures during snapshot-merge. 2020-04-14 23:32:38 -07:00
snapshot.cpp libsnapshot: Partially implement OpenSnapshotWriter. 2020-10-14 21:41:36 -07:00
snapshot_fuzz.cpp Use more inclusive language for #inclusivefixit 2020-07-23 11:13:37 -07:00
snapshot_fuzz_utils.cpp libsnapshot_fuzzer: Properly unmap images 2020-05-15 17:05:26 -07:00
snapshot_fuzz_utils.h Use more inclusive language for #inclusivefixit 2020-07-23 11:13:37 -07:00
snapshot_metadata_updater.cpp Merge "libsnapshot: Properly set partial_update_" 2020-07-31 23:02:05 +00:00
snapshot_metadata_updater.h Update libsnapshot to handle partial update 2020-06-09 12:53:45 -07:00
snapshot_metadata_updater_test.cpp libsnapshot_test: skip global setup on non-VAB devices. 2020-08-06 17:21:50 -07:00
snapshot_stats.cpp libsnapshot: Export COW image size 2020-05-29 23:19:39 +00:00
snapshot_stub.cpp libsnapshot: Partially implement OpenSnapshotWriter. 2020-10-14 21:41:36 -07:00
snapshot_test.cpp libsnapshot: Partially implement OpenSnapshotWriter. 2020-10-14 21:41:36 -07:00
snapshot_writer.cpp libsnapshot: Partially implement OpenSnapshotWriter. 2020-10-14 21:41:36 -07:00
snapshotctl.cpp libsnapshot: delete InitiateMergeAndWait. 2020-03-09 16:14:30 -07:00
snapuserd.cpp libsnapshot:snapuserd: Handle signals 2020-10-07 21:45:45 +00:00
snapuserd_client.cpp libsnapshot:snapuserd: Handle signals 2020-10-07 21:45:45 +00:00
snapuserd_daemon.cpp libsnapshot:snapuserd: Handle signals 2020-10-07 21:45:45 +00:00
snapuserd_server.cpp libsnapshot:snapuserd: Handle signals 2020-10-07 21:45:45 +00:00
test_helpers.cpp libsnapshot: Partially implement OpenSnapshotWriter. 2020-10-14 21:41:36 -07:00
utility.cpp Add OptimizeSourceCopyOperation 2020-03-11 12:10:32 -07:00
utility.h Add OptimizeSourceCopyOperation 2020-03-11 12:10:32 -07:00