Resume suspended VMs without explicit `--suspendable` flag (#540)

This commit is contained in:
Fedor Korotkov 2023-07-07 03:38:31 -04:00 committed by GitHub
parent 2014de7dac
commit d2ed4ef801
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -108,6 +108,12 @@ struct Run: AsyncParsableCommand {
if graphics && noGraphics {
throw ValidationError("--graphics and --no-graphics are mutually exclusive")
}
let localStorage = VMStorageLocal()
let vmDir = try localStorage.open(name)
if try vmDir.state() == "suspended" {
suspendable = true
}
}
@MainActor