config(apple): create generic platform if it does not exist

This commit is contained in:
osy
2024-11-20 10:56:23 -08:00
parent 8a2429188f
commit 662dfb9cf0
@@ -67,6 +67,10 @@ struct UTMAppleConfigurationSystem: Codable {
boot = try values.decode(UTMAppleConfigurationBoot.self, forKey: .boot)
macPlatform = try values.decodeIfPresent(UTMAppleConfigurationMacPlatform.self, forKey: .macPlatform)
genericPlatform = try values.decodeIfPresent(UTMAppleConfigurationGenericPlatform.self, forKey: .genericPlatform)
if boot.operatingSystem == .linux && genericPlatform == nil {
// fix a bug where this was not created
genericPlatform = UTMAppleConfigurationGenericPlatform()
}
}
func encode(to encoder: Encoder) throws {