vdev_register_factory()

Add a virtual device (vdev) factory to the list of available vdev factories

Synopsis:

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

Arguments:

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

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 lifecycle that you will pass this pointer.