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.
count
The size of the location referenced by buf.
vdp
A pointer to the vdev

Library:

Provided by qvm; no external library is required.

Description:

This function builds a string with the vdev's name and block (location) information. This string can be 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, had the count been large enough. The function returns this value even if the count is zero, in which case buf may be NULL.