[RFC 1/3] create skeleton snapshot device and add docs

2022-07-22 Thread Richard Liu
Added a simple skeleton PCI device for snapshot/restores. Added documentation about the snapshot/restore functionality. Signed-off-by: Richard Liu --- docs/devel/snapshot.rst | 26 + hw/i386/Kconfig | 1 + hw/misc/Kconfig | 3 ++ hw/misc/meson.build | 1 + hw

[RFC 2/3] implement ram save/restore

2022-07-22 Thread Richard Liu
Use a file-backed copy-on-write mmap region for snapshots. Restores are handled by remmaping the fixed region. Currently, the snapshot file save path (`filepath`) is hardcoded (to a path that is memory-backed on my machine). Signed-off-by: Richard Liu --- hw/misc/snapshot.c | 72

[RFC 3/3] use migration code for cpu and device save/restore

2022-07-22 Thread Richard Liu
it is outside the vcpu thread by temporarily setting `current_cpu` to be null. The restore code (qemu_loadvm_state in particular) needs to be called in a bottom half or a coroutine. I am not sure why. Signed-off-by: Richard Liu --- hw/misc/snapshot.c | 6 migration/savevm.c | 84

[RFC 0/3] add snapshot/restore fuzzing device

2022-07-22 Thread Richard Liu
= 0; memory[0] = 0x101; // save snapshot printf("before: value of a = %d\n", a); a = 1; printf("middle: value of a = %d\n", a); memory[0] = 0x102; // load snapshot printf("after: value of a = %d\n", a); r

[PATCH] new snapshot/restore mechanism for fuzzing

2022-06-20 Thread Richard Liu
- create a document outlining specifications for a virtual device to manage snapshot/restore mechanism for fuzzing Signed-off-by: Richard Liu --- docs/devel/snapshot.rst | 26 ++ 1 file changed, 26 insertions(+) create mode 100644 docs/devel/snapshot.rst diff --git