---
title: VZCustomVirtioDeviceDelegate
framework: virtualization
role: symbol
role_heading: Protocol
path: virtualization/vzcustomvirtiodevicedelegate
---

# VZCustomVirtioDeviceDelegate

A delegate protocol that defines the methods you implement to respond to the life cycle events of a custom Virtio device.

## Declaration

```swift
protocol VZCustomVirtioDeviceDelegate : NSObjectProtocol
```

## Overview

Overview When you define these methods and set the delegate on your VZCustomVirtioDevice instance, the Virtualization framework notifies you when the Virtio device stops, pauses, resumes, or resets by the invocation of the respective methods defined here, and you can provide code to handle each of these situations. The framework considers the device to be ready when the guest driver sets DRIVER_OK, indicated by the invocation of customVirtioDeviceDidAcceptDriverOk(_:), this means that the guest driver is set up and ready to drive the device, and the device is ready to process any device operations. Virtqueue (Virtio queue) notifications trigger device operations, then the framework invokes the customVirtioDevice(_:didReceiveNotificationFor:) method when the guest driver sends the device a virtqueue notification, and you can provide code to handle the notification.

## Topics

### Instance Methods

- [customVirtioDevice(_:didReceiveNotificationFor:)](virtualization/vzcustomvirtiodevicedelegate/customvirtiodevice(_:didreceivenotificationfor:).md)
- [customVirtioDeviceDidAcceptDriverOk(_:)](virtualization/vzcustomvirtiodevicedelegate/customvirtiodevicedidacceptdriverok(_:).md)
- [customVirtioDeviceSaveState(forRestore:)](virtualization/vzcustomvirtiodevicedelegate/customvirtiodevicesavestate(forrestore:).md)
- [customVirtioDeviceShouldRestore(_:saveState:)](virtualization/vzcustomvirtiodevicedelegate/customvirtiodeviceshouldrestore(_:savestate:).md)
- [customVirtioDeviceWillPause(_:)](virtualization/vzcustomvirtiodevicedelegate/customvirtiodevicewillpause(_:).md)
- [customVirtioDeviceWillReset(_:)](virtualization/vzcustomvirtiodevicedelegate/customvirtiodevicewillreset(_:).md)
- [customVirtioDeviceWillResume(_:)](virtualization/vzcustomvirtiodevicedelegate/customvirtiodevicewillresume(_:).md)
- [customVirtioDeviceWillStop(_:)](virtualization/vzcustomvirtiodevicedelegate/customvirtiodevicewillstop(_:).md)

## Relationships

### Inherits From

- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Related Documentation

- [VZCustomVirtioDevice](virtualization/vzcustomvirtiodevice.md)

### Responding to Virtio events

- [VZCustomVirtioDeviceConfigurationDelegate](virtualization/vzcustomvirtiodeviceconfigurationdelegate.md)
