mirror of
https://github.com/juanfont/headscale.git
synced 2026-11-24 22:26:29 +09:00
cmd/hi: warn when /dev/kvm is missing
Updates tailscale/tailscale#15660
This commit is contained in:
1 parent
248d2c4054
commit
e48c8409f0
1 file changed
+17
@@ -91,6 +91,8 @@ func runPreflightChecks(ctx context.Context, full bool) error {
|
||||
// Check 5: Required files
|
||||
results = append(results, checkRequiredFiles(ctx))
|
||||
|
||||
results = append(results, checkKVM())
|
||||
|
||||
// Display results
|
||||
displayDoctorResults(results)
|
||||
|
||||
@@ -214,6 +216,21 @@ func checkDockerHubCredentials() DoctorResult {
|
||||
return pass("Docker Hub Credentials", fmt.Sprintf("Credentials available (source: %s)", source))
|
||||
}
|
||||
|
||||
// checkKVM reports whether the Android emulator tests can run. Only those
|
||||
// tests need KVM, so its absence is a warning.
|
||||
func checkKVM() DoctorResult {
|
||||
_, err := os.Stat("/dev/kvm")
|
||||
if err != nil {
|
||||
return warn(
|
||||
"KVM",
|
||||
"/dev/kvm not available — TestAndroid* cannot boot the emulator",
|
||||
"Use an x86_64 host with hardware virtualization (bare metal or nested virtualization)",
|
||||
)
|
||||
}
|
||||
|
||||
return pass("KVM", "/dev/kvm available for Android emulator tests")
|
||||
}
|
||||
|
||||
// checkGolangImage verifies the golang Docker image is available locally or can be pulled.
|
||||
func checkGolangImage(ctx context.Context) DoctorResult {
|
||||
cli, err := createDockerClient(ctx)
|
||||
|
||||
Reference in new issue
Block a user