Commit 3980067
authored
vm inspect: expose the guest console path (#202)
* review: drop clone-side watchdog leftovers
CloneVMConfigFromFlags passes the snapshot policy straight through, so
the local only existed for the removed override branch. The clone-path
validateBackendFlags call is unreachable by construction: every knob it
gates is inherited from the snapshot, and create already rejects them
on Firecracker.
* vm: expose the guest console path in inspect (#201)
Consumers driving cocoon over the CLI cannot query the CH API socket
(0700, owner-only) to find where a VM's console lives. Inspect now
reports console_path for running VMs: the console.sock UDS (UEFI
serial, FC relay) resolved by a stat, or the CH-allocated PTY for
direct boot, which each boot path (start, clone, restore) queries once
via vm.info after the VMM is up and saves to console.pty in the run
dir, pidfile-style. Inspect and list stay free of API calls; boot
paths pay one vm.info GET plus a small buffered write, direct boot
only, after resume.
ToVM now also zeroes the runtime socket fields for non-running VMs:
clone and restore persist boot-time paths into the record, which
previously leaked as stale socket_path/vsock_socket on stopped clones,
contradicting the documented State==running contract.
* vm: drop runtime paths from stale-running inspect output
ReconcileState flips a dead-PID VM to stopped (stale) for display, but
ToVM had already populated socket_path/vsock_socket/console_path from
the persisted Running state; a reused PTY number could point a
supervisor at another process's terminal. Clear the paths at the flip.
* vm: reconcile stale-running state in one-shot status JSON
statusOnce serialized ToVM output directly, so vm status/list
--format json skipped the dead-PID flip and its runtime-path
clearing that inspect, table, and event modes already apply.1 parent 0234381 commit 3980067
16 files changed
Lines changed: 214 additions & 12 deletions
File tree
- cmd
- core
- vm
- docs
- hypervisor
- cloudhypervisor
- types
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
| 68 | + | |
67 | 69 | | |
68 | 70 | | |
69 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
203 | 228 | | |
204 | 229 | | |
205 | 230 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
112 | 111 | | |
113 | 112 | | |
114 | 113 | | |
| |||
133 | 132 | | |
134 | 133 | | |
135 | 134 | | |
136 | | - | |
| 135 | + | |
137 | 136 | | |
138 | 137 | | |
139 | 138 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
328 | 328 | | |
329 | 329 | | |
330 | 330 | | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | 331 | | |
335 | 332 | | |
336 | 333 | | |
| |||
479 | 476 | | |
480 | 477 | | |
481 | 478 | | |
482 | | - | |
| 479 | + | |
483 | 480 | | |
484 | 481 | | |
485 | 482 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
100 | 104 | | |
101 | 105 | | |
102 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
| 285 | + | |
| 286 | + | |
285 | 287 | | |
286 | 288 | | |
287 | 289 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| 150 | + | |
150 | 151 | | |
151 | 152 | | |
152 | 153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| 120 | + | |
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
27 | 31 | | |
28 | 32 | | |
29 | 33 | | |
| |||
0 commit comments