-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for nested virtualization
Signed-off-by: Abiola Ibrahim <git@abiosoft.com>
- Loading branch information
Showing
5 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// | ||
// virtualization_15.h | ||
|
||
#pragma once | ||
|
||
#import "virtualization_helper.h" | ||
#import <Virtualization/Virtualization.h> | ||
|
||
/* macOS 15 API */ | ||
bool isNestedVirtualizationSupported(); | ||
void setNestedVirtualizationEnabled(void *config, bool nestedVirtualizationEnabled); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// | ||
// virtualization_15.m | ||
// | ||
#import "virtualization_15.h" | ||
|
||
/*! | ||
@abstract Check if nested virtualization is supported. | ||
@return true if supported. | ||
*/ | ||
bool isNestedVirtualizationSupported() | ||
{ | ||
#ifdef INCLUDE_TARGET_OSX_15 | ||
if (@available(macOS 15, *)) { | ||
return (bool) VZGenericPlatformConfiguration.isNestedVirtualizationSupported; | ||
} | ||
#endif | ||
RAISE_UNSUPPORTED_MACOS_EXCEPTION(); | ||
} | ||
|
||
/*! | ||
@abstract Set nestedVirtualizationEnabled. The default is false. | ||
*/ | ||
void setNestedVirtualizationEnabled(void *config, bool nestedVirtualizationEnabled) | ||
{ | ||
#ifdef INCLUDE_TARGET_OSX_15 | ||
if (@available(macOS 15, *)) { | ||
VZGenericPlatformConfiguration *platformConfig = (VZGenericPlatformConfiguration *)config; | ||
platformConfig.nestedVirtualizationEnabled = (BOOL) nestedVirtualizationEnabled; | ||
return; | ||
} | ||
#endif | ||
RAISE_UNSUPPORTED_MACOS_EXCEPTION(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters