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
Loading
Please register or sign in to comment