Is there any existing system for efficiently tracking the version history of a virtual disk image?
Essentially, I have a disk image which is used as a "template" root filesystem for testing programs. I occasionally need to make changes to it (e.g. installing packages), but most of the time it is read-only. I need to be able to keep the full history of changes (mainly so that I can roll back if something goes wrong, but I also may need to look up an older revision by date & time in order to reproduce an earlier test.)
I'd like the history to be stored in some sort of incremental format, since most of the time the changes I'm making are very small (and the complete disk image is huge.)
I'd like it if each revision were stored in a separate file, for ease of backing up with rsync.
I'd like to be able to easily delete old revisions that are no longer needed.
I'd like it if the most recent revision were stored as something close to a flat file, i.e. the read performance should O(1), independent of how many older revisions there are.
Oh, and it needs to be possible for a VM to safely use the disk image (in read-only fashion) while I am making modifications; "committing" has to be an atomic operation.
(Obviously I expect there to be some tradeoffs among these criteria; I'm just trying to give an idea of what I'm looking for.)
Performance for the actual "version control" operations is comparatively unimportant; correctness and stability, on the other hand, are crucial.
I am currently using kvm / qemu, with qcow2 disk images, but I'd be interested in hearing about other options.
I can see how I might write such a version control system myself, using qemu-img with backing files and rebasing, but is there any existing set of tools that would work for this purpose?