Closed tan-yue closed 5 years ago
I think we should reconsider how to do this after the changes to images/
in #6, and we definitely shouldn't include all of the node-ts
in the repository.
Since now host and vm communicates through vsock, we can use vsock to signal vm that language runtime is up instead of relying on port io.
We are interested in creating snapshots at certain checkpoints (now solely right after language runtime is up), so I believe we need the guest to actively signal the vmm that it reaches the desired checkpoint.
Since now host and vm communicates through vsock, we can use vsock to signal vm that language runtime is up instead of relying on port io.
Let's see how snapshotting with vsock works out. To do what you're proposing we'd need to open a vsock connection before snapshotting the VM, which may prove problematic.
Using port IO should be really simple with a basic C program that we just invoke as a subprocess from the language runtime.
So let's just see
agree.. I was too deep down in the rabbit hole of native extensions.. I am going to close this PR then.
/fc_wrappers
containing wrapper scripts for node and python/utils
containing port I/O utils, namely/node-ts
for Node.js,/portio
for python, and a modifiedts.c
which takes two argumentsvalue
andport
now.As you can see in
fc_wrapper.js
andfc_wrapper.py
, now snapshot signals must be sent by all vcpus and the signal is writing124
to the magic port0x03f0
.Once a vcpu sends the snapshot signal it exits to FC VMM. FC VMM blocks and does not take snapshot of irqchip, device states, memory (as these are per-machine states) until it receives snapshot signals from all vcpus. VMM code change is here. So it is important that the vcpu where the script is currently running is the last one to send the snapshot signal.