Wed Nov 30 10:03:26 EST 2016

btrfs + lxc migration

- shut down the container
- snapshot current state as readonly
- (optionally) remove the writable volume
- determine last common ancestor between current and destination
- push an update  (optionally, retry if error)
- make a writable snapshot
- start container on remote host

The difficult parts here are:
- common ancestor
- retry if error

Common ancestor list:
- both source, dest should list ancestors
- merge list, sort
- dedupe, remove all that are not duplicate

Alt: compute intersection of two lists as sets, then sort results.

That would be easy to do in a real language with data structures, but
can it be done quickly on the command line?
grep -Fx -f file1 file2

EDIT: see subvol-migrate.sh

EDIT: it seems that moving modified snapshots back doesn't work well
because btrfs uses different UUIDs for local parents and received ids.
going to use this only in a "germ line" configuration, with a master
on a USB3.0 SSD.