Virtual Device Reference

This chapter presents the vdevs delivered with the QHS and other QNX hypervisors, and describes how to configure them.

Note:

Virtual devices in a QHS system

If you are using the QHS to implement a system that will be certified to a safety standard, use the safety-certified vdev shared objects. For example: vdev-foo-safety.so.

The shared object name doesn't affect the configuration syntax or semantics. For example, assuming that such vdevs actually existed you would specify the options for vdev-foo.so and vdev-foo-safety.so the same way. It might be the case, however, that the safety-variant of a vdev implements restrictions or additional functionality not present in the non-safety variant. These changes might affect the safety vdev's configuration options.

Implicit vdevs

An implicit vdev is a vdev that is in the qvm process code, so it is present even if you don't specify it. You need to specify this vdev only if you don't want to use the default values for its options. Implicit vdevs are marked as such in the individual vdev descriptions in this chapter.

Syntax

All virtual devices specified in a qvm configuration are preceded by the vdev option, which identifies the component as a virtual device. Its mandatory vdev_type argument specifies the device type. The syntax for the vdev option is:

vdev vdev_type

For example, the following creates for the current VM a vdev that emulates an Intel 8254 timer chip:

vdev timer8254
	intr myioapic:0
Note: The qvm configuration parsing and validation allows colons (“:”) in the vdev name option, because they may be used with some vdevs, such as virtio-net. However, this character is not supported for PIC vdevs (e.g., vdev gic, vdev ioapic). If you use a colon in a PIC device name, you will get an error when you attempt to refer to it in the configuration for another vdev (e.g., in an intr option).

Common vdev options

The options described below may apply to more than one type of vdev. If the option is described in the vdev description, refer to that description:

hostvector vector_number
Applies only to Programmable Interrupt Controller (PIC) vdevs. This option sets the associated host vector number of the first line of the current vdev. This number is used by InterruptAttach() and InterruptAttachEvent() (see the QNX SDP C Library Reference). The PIC input lines that follow are sequentially assigned to host vector numbers.
This option is needed only if any of the PIC guest interrupts will be marked as pass-through. If hostvector isn't specified, its value defaults to the previous PIC device's hostvector number, plus this previous devices' number of lines. If this is the first PIC specified, hostvector defaults to 0 (zero).
intr guest_intr
The guest interrupt of the current vdev is set to guest_intr, in two parts, separated by a colon (e.g., intr gic:40).
For PCI devices that use an interrupt, if you don't set a number for guest_intr, this number is automatically assigned. For non-PCI devices (e.g., MMIO devices), you must set this option.
For more information, see Guest interrupts in the Configuration chapter.
loc location_spec
The current vdev has its location in the guest-physical address set to location_spec. For non-PCI devices (e.g., MMIO devices), you must set this option.
name name
An optional name used by the virtual device (vdev) for further configuration. Each vdev may have its own name option. Currently this option is relevant only for peer vdevs, such as virtio-net, and for PIC devices. For certain PIC devices, the name may be referenced in guest_intr specifications to say that the device is connected to a given PIC input line.

See VM configuration file example for details on how the name option relates to specific PIC hardware. See vdev virtio-net in this chapter for more information about using the name option when configuring peers in a network.