forked from Code-Hex/vz
-
Notifications
You must be signed in to change notification settings - Fork 1
/
configuration_arm64.go
29 lines (26 loc) · 1.06 KB
/
configuration_arm64.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//go:build darwin && arm64
// +build darwin,arm64
package vz
/*
#cgo darwin CFLAGS: -mmacosx-version-min=11 -x objective-c -fno-objc-arc
#cgo darwin LDFLAGS: -lobjc -framework Foundation -framework Virtualization
# include "virtualization_14_arm64.h"
*/
import "C"
import "github.com/Code-Hex/vz/v3/internal/objc"
// ValidateSaveRestoreSupport Determines whether the framework can save or restore the VM’s current configuration.
//
// Verify that a virtual machine with this configuration is savable.
// Not all configuration options can be safely saved and restored from file.
//
// If this evaluates to false, the caller should expect future calls to `(*VirtualMachine).SaveMachineStateToPath` to fail.
// error If not nil, assigned with an error describing the unsupported configuration option.
func (v *VirtualMachineConfiguration) ValidateSaveRestoreSupport() (bool, error) {
nserrPtr := newNSErrorAsNil()
ret := C.validateSaveRestoreSupportWithError(objc.Ptr(v), &nserrPtr)
err := newNSError(nserrPtr)
if err != nil {
return false, err
}
return (bool)(ret), nil
}