This simple vdev illustrates how to implement basic vdev functionality.
Show how a vdev works (i.e., the Hello world! vdev)
vdev trace options
In addition to the common options defined in the qvm process (see Common vdev options in the User's Guide), the trace vdev supports the following options:
Note that the loc option may only be set to mem (see Defining the vdev in the factory structure in this chapter, and Common vdev options in the User's Guide).
ARM and x86. This vdev makes available to a guest a 32-bit location in its guest-physical memory. The guest can read from or write to this location; when it does so:
This vdev also creates a thread that increments the value in the 32-bit location every second. When the guest reads from this location it will see that the value at the location has increased.
To use this vdev, you must include it like other vdevs in the build for your hypervisor host; for example, in your host buildfile you might have something like the following:
... vdev-smmu.so vdev-trace.so vdev-8259.so vdev-hpet.so ...
You must also include the vdev and its configuration in the configuration for the VM where it will be used; for example:
vdev trace loc 0xfa000000 emit-logger emit-trace 12
where vdev trace specifies the vdev, loc 0xfa000000 specifies its guest-physical address, emit-logger instructs the vdev to emit to logger, emit-trace instructs the vdev to emit trace events, and 12 is the number to use for these events.
The loc option tells the qvm process where to put the device when it is assembling the VM that will host the guest (see Common vdev options in the User's Guide).
Note that, just as with physical devices: