---
title: "customVirtioDeviceShouldRestore(_:saveState:)"
framework: virtualization
role: symbol
role_heading: Instance Method
path: "virtualization/vzcustomvirtiodevicedelegate/customvirtiodeviceshouldrestore(_:savestate:)"
---

# customVirtioDeviceShouldRestore(_:saveState:)

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

## Declaration

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

## Parameters

- `device`: The device invoking the delegate method.
- `saveState`: The data that the delegate returned from doc://com.apple.virtualization/documentation/Virtualization/VZCustomVirtioDeviceDelegate/customVirtioDeviceSaveState(forRestore:).

## Discussion

Discussion This method should return NO if restore operation failed.
