Definitions in vdev-core.h

Preprocessor macro definitions that specify the commands the qvm process sends to the vdev

Definitions:

#include <qvm/vdev-core.h>
#define QVM_OPTION_NO_ARG_PREFIX "0"

This value is used as a prefix to a vdev option list entry to indicate that it takes no following argument.

#define VDEV_CTRL_OPTIONS_START 0u

This value is passed to the control function to initialize vdev state. The vdev_factory structure's control callback arg argument is NULL.

#define VDEV_CTRL_OPTIONS_END 1u

This value is passed to the control function to finalize vdev state after option processing. The vdev_factory structure's control callback arg argument is NULL.

#define VDEV_CTRL_GUEST_CONFIGURED 2u

This value is passed to the control function after the VM is fully configured. The vdev_factory structure's control callback arg argument is NULL.

#define VDEV_CTRL_BOOTUP (VDEV_CTRL_GUEST_CONFIGURED)

Defined for source compatibility.

#define VDEV_CTRL_TERMINATE 3u

This value is passed to the control function to indicate that the container process is terminating. The vdev_factory structure's control callback arg argument is NULL.

#define VDEV_CTRL_STATUS 4u

This value is passed to the control function to make vdev output status information The vdev_factory structure's control callback arg argument is NULL.

#define VDEV_CTRL_GEN_ACPI 5u

This value is passed to the control function to generate ACPI information for the vdev. The vdev_factory structure's control callback arg argument is NULL.

#define VDEV_CTRL_GEN_FDT 6u

This value is passed to the control function to generate FDT information for the vdev. The vdev_factory structure's control callback arg argument should be interpreted as an integer, which identifies the root node for vdevs in the FDT.

#define VDEV_CTRL_BUTTON 7u

In a QNX hypervisor system, sending SIGTERM or SIGINT to a qvm process instance simulates the pressing of the power button.

This value is passed to the control function to simulate a request for a graceful shutdown (SIGTERM sent). The vdev_factory structure's control arg argument is NULL.

#define VDEV_CTRL_PCI_BARS 8u

This value is passed to the control function to list the base address registers (BARs) of the PCI vdev. Any positive return value means no BARs are exposed by the vdev. The opposite of a negative return value is the number of BARs exposed by the vdev (e.g., a return of -6 means the vdev has exposed 6 BARs). The vdev_factory structure's control arg argument is of type struct vpci_bar; you must provide qvm with a pointer to your vpci_bar objects. For more information, see the Virtual Device Developer's Guide.

#define VDEV_CTRL_ASSIGN 9u

This value is passed to the control function to let the vdev automatically assign resources. The argument is a bitset of vdev_ctrl_assign_flags values. This occurs after all the options have been processed.

This function's control arg argument should be interpreted as an integer, containing a bitset of vdev_ctrl_assign_flags values.

#define VDEV_CTRL_GUEST_STARTING 10u

This value is passed to the control function to indicate that the hosting qvm process instance is ready to invoke the guest run code. The vdev_factory structure's control arg argument is a pointer to the guest boot vCPU structure. This exits because a vdev can make changes to the boot environment, and hence may need to change the information needed to boot.

#define VDEV_CTRL_FIRST_OPTIDX 16u

This value is passed to the control function to handle device-specific option n when it is passed VDEV_CTRL_FIRST_OPTIDX + n If when parsing the configuration the qvm process instance encounters an option that has been specified in the option list for the vdev's vdev_factory structure, the qvm process invokes the vdev_factory structure's control function with the ctrl argument set to VDEV_CTRL_FIRST_OPTIDX + n, where is the index to the option in the vdev_factory structure's option_list array. If the option takes an argument, the vdev_factory structure's control arg argument is the next entry in the configuration.

Description:

The VDEV_CTRL_* values are used by the vdev_factory control member to specify the command that the qvm process sends to the vdev. These values determine what the control callback arg argument will be. Unless specifically stated, the return value is either 0 (zero) or an error code.

Library:

Provided by qvm; no external library is required.