'qemu start multi vm from single snapshot and separately snapshot again

I want to implement program backtracking using qemu's snapshot feature. A snapshot may be created at any stage of the program's run, and then other VMs will resume from one snapshot, running for a period of time and then generating the snapshot again. It is still possible for newly generated snapshots to be resumed by multiple VMs and explore different branches.

I know that incremental snapshots or -snapshot can help me create multiple VM instances from a qcow2 image, but taking snapshot again and allowing multiple vm resumes may be difficult.Can someone give me some advice. In addition to using the existing features to achieve this function, it is acceptable to extend the qcow2 format, or modify the qemu source code, but I need direction.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source