I have an Android snapshots file that is automatically created by the android AVD manager when I define an AVD.
When I launch the emulator for the first time, the Android emulator stores the system state and the snapshot file size grows to nearly 400 MB.
Checking the file with qemu-img info snapshots.img
I get the following result:
file format: qcow2
virtual size: 500M (524288000 bytes)
disk size: 402M
cluster_size: 65536
Snapshot list:
ID TAG VM SIZE DATE VM CLOCK
1 default-boot 401M 2013-04-03 18:19:07 00:05:54.432
I close the emulator and launch it again from the snapshot, selecting to store again the changes to the same snapshot file.
Now the snapshot file takes about 800 MB. Nonetheless, if I check it again with qemu-img info snapshots.img
I get the same result as before, just the disk size has changed.
file format: qcow2
virtual size: 500M (524288000 bytes)
disk size: 804M
cluster_size: 65536
Snapshot list:
ID TAG VM SIZE DATE VM CLOCK
1 default-boot 401M 2013-04-30 15:34:16 00:06:42.354
Now, I do not get why the disk size gets doubled. How is that space used? Is there any way to shrink the qemu image file to take only the space actually needed by the snapshot image?