at master 28 kB view raw
1diff --git a/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_12.m b/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_12.m 2index 567172ba2..e2c1ac047 100644 3--- a/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_12.m 4+++ b/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_12.m 5@@ -8,6 +8,7 @@ 6 7 bool vmCanStop(void *machine, void *queue) 8 { 9+#ifdef INCLUDE_TARGET_OSX_12 10 if (@available(macOS 12, *)) { 11 __block BOOL result; 12 dispatch_sync((dispatch_queue_t)queue, ^{ 13@@ -15,12 +16,13 @@ bool vmCanStop(void *machine, void *queue) 14 }); 15 return (bool)result; 16 } 17- 18+#endif 19 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 20 } 21 22 void stopWithCompletionHandler(void *machine, void *queue, void *completionHandler) 23 { 24+#ifdef INCLUDE_TARGET_OSX_12 25 if (@available(macOS 12, *)) { 26 vm_completion_handler_t handler = makeVMCompletionHandler(completionHandler); 27 dispatch_sync((dispatch_queue_t)queue, ^{ 28@@ -29,7 +31,7 @@ void stopWithCompletionHandler(void *machine, void *queue, void *completionHandl 29 Block_release(handler); 30 return; 31 } 32- 33+#endif 34 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 35 } 36 37@@ -38,10 +40,11 @@ void stopWithCompletionHandler(void *machine, void *queue, void *completionHandl 38 */ 39 void *newVZGenericPlatformConfiguration() 40 { 41+#ifdef INCLUDE_TARGET_OSX_12 42 if (@available(macOS 12, *)) { 43 return [[VZGenericPlatformConfiguration alloc] init]; 44 } 45- 46+#endif 47 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 48 } 49 50@@ -51,11 +54,12 @@ void *newVZGenericPlatformConfiguration() 51 */ 52 void setDirectorySharingDevicesVZVirtualMachineConfiguration(void *config, void *directorySharingDevices) 53 { 54+#ifdef INCLUDE_TARGET_OSX_12 55 if (@available(macOS 12, *)) { 56 [(VZVirtualMachineConfiguration *)config setDirectorySharingDevices:[(NSMutableArray *)directorySharingDevices copy]]; 57 return; 58 } 59- 60+#endif 61 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 62 } 63 64@@ -66,11 +70,12 @@ void setDirectorySharingDevicesVZVirtualMachineConfiguration(void *config, void 65 */ 66 void setPlatformVZVirtualMachineConfiguration(void *config, void *platform) 67 { 68+#ifdef INCLUDE_TARGET_OSX_12 69 if (@available(macOS 12, *)) { 70 [(VZVirtualMachineConfiguration *)config setPlatform:(VZPlatformConfiguration *)platform]; 71 return; 72 } 73- 74+#endif 75 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 76 } 77 78@@ -80,11 +85,12 @@ void setPlatformVZVirtualMachineConfiguration(void *config, void *platform) 79 */ 80 void setGraphicsDevicesVZVirtualMachineConfiguration(void *config, void *graphicsDevices) 81 { 82+#ifdef INCLUDE_TARGET_OSX_12 83 if (@available(macOS 12, *)) { 84 [(VZVirtualMachineConfiguration *)config setGraphicsDevices:[(NSMutableArray *)graphicsDevices copy]]; 85 return; 86 } 87- 88+#endif 89 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 90 } 91 92@@ -94,11 +100,12 @@ void setGraphicsDevicesVZVirtualMachineConfiguration(void *config, void *graphic 93 */ 94 void setPointingDevicesVZVirtualMachineConfiguration(void *config, void *pointingDevices) 95 { 96+#ifdef INCLUDE_TARGET_OSX_12 97 if (@available(macOS 12, *)) { 98 [(VZVirtualMachineConfiguration *)config setPointingDevices:[(NSMutableArray *)pointingDevices copy]]; 99 return; 100 } 101- 102+#endif 103 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 104 } 105 106@@ -108,11 +115,12 @@ void setPointingDevicesVZVirtualMachineConfiguration(void *config, void *pointin 107 */ 108 void setKeyboardsVZVirtualMachineConfiguration(void *config, void *keyboards) 109 { 110+#ifdef INCLUDE_TARGET_OSX_12 111 if (@available(macOS 12, *)) { 112 [(VZVirtualMachineConfiguration *)config setKeyboards:[(NSMutableArray *)keyboards copy]]; 113 return; 114 } 115- 116+#endif 117 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 118 } 119 120@@ -122,11 +130,12 @@ void setKeyboardsVZVirtualMachineConfiguration(void *config, void *keyboards) 121 */ 122 void setAudioDevicesVZVirtualMachineConfiguration(void *config, void *audioDevices) 123 { 124+#ifdef INCLUDE_TARGET_OSX_12 125 if (@available(macOS 12, *)) { 126 [(VZVirtualMachineConfiguration *)config setAudioDevices:[(NSMutableArray *)audioDevices copy]]; 127 return; 128 } 129- 130+#endif 131 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 132 } 133 134@@ -136,10 +145,11 @@ void setAudioDevicesVZVirtualMachineConfiguration(void *config, void *audioDevic 135 */ 136 void *newVZVirtioSoundDeviceConfiguration() 137 { 138+#ifdef INCLUDE_TARGET_OSX_12 139 if (@available(macOS 12, *)) { 140 return [[VZVirtioSoundDeviceConfiguration alloc] init]; 141 } 142- 143+#endif 144 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 145 } 146 147@@ -148,11 +158,12 @@ void *newVZVirtioSoundDeviceConfiguration() 148 */ 149 void setStreamsVZVirtioSoundDeviceConfiguration(void *audioDeviceConfiguration, void *streams) 150 { 151+#ifdef INCLUDE_TARGET_OSX_12 152 if (@available(macOS 12, *)) { 153 [(VZVirtioSoundDeviceConfiguration *)audioDeviceConfiguration setStreams:[(NSMutableArray *)streams copy]]; 154 return; 155 } 156- 157+#endif 158 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 159 } 160 161@@ -162,10 +173,11 @@ void setStreamsVZVirtioSoundDeviceConfiguration(void *audioDeviceConfiguration, 162 */ 163 void *newVZVirtioSoundDeviceInputStreamConfiguration() 164 { 165+#ifdef INCLUDE_TARGET_OSX_12 166 if (@available(macOS 12, *)) { 167 return [[VZVirtioSoundDeviceInputStreamConfiguration alloc] init]; 168 } 169- 170+#endif 171 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 172 } 173 174@@ -174,12 +186,13 @@ void *newVZVirtioSoundDeviceInputStreamConfiguration() 175 */ 176 void *newVZVirtioSoundDeviceHostInputStreamConfiguration() 177 { 178+#ifdef INCLUDE_TARGET_OSX_12 179 if (@available(macOS 12, *)) { 180 VZVirtioSoundDeviceInputStreamConfiguration *inputStream = (VZVirtioSoundDeviceInputStreamConfiguration *)newVZVirtioSoundDeviceInputStreamConfiguration(); 181 [inputStream setSource:[[VZHostAudioInputStreamSource alloc] init]]; 182 return inputStream; 183 } 184- 185+#endif 186 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 187 } 188 189@@ -189,10 +202,11 @@ void *newVZVirtioSoundDeviceHostInputStreamConfiguration() 190 */ 191 void *newVZVirtioSoundDeviceOutputStreamConfiguration() 192 { 193+#ifdef INCLUDE_TARGET_OSX_12 194 if (@available(macOS 12, *)) { 195 return [[VZVirtioSoundDeviceOutputStreamConfiguration alloc] init]; 196 } 197- 198+#endif 199 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 200 } 201 202@@ -201,12 +215,13 @@ void *newVZVirtioSoundDeviceOutputStreamConfiguration() 203 */ 204 void *newVZVirtioSoundDeviceHostOutputStreamConfiguration() 205 { 206+#ifdef INCLUDE_TARGET_OSX_12 207 if (@available(macOS 12, *)) { 208 VZVirtioSoundDeviceOutputStreamConfiguration *outputStream = (VZVirtioSoundDeviceOutputStreamConfiguration *)newVZVirtioSoundDeviceOutputStreamConfiguration(); 209 [outputStream setSink:[[VZHostAudioOutputStreamSink alloc] init]]; 210 return outputStream; 211 } 212- 213+#endif 214 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 215 } 216 217@@ -220,12 +235,13 @@ void *newVZVirtioSoundDeviceHostOutputStreamConfiguration() 218 */ 219 void *newVZSharedDirectory(const char *dirPath, bool readOnly) 220 { 221+#ifdef INCLUDE_TARGET_OSX_12 222 if (@available(macOS 12, *)) { 223 NSString *dirPathNSString = [NSString stringWithUTF8String:dirPath]; 224 NSURL *dirURL = [NSURL fileURLWithPath:dirPathNSString]; 225 return [[VZSharedDirectory alloc] initWithURL:dirURL readOnly:(BOOL)readOnly]; 226 } 227- 228+#endif 229 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 230 } 231 232@@ -237,10 +253,11 @@ void *newVZSharedDirectory(const char *dirPath, bool readOnly) 233 */ 234 void *newVZSingleDirectoryShare(void *sharedDirectory) 235 { 236+#ifdef INCLUDE_TARGET_OSX_12 237 if (@available(macOS 12, *)) { 238 return [[VZSingleDirectoryShare alloc] initWithDirectory:(VZSharedDirectory *)sharedDirectory]; 239 } 240- 241+#endif 242 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 243 } 244 245@@ -252,10 +269,11 @@ void *newVZSingleDirectoryShare(void *sharedDirectory) 246 */ 247 void *newVZMultipleDirectoryShare(void *sharedDirectories) 248 { 249+#ifdef INCLUDE_TARGET_OSX_12 250 if (@available(macOS 12, *)) { 251 return [[VZMultipleDirectoryShare alloc] initWithDirectories:(NSDictionary<NSString *, VZSharedDirectory *> *)sharedDirectories]; 252 } 253- 254+#endif 255 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 256 } 257 258@@ -267,6 +285,7 @@ void *newVZMultipleDirectoryShare(void *sharedDirectories) 259 */ 260 void *newVZVirtioFileSystemDeviceConfiguration(const char *tag, void **error) 261 { 262+#ifdef INCLUDE_TARGET_OSX_12 263 if (@available(macOS 12, *)) { 264 NSString *tagNSString = [NSString stringWithUTF8String:tag]; 265 BOOL valid = [VZVirtioFileSystemDeviceConfiguration validateTag:tagNSString error:(NSError *_Nullable *_Nullable)error]; 266@@ -275,7 +294,7 @@ void *newVZVirtioFileSystemDeviceConfiguration(const char *tag, void **error) 267 } 268 return [[VZVirtioFileSystemDeviceConfiguration alloc] initWithTag:tagNSString]; 269 } 270- 271+#endif 272 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 273 } 274 275@@ -284,11 +303,12 @@ void *newVZVirtioFileSystemDeviceConfiguration(const char *tag, void **error) 276 */ 277 void setVZVirtioFileSystemDeviceConfigurationShare(void *config, void *share) 278 { 279+#ifdef INCLUDE_TARGET_OSX_12 280 if (@available(macOS 12, *)) { 281 [(VZVirtioFileSystemDeviceConfiguration *)config setShare:(VZDirectoryShare *)share]; 282 return; 283 } 284- 285+#endif 286 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 287 } 288 289@@ -298,10 +318,11 @@ void setVZVirtioFileSystemDeviceConfigurationShare(void *config, void *share) 290 */ 291 void *newVZUSBScreenCoordinatePointingDeviceConfiguration() 292 { 293+#ifdef INCLUDE_TARGET_OSX_12 294 if (@available(macOS 12, *)) { 295 return [[VZUSBScreenCoordinatePointingDeviceConfiguration alloc] init]; 296 } 297- 298+#endif 299 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 300 } 301 302@@ -311,10 +332,11 @@ void *newVZUSBScreenCoordinatePointingDeviceConfiguration() 303 */ 304 void *newVZUSBKeyboardConfiguration() 305 { 306+#ifdef INCLUDE_TARGET_OSX_12 307 if (@available(macOS 12, *)) { 308 return [[VZUSBKeyboardConfiguration alloc] init]; 309 } 310- 311+#endif 312 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 313 } 314 315@@ -328,6 +350,7 @@ void sharedApplication() 316 317 void startVirtualMachineWindow(void *machine, double width, double height) 318 { 319+#ifdef INCLUDE_TARGET_OSX_12 320 if (@available(macOS 12, *)) { 321 @autoreleasepool { 322 AppDelegate *appDelegate = [[[AppDelegate alloc] 323@@ -340,5 +363,6 @@ void startVirtualMachineWindow(void *machine, double width, double height) 324 return; 325 } 326 } 327+#endif 328 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 329 } 330diff --git a/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_12_arm64.m b/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_12_arm64.m 331index 4fbaf6cb7..452adb747 100644 332--- a/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_12_arm64.m 333+++ b/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_12_arm64.m 334@@ -30,6 +30,7 @@ 335 */ 336 void *newVZMacAuxiliaryStorageWithCreating(const char *storagePath, void *hardwareModel, void **error) 337 { 338+#ifdef INCLUDE_TARGET_OSX_12 339 if (@available(macOS 12, *)) { 340 NSString *storagePathNSString = [NSString stringWithUTF8String:storagePath]; 341 NSURL *storageURL = [NSURL fileURLWithPath:storagePathNSString]; 342@@ -38,7 +39,7 @@ void *newVZMacAuxiliaryStorageWithCreating(const char *storagePath, void *hardwa 343 options:VZMacAuxiliaryStorageInitializationOptionAllowOverwrite 344 error:(NSError *_Nullable *_Nullable)error]; 345 } 346- 347+#endif 348 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 349 } 350 351@@ -49,6 +50,7 @@ void *newVZMacAuxiliaryStorageWithCreating(const char *storagePath, void *hardwa 352 */ 353 void *newVZMacAuxiliaryStorage(const char *storagePath) 354 { 355+#ifdef INCLUDE_TARGET_OSX_12 356 if (@available(macOS 12, *)) { 357 NSString *storagePathNSString = [NSString stringWithUTF8String:storagePath]; 358 NSURL *storageURL = [NSURL fileURLWithPath:storagePathNSString]; 359@@ -56,7 +58,7 @@ void *newVZMacAuxiliaryStorage(const char *storagePath) 360 // https://developer.apple.com/documentation/virtualization/vzmacauxiliarystorage?language=objc 361 return [[VZMacAuxiliaryStorage alloc] initWithContentsOfURL:storageURL]; 362 } 363- 364+#endif 365 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 366 } 367 368@@ -80,10 +82,11 @@ void *newVZMacAuxiliaryStorage(const char *storagePath) 369 */ 370 void *newVZMacPlatformConfiguration() 371 { 372+#ifdef INCLUDE_TARGET_OSX_12 373 if (@available(macOS 12, *)) { 374 return [[VZMacPlatformConfiguration alloc] init]; 375 } 376- 377+#endif 378 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 379 } 380 381@@ -92,17 +95,19 @@ void *newVZMacPlatformConfiguration() 382 */ 383 void setHardwareModelVZMacPlatformConfiguration(void *config, void *hardwareModel) 384 { 385+#ifdef INCLUDE_TARGET_OSX_12 386 if (@available(macOS 12, *)) { 387 [(VZMacPlatformConfiguration *)config setHardwareModel:(VZMacHardwareModel *)hardwareModel]; 388 return; 389 } 390- 391+#endif 392 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 393 } 394 395 // Store the hardware model to disk so that we can retrieve them for subsequent boots. 396 void storeHardwareModelDataVZMacPlatformConfiguration(void *config, const char *filePath) 397 { 398+#ifdef INCLUDE_TARGET_OSX_12 399 if (@available(macOS 12, *)) { 400 VZMacPlatformConfiguration *macPlatformConfiguration = (VZMacPlatformConfiguration *)config; 401 NSString *filePathNSString = [NSString stringWithUTF8String:filePath]; 402@@ -110,7 +115,7 @@ void storeHardwareModelDataVZMacPlatformConfiguration(void *config, const char * 403 [macPlatformConfiguration.hardwareModel.dataRepresentation writeToURL:fileURL atomically:YES]; 404 return; 405 } 406- 407+#endif 408 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 409 } 410 411@@ -121,17 +126,19 @@ void storeHardwareModelDataVZMacPlatformConfiguration(void *config, const char * 412 */ 413 void setMachineIdentifierVZMacPlatformConfiguration(void *config, void *machineIdentifier) 414 { 415+#ifdef INCLUDE_TARGET_OSX_12 416 if (@available(macOS 12, *)) { 417 [(VZMacPlatformConfiguration *)config setMachineIdentifier:(VZMacMachineIdentifier *)machineIdentifier]; 418 return; 419 } 420- 421+#endif 422 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 423 } 424 425 // Store the machine identifier to disk so that we can retrieve them for subsequent boots. 426 void storeMachineIdentifierDataVZMacPlatformConfiguration(void *config, const char *filePath) 427 { 428+#ifdef INCLUDE_TARGET_OSX_12 429 if (@available(macOS 12, *)) { 430 VZMacPlatformConfiguration *macPlatformConfiguration = (VZMacPlatformConfiguration *)config; 431 NSString *filePathNSString = [NSString stringWithUTF8String:filePath]; 432@@ -139,7 +146,7 @@ void storeMachineIdentifierDataVZMacPlatformConfiguration(void *config, const ch 433 [macPlatformConfiguration.machineIdentifier.dataRepresentation writeToURL:fileURL atomically:YES]; 434 return; 435 } 436- 437+#endif 438 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 439 } 440 441@@ -151,11 +158,12 @@ void storeMachineIdentifierDataVZMacPlatformConfiguration(void *config, const ch 442 */ 443 void setAuxiliaryStorageVZMacPlatformConfiguration(void *config, void *auxiliaryStorage) 444 { 445+#ifdef INCLUDE_TARGET_OSX_12 446 if (@available(macOS 12, *)) { 447 [(VZMacPlatformConfiguration *)config setAuxiliaryStorage:(VZMacAuxiliaryStorage *)auxiliaryStorage]; 448 return; 449 } 450- 451+#endif 452 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 453 } 454 455@@ -169,10 +177,11 @@ void setAuxiliaryStorageVZMacPlatformConfiguration(void *config, void *auxiliary 456 */ 457 void *newVZMacOSBootLoader() 458 { 459+#ifdef INCLUDE_TARGET_OSX_12 460 if (@available(macOS 12, *)) { 461 return [[VZMacOSBootLoader alloc] init]; 462 } 463- 464+#endif 465 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 466 } 467 468@@ -182,10 +191,11 @@ void *newVZMacOSBootLoader() 469 */ 470 void *newVZMacGraphicsDeviceConfiguration() 471 { 472+#ifdef INCLUDE_TARGET_OSX_12 473 if (@available(macOS 12, *)) { 474 return [[VZMacGraphicsDeviceConfiguration alloc] init]; 475 } 476- 477+#endif 478 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 479 } 480 481@@ -194,11 +204,12 @@ void *newVZMacGraphicsDeviceConfiguration() 482 */ 483 void setDisplaysVZMacGraphicsDeviceConfiguration(void *graphicsConfiguration, void *displays) 484 { 485+#ifdef INCLUDE_TARGET_OSX_12 486 if (@available(macOS 12, *)) { 487 [(VZMacGraphicsDeviceConfiguration *)graphicsConfiguration setDisplays:[(NSMutableArray *)displays copy]]; 488 return; 489 } 490- 491+#endif 492 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 493 } 494 495@@ -210,13 +221,14 @@ void setDisplaysVZMacGraphicsDeviceConfiguration(void *graphicsConfiguration, vo 496 */ 497 void *newVZMacGraphicsDisplayConfiguration(NSInteger widthInPixels, NSInteger heightInPixels, NSInteger pixelsPerInch) 498 { 499+#ifdef INCLUDE_TARGET_OSX_12 500 if (@available(macOS 12, *)) { 501 return [[VZMacGraphicsDisplayConfiguration alloc] 502 initWithWidthInPixels:widthInPixels 503 heightInPixels:heightInPixels 504 pixelsPerInch:pixelsPerInch]; 505 } 506- 507+#endif 508 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 509 } 510 511@@ -226,6 +238,7 @@ void *newVZMacGraphicsDisplayConfiguration(NSInteger widthInPixels, NSInteger he 512 */ 513 void *newVZMacHardwareModelWithPath(const char *hardwareModelPath) 514 { 515+#ifdef INCLUDE_TARGET_OSX_12 516 if (@available(macOS 12, *)) { 517 VZMacHardwareModel *hardwareModel; 518 NSString *hardwareModelPathNSString = [NSString stringWithUTF8String:hardwareModelPath]; 519@@ -236,12 +249,13 @@ void *newVZMacHardwareModelWithPath(const char *hardwareModelPath) 520 } 521 return hardwareModel; 522 } 523- 524+#endif 525 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 526 } 527 528 void *newVZMacHardwareModelWithBytes(void *hardwareModelBytes, int len) 529 { 530+#ifdef INCLUDE_TARGET_OSX_12 531 if (@available(macOS 12, *)) { 532 VZMacHardwareModel *hardwareModel; 533 @autoreleasepool { 534@@ -250,7 +264,7 @@ void *newVZMacHardwareModelWithBytes(void *hardwareModelBytes, int len) 535 } 536 return hardwareModel; 537 } 538- 539+#endif 540 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 541 } 542 543@@ -259,10 +273,11 @@ void *newVZMacHardwareModelWithBytes(void *hardwareModelBytes, int len) 544 */ 545 void *newVZMacMachineIdentifier() 546 { 547+#ifdef INCLUDE_TARGET_OSX_12 548 if (@available(macOS 12, *)) { 549 return [[VZMacMachineIdentifier alloc] init]; 550 } 551- 552+#endif 553 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 554 } 555 556@@ -274,6 +289,7 @@ void *newVZMacMachineIdentifier() 557 */ 558 void *newVZMacMachineIdentifierWithPath(const char *machineIdentifierPath) 559 { 560+#ifdef INCLUDE_TARGET_OSX_12 561 if (@available(macOS 12, *)) { 562 VZMacMachineIdentifier *machineIdentifier; 563 NSString *machineIdentifierPathNSString = [NSString stringWithUTF8String:machineIdentifierPath]; 564@@ -284,12 +300,13 @@ void *newVZMacMachineIdentifierWithPath(const char *machineIdentifierPath) 565 } 566 return machineIdentifier; 567 } 568- 569+#endif 570 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 571 } 572 573 void *newVZMacMachineIdentifierWithBytes(void *machineIdentifierBytes, int len) 574 { 575+#ifdef INCLUDE_TARGET_OSX_12 576 if (@available(macOS 12, *)) { 577 VZMacMachineIdentifier *machineIdentifier; 578 @autoreleasepool { 579@@ -298,12 +315,13 @@ void *newVZMacMachineIdentifierWithBytes(void *machineIdentifierBytes, int len) 580 } 581 return machineIdentifier; 582 } 583- 584+#endif 585 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 586 } 587 588 nbyteslice getVZMacMachineIdentifierDataRepresentation(void *machineIdentifierPtr) 589 { 590+#ifdef INCLUDE_TARGET_OSX_12 591 if (@available(macOS 12, *)) { 592 VZMacMachineIdentifier *machineIdentifier = (VZMacMachineIdentifier *)machineIdentifierPtr; 593 NSData *data = [machineIdentifier dataRepresentation]; 594@@ -313,12 +331,13 @@ nbyteslice getVZMacMachineIdentifierDataRepresentation(void *machineIdentifierPt 595 }; 596 return ret; 597 } 598- 599+#endif 600 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 601 } 602 603 VZMacOSRestoreImageStruct convertVZMacOSRestoreImage2Struct(void *restoreImagePtr) 604 { 605+#ifdef INCLUDE_TARGET_OSX_12 606 if (@available(macOS 12, *)) { 607 VZMacOSRestoreImage *restoreImage = (VZMacOSRestoreImage *)restoreImagePtr; 608 VZMacOSRestoreImageStruct ret; 609@@ -329,12 +348,13 @@ VZMacOSRestoreImageStruct convertVZMacOSRestoreImage2Struct(void *restoreImagePt 610 ret.mostFeaturefulSupportedConfiguration = (void *)CFBridgingRetain([restoreImage mostFeaturefulSupportedConfiguration]); 611 return ret; 612 } 613- 614+#endif 615 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 616 } 617 618 void fetchLatestSupportedMacOSRestoreImageWithCompletionHandler(void *cgoHandler) 619 { 620+#ifdef INCLUDE_TARGET_OSX_12 621 if (@available(macOS 12, *)) { 622 [VZMacOSRestoreImage fetchLatestSupportedWithCompletionHandler:^(VZMacOSRestoreImage *restoreImage, NSError *error) { 623 VZMacOSRestoreImageStruct restoreImageStruct = convertVZMacOSRestoreImage2Struct(restoreImage); 624@@ -342,12 +362,13 @@ void fetchLatestSupportedMacOSRestoreImageWithCompletionHandler(void *cgoHandler 625 }]; 626 return; 627 } 628- 629+#endif 630 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 631 } 632 633 void loadMacOSRestoreImageFile(const char *ipswPath, void *cgoHandler) 634 { 635+#ifdef INCLUDE_TARGET_OSX_12 636 if (@available(macOS 12, *)) { 637 NSString *ipswPathNSString = [NSString stringWithUTF8String:ipswPath]; 638 NSURL *ipswURL = [NSURL fileURLWithPath:ipswPathNSString]; 639@@ -358,12 +379,13 @@ void loadMacOSRestoreImageFile(const char *ipswPath, void *cgoHandler) 640 }]; 641 return; 642 } 643- 644+#endif 645 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 646 } 647 648 VZMacOSConfigurationRequirementsStruct convertVZMacOSConfigurationRequirements2Struct(void *requirementsPtr) 649 { 650+#ifdef INCLUDE_TARGET_OSX_12 651 if (@available(macOS 12, *)) { 652 VZMacOSConfigurationRequirements *requirements = (VZMacOSConfigurationRequirements *)requirementsPtr; 653 VZMacOSConfigurationRequirementsStruct ret; 654@@ -373,12 +395,13 @@ VZMacOSConfigurationRequirementsStruct convertVZMacOSConfigurationRequirements2S 655 ret.hardwareModel = (void *)CFBridgingRetain([requirements hardwareModel]); 656 return ret; 657 } 658- 659+#endif 660 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 661 } 662 663 VZMacHardwareModelStruct convertVZMacHardwareModel2Struct(void *hardwareModelPtr) 664 { 665+#ifdef INCLUDE_TARGET_OSX_12 666 if (@available(macOS 12, *)) { 667 VZMacHardwareModel *hardwareModel = (VZMacHardwareModel *)hardwareModelPtr; 668 VZMacHardwareModelStruct ret; 669@@ -391,7 +414,7 @@ VZMacHardwareModelStruct convertVZMacHardwareModel2Struct(void *hardwareModelPtr 670 ret.dataRepresentation = retByteSlice; 671 return ret; 672 } 673- 674+#endif 675 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 676 } 677 678@@ -405,6 +428,7 @@ VZMacHardwareModelStruct convertVZMacHardwareModel2Struct(void *hardwareModelPtr 679 */ 680 void *newVZMacOSInstaller(void *virtualMachine, void *vmQueue, const char *restoreImageFilePath) 681 { 682+#ifdef INCLUDE_TARGET_OSX_12 683 if (@available(macOS 12, *)) { 684 __block VZMacOSInstaller *ret; 685 NSString *restoreImageFilePathNSString = [NSString stringWithUTF8String:restoreImageFilePath]; 686@@ -414,7 +438,7 @@ void *newVZMacOSInstaller(void *virtualMachine, void *vmQueue, const char *resto 687 }); 688 return ret; 689 } 690- 691+#endif 692 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 693 } 694 695@@ -425,6 +449,7 @@ void *newProgressObserverVZMacOSInstaller() 696 697 void installByVZMacOSInstaller(void *installerPtr, void *vmQueue, void *progressObserverPtr, void *completionHandler, void *fractionCompletedHandler) 698 { 699+#ifdef INCLUDE_TARGET_OSX_12 700 if (@available(macOS 12, *)) { 701 VZMacOSInstaller *installer = (VZMacOSInstaller *)installerPtr; 702 dispatch_sync((dispatch_queue_t)vmQueue, ^{ 703@@ -439,12 +464,13 @@ void installByVZMacOSInstaller(void *installerPtr, void *vmQueue, void *progress 704 }); 705 return; 706 } 707- 708+#endif 709 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 710 } 711 712 void cancelInstallVZMacOSInstaller(void *installerPtr) 713 { 714+#ifdef INCLUDE_TARGET_OSX_12 715 if (@available(macOS 12, *)) { 716 VZMacOSInstaller *installer = (VZMacOSInstaller *)installerPtr; 717 if (installer.progress.cancellable) { 718@@ -452,7 +478,7 @@ void cancelInstallVZMacOSInstaller(void *installerPtr) 719 } 720 return; 721 } 722- 723+#endif 724 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 725 } 726 727diff --git a/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_debug.m b/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_debug.m 728index 67fe356ae..af81a46b0 100644 729--- a/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_debug.m 730+++ b/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_debug.m 731@@ -12,10 +12,11 @@ 732 */ 733 void *newVZGDBDebugStubConfiguration(uint32_t port) 734 { 735+#ifdef INCLUDE_TARGET_OSX_12 736 if (@available(macOS 12, *)) { 737 return [[_VZGDBDebugStubConfiguration alloc] initWithPort:(NSInteger)port]; 738 } 739- 740+#endif 741 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 742 } 743 744@@ -24,10 +25,11 @@ void *newVZGDBDebugStubConfiguration(uint32_t port) 745 */ 746 void setDebugStubVZVirtualMachineConfiguration(void *config, void *debugStub) 747 { 748+#ifdef INCLUDE_TARGET_OSX_12 749 if (@available(macOS 12, *)) { 750 [(VZVirtualMachineConfiguration *)config _setDebugStub:(_VZDebugStubConfiguration *)debugStub]; 751 return; 752 } 753- 754+#endif 755 RAISE_UNSUPPORTED_MACOS_EXCEPTION(); 756 } 757\ No newline at end of file 758diff --git a/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_helper.h b/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_helper.h 759index 995b40882..9da0700b9 100644 760--- a/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_helper.h 761+++ b/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_helper.h 762@@ -18,6 +18,13 @@ NSDictionary *dumpProcessinfo(); 763 __builtin_unreachable(); \ 764 } while (0) 765 766+// for macOS 12 API 767+#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 120000 768+#define INCLUDE_TARGET_OSX_12 1 769+#else 770+#pragma message("macOS 12 API has been disabled") 771+#endif 772+ 773 // for macOS 12.3 API 774 #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 120300 775 #define INCLUDE_TARGET_OSX_12_3 1 776diff --git a/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_view.h b/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_view.h 777index ab00b9225..15d306f66 100644 778--- a/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_view.h 779+++ b/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_view.h 780@@ -23,9 +23,11 @@ 781 - (instancetype)init; 782 @end 783 784+#ifdef INCLUDE_TARGET_OSX_12 785 API_AVAILABLE(macos(12.0)) 786 @interface AppDelegate : NSObject <NSApplicationDelegate, NSWindowDelegate, VZVirtualMachineDelegate> 787 - (instancetype)initWithVirtualMachine:(VZVirtualMachine *)virtualMachine 788 windowWidth:(CGFloat)windowWidth 789 windowHeight:(CGFloat)windowHeight; 790-@end 791\ No newline at end of file 792+@end 793+#endif 794\ No newline at end of file 795diff --git a/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_view.m b/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_view.m 796index 9031c44f1..33b20d91b 100644 797--- a/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_view.m 798+++ b/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_view.m 799@@ -165,6 +165,7 @@ 800 801 @end 802 803+#ifdef INCLUDE_TARGET_OSX_12 804 @implementation AppDelegate { 805 VZVirtualMachine *_virtualMachine; 806 VZVirtualMachineView *_virtualMachineView; 807@@ -372,3 +373,4 @@ 808 [aboutPanel makeKeyAndOrderFront:nil]; 809 } 810 @end 811+#endif