---
title: "customVirtioDeviceWillStop(_:)"
framework: virtualization
role: symbol
role_heading: Instance Method
path: "virtualization/vzcustomvirtiodevicedelegate/customvirtiodevicewillstop(_:)"
---

# customVirtioDeviceWillStop(_:)

The method the framework calls when a device will be stopped.

## Declaration

```swift
optional func customVirtioDeviceWillStop(_ device: VZCustomVirtioDevice)
```

## Parameters

- `device`: The device invoking the delegate method.

## Discussion

Discussion A device is in a stopped state when its corresponding VZVirtualMachine has stopped. This can happen when the guest performs a shutdown operation itself,  or when you call requestStop().
