vdev_register_factory()

Add a virtual device factory to the list of available virtual device factories

Synopsis:

#include <qvm/vdev-core.h>
void vdev_register_factory(struct vdev_factory *factory,
                           unsigned abi_version)

Arguments:

factory
The virtual device factory structure to be added. This structure must have a static lifetime.
abi_version
The ABI version, checked against QVM_VDEV_ABI.

Library:

Provided by qvm; no external library is required.

Description:

This function is usually called by the routines constructing the vdev, typically when the vdev is loaded by a function with __attribute__((constructor)).

When you call this function, you pass a pointer to the vdev_factory. structure. This is the only time in your vdev's life cycle that you will pass this pointer.