princeton-sns / firecracker-tools

5 stars 5 forks source link

add two sub-folders under images #7

Closed tan-yue closed 5 years ago

tan-yue commented 5 years ago
  1. /fc_wrappers containing wrapper scripts for node and python
  2. /utils containing port I/O utils, namely /node-ts for Node.js, /portio for python, and a modified ts.c which takes two arguments value and port now.

As you can see in fc_wrapper.js and fc_wrapper.py, now snapshot signals must be sent by all vcpus and the signal is writing 124 to the magic port 0x03f0.

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.

alevy commented 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.

tan-yue commented 5 years ago

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.

alevy commented 5 years ago

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

tan-yue commented 5 years ago

agree.. I was too deep down in the rabbit hole of native extensions.. I am going to close this PR then.