Implementing a vdev

After you have developed your vdev you must add it to your hypervisor system.

Adding a vdev to your hypervisor system

To add your vdev to your hypervisor system, you will need to:

  1. Compile your vdev source to create a shared object binary (see the QNX Neutrino Programmer's Guide).
  2. Add your vdev-*.so shared object to your hypervisor host buildfile (see Building Embedded Systems).
  3. Rebuild your hypervisor host to include your new vdev-*.so file and the VM configuration that includes the vdev.
  4. Add the vdev and its configuration information to your VM configuration (see the Configuration chapter in the User's Guide).
Note: The qvm process uses the standard shared object mechanisms and environment variables. For example, you can use LD_LIBRARY_PATH to set the search path, and DL_DEBUG path to set the debug level (see Setting PATH and LD_LIBRARY_PATH in the QNX SDP User's Guide and Diagnostics and debugging in the QNX SDP Programmer's Guide).

If your vdev emulates a physical device (e.g., vdev pl011) your guest OS may already have a device driver that will work with the vdev. If your guest doesn't have a driver that supports the vdev, you will need to write one and include it in your guest. For QNX Neutrino guests, see the QNX SDP documentation; for other types of guest OS, refer to the appropriate documentation for those OSs.

We recommend that you start with one of the vdev examples available on GitHub, and go through the steps described above to add it to your system, and confirm that everything works as expected. The examples work, so you can focus on making sure that you know how to implement a vdev. This way, when you have your own vdev ready to test, adding the vdev to your system and configuring the VM will be familiar tasks.

Compiling a vdev

To compile a vdev, you need vdev/common.mk, vdev/Makefile, and the entire vdev/name directory, where name is the name of the vdev directory; for example vdev/trace.

See the vdev source code examples on GitHub at github.com/qnx.

Adding a vdev to a QNX Hypervisor for Safety (QHS) system

DANGER

If you are building a safety-related system, you must use the QNX Hypervisor for Safety variant (QHS) that has been built and approved for use in the type of system you are building, and you must use it only as specified in its Safety Manual.

For general information about the QHS, see the QNX Hypervisor for Safety chapter in the QNX Hypervisor User's Guide.

If you write a vdev and add it to a QHS system, this addition compromises the system's safety certification. It is your responsibility to ensure that, if required, you update your system's Safety Manual to take into account the impact of your new vdev or vdevs, and that your modified system:

  • meets the necessary safety requirements
  • receives appropriate certification
  • is used in accordance with its Safety Manual

The QHS includes safety-certified vdevs. These vdevs are built with digital signatures that identify them as safety-certified components; they can be identified by the -safety infix in their names (e.g., vdev-foo-safety.so). Your QNX representative can guide you in the certification process for your own custom vdevs.