Today I learned about Qemu overlay storage images. To create an overlay image from a backing image we use the following command:

qemu-img create -o backing_file=img1.raw,backing_fmt=raw -f qcow2 img1.cow

Then we can boot from the new image, and changes to its filesystem will be recorded in the overlay image.

qemu-system-x86_64 img1.cow

The backing image absolute path is stored in the new image, so changing the its path require manual entervention.

source