v12n(3EXT) Extended Library Functions v12n(3EXT)NAME
v12n, v12n_capabilities, v12n_domain_roles, v12n_domain_name,
v12n_domain_uuid, v12n_ctrl_domain, v12n_chassis_serialno - return vir‐
tualization environment domain parameters
SYNOPSIS
cc [ flag... ] file... -lv12n [ library... ]
#include <libv12n.h>
int v12n_capabilities();
int v12n_domain_roles();
int v12n_domain_uuid(uuid_t uuid);
size_t v12n_domain_name(char *buf, size_t buflen);
size_t v12n_ctrl_domain(char *buf, size_t buflen);
size_t v12n_chassis_serialno(char *buf, size_t buflen);
DESCRIPTION
The v12n_capabilities() function returns the virtualization capabili‐
ties mask of the current domain. The virtualization capabilities bit
mask consists of the following values:
V12N_CAP_SUPPORTED Virtualization is supported on this domain.
V12N_CAP_ENABLED Virtualization is enabled on this domain.
V12N_CAP_IMPL_LDOMS Logical Domains is the supported virtualization
implementation.
The v12n_domain_roles() function returns the virtualization domain role
mask. The virtualization domain role mask consists of the following
values:
V12N_ROLE_CONTROL If the virtualization implementation is Logical
Domains, and this bit is one, the current domain
is a control domain. If this bit is zero, the cur‐
rent domain is a guest domain.
V12N_ROLE_IO Current domain is an I/O domain.
V12N_ROLE_SERVICE Current domain is a service domain.
V12N_ROLE_ROOT Current domain is an root I/O domain.
The v12n_domain_uuid() function stores the universally unique identi‐
fier (UUID) for the current virtualization domain in the uuid argument.
See the libuuid(3LIB) manual page.
The v12n_domain_name() function stores the name of the current virtual‐
ization domain in the location specified by buf. buflen specifies the
size in bytes of the buffer. If the buffer is too small to hold the
complete null-terminated name, the first buflen bytes of the name are
stored in the buffer. A buffer of size V12N_NAME_MAX is sufficient to
hold any domain name. If buf is NULL or buflen is 0, the name is not
copied into the buffer.
The v12n_ctrl_domain() function stores the control domain or dom0 net‐
work node name of the current domain in the location specified by buf.
Note that a domain's control domain is volatile during a domain migra‐
tion. The information returned by this function might be stale if the
domain was in the process of migrating. buflen specifies the size in
bytes of the buffer. If the buffer is too small to hold the complete
null-terminated name, the first buflen bytes of the name are stored in
the buffer. A buffer of size V12N_NAME_MAX is sufficient to hold the
control domain node name string. If buf is NULL or buflen is 0, the
name is not copied into the buffer.
The v12n_chassis_serialno() function stores the chassis serial number
of the platform on which the current domain is running in the location
specified by buf. Note that the chassis serial number is volatile dur‐
ing a domain migration. The information returned by this function might
be stale if the domain was in the process of migrating. buflen speci‐
fies the size in bytes of the buffer. If the buffer is too small to
hold the complete null-terminated name, the first buflen bytes of the
name are stored in the buffer. A buffer of size V12N_NAME_MAX is suffi‐
cient to hold any chassis serial number string. If buf is NULL or
buflen is 0, the name is not copied into the buffer.
RETURN VALUES
On successful completion, the v12n_capabilties() and
v12n_domain_roles() functions return a non-negative bit mask. Other‐
wise, the v12n_domain_roles() function returns -1 and sets errno to
indicate the error.
On successful completion, the v12n_domain_uuid() function returns 0.
Otherwise, the v12n_domain_uuid() function returns -1 and sets errno to
indicate the error.
On successful completion, the v12n_domain_name(), v12n_ctrl_domain(),
and v12n_chassis_serialno() functions return the buffer size required
to hold the full non-terminated string. Otherwise, these functions
return -1 and set errno to indicate the error.
ERRORS
The v12n_domain_roles() function fails with EPERM when the calling
process has an ID other than the privileged user.
The v12n_domain_name() function will fail if:
EPERM The calling process has an ID other than the privileged
user.
ENOTSUP Virtualization is not supported or enabled on this domain.
EFAULT buf points to an illegal address.
ENOENT The sun4v machine description is inaccessible or has no uuid
node.
The v12n_domain_uuid() function will fail if:
EPERM The calling process has an ID other than the privileged
user.
ENOTSUP Virtualization is not supported or enabled on this domain.
EFAULT buf points to an illegal address.
ENOENT The sun4v machine description is inaccessible or has no uuid
node.
The v12n_ctrl_domain() function will fail if:
EPERM The calling process has an ID other than the privileged
user.
ENOTSUP Virtualization is not supported or enabled on this domain.
EFAULT buf points to an illegal address.
ETIME The domain service on the control domain did not respond
within the timeout value.
The v12n_chassis_serialno() function will fail if:
EPERM The calling process has an ID other than the privileged
user.
ENOTSUP Virtualization is not supported or enabled on this domain.
EFAULT buf points to an illegal address.
ETIME The domain service on the control domain did not respond
within the timeout value.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
┌─────────────────────────────┬─────────────────────────────┐
│ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
├─────────────────────────────┼─────────────────────────────┤
│Interface Stability │Committed │
├─────────────────────────────┼─────────────────────────────┤
│MT-Level │MT-Safe │
└─────────────────────────────┴─────────────────────────────┘
SEE ALSOvirtinfo(1M), libuuid(3LIB), libv12n(3LIB), attributes(5)SunOS 5.10 14 Jul 2010 v12n(3EXT)