Commit 2c9d705
authored
[vsock] better handle Lifecycle (#1104)
This PR extends the VsockPoller event loop so that it complies with the Lifecycle trait within propolis.
The virtio device now requests a pause to the event-loop by sending a VsockEvent::Pause via port_send(3C).
When the event loop receives this event it finishes processing any tasks and then waits on a mpsc channel. This channel is responsible for processing follow up events driven by the virtio device lifecycle such as resume, reset, and halt. The reset event takes care of cleaning up all state internal to VsockPoller in addition to removing the cached descriptor chain in VsockVq. It's important we drop this cached descriptor as using it across device resets would cause propolis to scribble data into a random location in guest memory depending on where the GuestAddr points.
Finally with this work in place it should make solving #1065 trivial.1 parent fe47987 commit 2c9d705
4 files changed
Lines changed: 429 additions & 34 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
154 | 163 | | |
155 | 164 | | |
156 | 165 | | |
| |||
253 | 262 | | |
254 | 263 | | |
255 | 264 | | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
256 | 269 | | |
257 | 270 | | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
258 | 278 | | |
259 | 279 | | |
260 | 280 | | |
| |||
0 commit comments