Backend - Per-VM CPU affinity (vmstart/affinity.go, affinity_flow.go): modes auto / all / P-cores / non-LP-E / custom, saved in the VM folder, applied to the QEMU process on start (GUI and CLI) and live via SetVMAffinity; copied on clone. Start summary logs the resolved mapping. Host report gains CPU topology helpers (mask <-> CPU list). - Offline qcow2 restore points via qemu-img (driver/reims/snapshot.go, snapshot_flow.go): list / create / restore / delete. - SSH helpers (ssh_flow.go): remembered user, open a terminal, write an ~/.ssh/config entry, open VS Code Remote-SSH. - FocusVMWindow brings the QEMU window forward (restoring it if minimized); CopyVMScreenshot copies a full-resolution frame to the clipboard. - DeliverPathsToGuest copies dropped host files into the shared folder; main.go enables Wails file drop on elements marked --wails-drop-target. - VM note (.reims-go-note) and a storage breakdown (extras_flow.go). Frontend - VM page: running state's "Show Window" and the screen preview use FocusVMWindow; camera button and More-menu item copy a screenshot; editable note under the name; SSH row shows the saved user with Terminal / config / VS Code actions; restore-point list; install guide steps can be ticked off; drop files onto the page to send them. - Sidebar right-click menu per VM (start, show window, screenshot, stop, restart, settings, folders, clone, delete); double-click and Ctrl+Enter still run the main action. - AffinityDialog opened from the VM menu and VM settings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
38 lines
1.3 KiB
Go
38 lines
1.3 KiB
Go
package host
|
|
|
|
import "testing"
|
|
|
|
func TestGPUClassificationAndRecommendation(t *testing.T) {
|
|
gpus := []GPUInfo{
|
|
{Name: "Todesk Virtual Display Adapter", VulkanICD: "", Kind: ClassifyGPU("Todesk Virtual Display Adapter")},
|
|
{Name: "Intel(R) UHD Graphics 770", VulkanICD: `C:\igvk64.json`, Kind: ClassifyGPU("Intel(R) UHD Graphics 770")},
|
|
{Name: "NVIDIA GeForce RTX 4070 Ti", VulkanICD: `C:\nv-vk64.json`, Kind: ClassifyGPU("NVIDIA GeForce RTX 4070 Ti")},
|
|
}
|
|
if gpus[0].Kind != GPUVirtual {
|
|
t.Fatalf("expected virtual, got %s", gpus[0].Kind)
|
|
}
|
|
if gpus[1].Kind != GPUIntegrated {
|
|
t.Fatalf("expected integrated, got %s", gpus[1].Kind)
|
|
}
|
|
if gpus[2].Kind != GPUDiscrete {
|
|
t.Fatalf("expected discrete, got %s", gpus[2].Kind)
|
|
}
|
|
rec := PickRecommendedGPU(gpus)
|
|
if rec == nil || rec.VulkanICD != `C:\nv-vk64.json` {
|
|
t.Fatalf("expected NVIDIA discrete GPU to be recommended, got %#v", rec)
|
|
}
|
|
}
|
|
|
|
func TestAffinityMaskHelpers(t *testing.T) {
|
|
if got := AllCPUsMask(8); got != 0xFF {
|
|
t.Fatalf("AllCPUsMask(8) = 0x%X, want 0xFF", got)
|
|
}
|
|
if got := AllCPUsMask(64); got != ^uint64(0) {
|
|
t.Fatalf("AllCPUsMask(64) = 0x%X, want all-ones", got)
|
|
}
|
|
mask, cpus := CPUsToMask([]int{4, 1, 4, -1, 16}, 16)
|
|
if mask != 0x12 || len(cpus) != 2 || cpus[0] != 1 || cpus[1] != 4 {
|
|
t.Fatalf("CPUsToMask = (0x%X, %v), want (0x12, [1 4])", mask, cpus)
|
|
}
|
|
}
|