Skip to content

Commit

Permalink
make sure macOS12 SDK can be used
Browse files Browse the repository at this point in the history
  • Loading branch information
s-u committed Nov 9, 2022
1 parent 54b6b9a commit 68d85aa
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions macosvm/VMInstance.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
#include <unistd.h>
#include <sys/errno.h>
#include <sys/stat.h>
/* for socket networking */
#include <sys/un.h>
#include <sys/socket.h>

@implementation VMSpec

Expand Down Expand Up @@ -710,8 +713,14 @@ that a previously created socket (especially not a link) */
@throw [NSException exceptionWithName:@"VMConfigDiskStorageError" reason:[err description] userInfo:nil];
if ([tmp isEqualToString:@"disk"])
[std addObject:[[VZVirtioBlockDeviceConfiguration alloc] initWithAttachment:a]];
else
[std addObject:[[VZUSBMassStorageDeviceConfiguration alloc] initWithAttachment:a]];
else {
#if (TARGET_OS_OSX && __MAC_OS_X_VERSION_MAX_ALLOWED >= 130000)
if (@available(macOS 13, *))
[std addObject:[[VZUSBMassStorageDeviceConfiguration alloc] initWithAttachment:a]];
else
#endif
@throw [NSException exceptionWithName:@"VMConfigDiskStorageError" reason:@"USB storage is not supported by this macOS/build" userInfo:nil];
}
}
if ([tmp isEqualToString:@"aux"]) {
NSError *err = nil;
Expand Down

0 comments on commit 68d85aa

Please sign in to comment.