libsnapshot: Get DaemonTransition test passing again.
This fixes a number of small bugs in libsnapshot. It also refactors the handler list a bit. Previously, it was a list of unique_ptrs. Now it is a list of shared_ptrs to simplify ownership. Additionally, Snapuserd is now keyed solely on the misc device name. This allows two identical snapshots to run in the same daemon, with different control names (a scenario that comes up in the DaemonTransition test). As part of this change, the two-stage initialization process has been refactored slightly. The "init" message sets all the device paths, and the "start" message needs only the misc name. Both the init and start messages now validate that no duplicate handlers exist, and that we're not overwriting any previous thread. This cleanup also fixes a bug in DmUserHandler cleanup - if a control device shut down raced with WaitForDelete(), the std::thread object would delete without a call to detach() or join(). In the new RemoveHandler(), we now correctly detach() in this scenario. This also fixes a bug where, if a COW had no partition component (it only resided on /data), the second-stage transition would fail because it used the wrong device-mapper name. Bug: N/A Test: vts_libsnapshot_test Change-Id: Ib4a281a3b5fe665c727c7077672e3c6b0b3abdba
Loading
Please register or sign in to comment