<!--
{
  "availability" : [
    "macOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Virtualization",
  "identifier" : "/documentation/Virtualization/VZCustomVirtioDevice/queue(at:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Virtualization"
    ],
    "preciseIdentifier" : "c:objc(cs)VZCustomVirtioDevice(im)queueAtIndex:"
  },
  "title" : "queue(at:)"
}
-->

# queue(at:)

Returns Virtio queue at the specified index that belongs to this device.

```
func queue(at index: UInt16) -> VZVirtioQueue?
```

## Parameters

`index`

The index of the [`VZVirtioQueue`](/documentation/Virtualization/VZVirtioQueue).

## Return Value

The [`VZVirtioQueue`](/documentation/Virtualization/VZVirtioQueue) object at the specified index, or `nil` if the index is invalid or the guest driver has disabled the queue.

## Discussion

The framework sets up the virtqueues (Virtio queues) when the guest driver sets `DRIVER_OK`; this call returns a valid result only after the framework calls [`customVirtioDeviceDidAcceptDriverOk(_:)`](/documentation/Virtualization/VZCustomVirtioDeviceDelegate/customVirtioDeviceDidAcceptDriverOk(_:)).

---

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)