VGA console: one console operation per VM, a data websocket per SPICE channel

spice-html5 opens a websocket per channel (main, display, inputs, cursor, playback), and
each one was making Ham Lab open a new console operation, which Incus refuses as already
connected. Now the first channel opens the operation and holds its control websocket; every
further channel is one more data websocket on the same operation, which Incus allows; the
operation is let go when the last channel closes. A stale operation from a previous Ham Lab
process is taken over with force.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Mitchell-Johnson
2026-10-09 22:32:08 -07:00
co-authored by Claude Fable 5.1
parent a5ebfdc9ce
commit 80a5b4b464
3 changed files with 109 additions and 43 deletions
+1
View File
@@ -58,6 +58,7 @@ type Manager struct {
mu sync.Mutex
cpuPrev map[string]map[string]cpuMark // caller → instance → last reading, so two readers do not spoil each other's deltas
vga map[string]*vgaSession // instance → the console operation its browser channels share
remote struct {
at time.Time
list []Image