vdev_string()

Build a human-readable name for a vdev

Synopsis:

#include <qvm/vdev-core.h>
int vdev_string(char *buf,
                size_t count,
                const vdev_t *vdp)

Arguments:

buf
A pointer to the location where the name will be stored. You can set this argument to NULL if you want to obtain the required size of the character array.
count
The size of the location referenced by buf. You can set this argument to zero to obtain the required size of this location.
vdp
A pointer to the vdev.

Description:

This function builds a string with the vdev's name and block (location) information. This string is useful for debugging and logging when the block information has been assigned by the user. This function may not be used until the VDEV_CTRL_GUEST_CONFIGURED control function has been invoked, confirming that the VM has been fully configured.

Returns:

The number of characters that would have been written into the array, not including the terminating null character, if the count was large enough. The function returns this value even if the count is zero.