vdev_factory_flags

Flags controlling vdev creation

Synopsis:

#include <qvm/vdev-core.h>
enum vdev_factory_flags {
    VFF_NONE = 0x0000,
    VFF_RESERVED = 0x0001,
    VFF_INTR_NO = 0x0002,
    VFF_INTR_REQ = 0x0004,
    VFF_INTR_NONPCI = 0x0008,
    VFF_LOC_NO = 0x0010,
    VFF_VDEV_MEM = 0x0020,
    VFF_VDEV_X86_IO = 0x0040,
    VFF_VDEV_PCI = 0x0080,
    VFF_VDEV_LOC_TYPES = (VFF_VDEV_MEM|VFF_VDEV_X86_IO|VFF_VDEV_PCI),
    VFF_MUTEX = 0x0100,
    VFF_MUTEX_RECURSIVE = 0x0200,
    VFF_RC = 0x0400,
    VFF_MANUAL_REGION = 0x0800
};

Data:

VFF_NONE

No flags specified.

VFF_RESERVED

Reserved for internal use.

VFF_INTR_NO

The intr option isn't allowed

VFF_INTR_REQ

The intr option is required.

VFF_INTR_NONPCI

The intr option is required for non-PCI devices.

VFF_LOC_NO

The loc option isn't allowed.

VFF_VDEV_MEM

The vdev is allowed to be a mem: device. The loc option can be mem

VFF_VDEV_X86_IO

The vdev is allowed to be an io: device on an x86 hardware platform.

VFF_VDEV_PCI

The vdev is allowed to be a PCI device.

VFF_VDEV_LOC_TYPES

Set of allowed location types. For internal use.

VFF_MUTEX

The device needs a mutex.

VFF_MUTEX_RECURSIVE

The mutex must be recursive

VFF_RC

The vdev can be remotely controlled Reserved for future use.

VFF_MANUAL_REGION

The vdev handles the region creation; the qvm process will not automatically create the region. If this isn't specified, the qvm process instance automatically creates the region when it finishes creating the vdev.

Library:

Provided by qvm; no external library is required.

Description:

These flags are used for the vdev_factory factory_flags member.

The two mutex flags cause the qvm process to initialize the vdev_t structure's v_mtx member. If you need a recursive mutex, then you must specify both BOTH VFF_MUTEX and VFF_MUTEX_RECURSIVE.

There are four states for interrupts. You can set any of the three bits: VFF_INTR_NO, VFF_INTR_REQ or VFF_INTR_NONPCI. If you don't set any of these three bits is set, then you can have the interrupt automatically assigned in VDEV_CTRL_ASSIGN.

Similarly, You can assign any of the three bits: VFF_VDEV_MEM, VFF_VDEV_X86_IO or VFF_VDEV_PCI. If you don't set any of these three bits is set, then you can have the location automatically assigned in VDEV_CTRL_ASSIGN. If the location flags are set, then the hosting qvm process instance checks that the assigned location is of the specifed type.

If a location is assigned but no location type is specifed, then the hosting qvm process instance checks assumes the default location type and checks that the assigned location is of this type. Note that you can use VDEV_CTRL_ASSIGN only if you don't assign the location.