<!--
{
  "availability" : [
    "macOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Virtualization",
  "identifier" : "/documentation/Virtualization/VZCustomVirtioDeviceDelegate/customVirtioDeviceShouldRestore(_:saveState:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Virtualization"
    ],
    "preciseIdentifier" : "c:objc(pl)VZCustomVirtioDeviceDelegate(im)customVirtioDeviceShouldRestore:saveState:"
  },
  "title" : "customVirtioDeviceShouldRestore(_:saveState:)"
}
-->

# customVirtioDeviceShouldRestore(_:saveState:)

The method the framework calls when a device restores its state.

```
optional func customVirtioDeviceShouldRestore(_ device: VZCustomVirtioDevice, saveState: Data) -> Bool
```

## Parameters

`device`

The device invoking the delegate method.

`saveState`

The data that the delegate returned from [`customVirtioDeviceSaveState(forRestore:)`](/documentation/Virtualization/VZCustomVirtioDeviceDelegate/customVirtioDeviceSaveState(forRestore:)).

## Discussion

This method should return `NO` if restore operation failed.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)