svcadm(8)을 검색하려면 섹션에서 8 을 선택하고, 맨 페이지 이름에 svcadm을 입력하고 검색을 누른다.
v12n(3ext)
Extended Library Functions v12n(3EXT)
NAME
v12n, v12n_get_current_env, v12n_get_env_name, v12n_get_env_prop,
v12n_get_prop_name, v12n_get_parent_env, v12n_list_env_props,
v12n_list_envs, v12n_list_supported_envs, v12n_capabilities,
v12n_domain_roles, v12n_domain_name, v12n_domain_uuid,
v12n_ctrl_domain, v12n_chassis_serialno - return virtualization envi‐
ronment domain parameters
SYNOPSIS
cc [ flag... ] file... -lv12n [ library... ]
#include <libv12n.h>
v12n_env_t *v12n_get_current_env(void);
v12n_env_t *v12n_get_parent_env(void);
char *v12n_get_env_prop(v12n_env_t *environment, v12n_prop_t property);
v12n_env_t **v12n_list_supported_envs(void);
v12n_env_t **v12n_list_envs(v12n_class_t);
v12n_prop_t *v12n_list_env_props(v12n_env_t *environment);
const char *v12n_get_prop_name(v12n_prop_t property);
void v12n_free_env(v12n_env_t *environment)
v12n_env_t *v12n_copy_env(v12n_env_t *environment)
DESCRIPTION
v12n_env_t is an opaque type. The supported functions, return values,
and errors are described below:
v12n_get_current_env() Returns the current environment. See below
for the list of possible environment names.
v12n_get_parent_env() Returns the parent environment. Currently,
the parent environment can only be detected
from a non-global zone. See below for the
list of possible environment names.
v12n_get_env_prop() Returns a string representation of a
requested property for a given environment.
The returned string must be freed by the
caller.
v12n_list_supported_envs() Fills out a NULL-terminated array with all
supported environments. The array and its
contents must be freed by the caller. NULL
is returned on error.
v12n_list_envs() Fills out a NULL-terminated array with all
known environments in the given class. The
array and its contents must be freed by the
caller. NULL is returned on error.
v12n_list_env_props() Fills out a NULL-terminated array with all
known property types for the given environ‐
ment. The array must be freed by the call‐
er. NULL is returned on error.
v12n_get_prop_name() Returns a string representation of a vir‐
tual environment property.
v12n_free_env() Frees the storage associated with an
v12n_env_t.
v12n_copy_env() Copies the supplied v12n_env_t. A new
v12n_env_t is returned.
CLASSES
libv12n knows about the following classes.
tab(); lw(NaNi) lw(NaNi) lw(NaNi) lw(NaNi) TypeName V12N_CLASS_CURRENT
current V12N_CLASS_PARENT parent V12N_CLASS_SUPPORTED supported
V12N_CLASS_UNSUPPORTED unsupported
ENVIRONMENTS
libv12n knows about the following environments. As some are SPARC or
x86 specific, they may not be available on both platforms.
tab(); lw(1.83i) lw(1.83i) lw(1.83i) lw(1.83i) lw(1.83i) lw(1.83i)
TypeNamePlatform _ UnknownunknownBoth Kernel-based Virtual
Machinekvmx86 Logical Domainslogical-domainSPARC Non-Global Zonenon-
global-zoneBoth Kernel Zonekernel-zoneBoth VMwarevmwarex86 Virtual‐
Boxvirtualboxx86 Xenxenx86
PROPERTIES
libv12n knows about the following properties. Properties depend both on
the class as well as the name of the environment.
tab(); lw(1.83i) lw(1.83i) lw(1.83i) lw(1.83i) lw(1.83i) lw(1.83i)
TypeClassName _ V12N_PROP_NAME(all)name V12N_PROP_CLASS(all)class
V12N_PROP_STATUSunsupportedstatus V12N_PROP_LDOMS_CHASSIScurrentchas‐
sis-serial-number V12N_PROP_LDOMS_CONTROL_NAMEcurrentcontrol-name
V12N_PROP_LDOMS_NAMEcurrentdomain-name V12N_PROP_LDOMS_ROLE_CONTROLcur‐
rentcontrol-role V12N_PROP_LDOMS_ROLE_IOcurrentio-role
V12N_PROP_LDOMS_ROLE_ROOTcurrentroot-role V12N_PROP_LDOMS_ROLE_SERVICE‐
currentservice-role V12N_PROP_LDOMS_UUIDcurrentuuid V12N_PROP_KZ_ZONE‐
NAMEcurrentzonename V12N_PROP_KZ_HOST_COMPAT_LVLSsupportedhost-compati‐
ble-levels
LEGACY
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);
The v12n_capabilities() function returns the virtualization capabili‐
ties mask of the current domain. The virtualization capabilities bit
mask consists of the following values:
tab(); lw(2.29i) lw(3.21i) lw(2.29i) lw(3.21i) ValueDescription _
V12N_CAP_SUPPORTEDT{ Virtualization is supported on this domain. T}
V12N_CAP_ENABLEDT{ Virtualization is enabled on this domain. T}
V12N_CAP_IMPL_LDOMST{ Logical Domains is the supported virtualization
implementation. T}
The v12n_domain_roles() function returns the virtualization domain role
mask. The virtualization domain role mask consists of the following
values:
tab(); lw(2.29i) lw(3.21i) lw(2.29i) lw(3.21i) ValueDescription _
V12N_ROLE_CONTROLT{ 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 current domain is a guest domain. T}
V12N_ROLE_IOCurrent domain is an I/O domain. V12N_ROLE_SERVICECurrent
domain is a service domain. V12N_ROLE_ROOTCurrent domain is a 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_get_current_env(), v12n_get_par‐
ent_env() and v12n_copy_env() functions return an opaque pointer to a
v12n_env_t representing an environment. Otherwise, the v12n_get_cur‐
rent_env() function returns NULL and sets errno to indicate the error.
On successful completion, the v12n_get_env_prop() returns a string
holding the property value. the v12n_get_current_env() function returns
NULL and sets errno to indicate the error.
On successful completion, the v12n_list_supported_envs(),
v12n_list_envs(), and v12n_list_env_props() functions return an array.
Otherwise, these functions return NULL and sets errno to indicate the
error.
On successful completion, the v12n_capabilities() 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_get_current_env() and v12n_get_parent_env() functions fail if:
ENOMEM Insufficient memory to complete the operation.
EACCES The calling process has insufficient privilege for accessing
device configuration data (x86 only).
ENXIO The devinfo(4D) driver is not installed properly (x86 only).
The v12n_list_supported_envs() function will fail if:
ENOMEM Insufficient memory to complete the operation.
The v12n_get_env_prop() function will fail if:
EINVAL The specified environment or property does not exist.
ENOMEM Insufficient memory to complete the operation.
For the logical domain properties:
V12N_PROP_LDOMS_CHASSIS
See v12n_chassis_serialno()
V12N_PROP_LDOMS_CONTROL_NAME
See v12n_ctrl_domain()
V12N_PROP_LDOMS_NAME
See v12n_domain_name()
V12N_PROP_LDOMS_ROLE_CONTROL
See v12n_domain_roles()
V12N_PROP_LDOMS_ROLE_IO
See v12n_domain_roles()
V12N_PROP_LDOMS_ROLE_ROOT
See v12n_domain_roles()
V12N_PROP_LDOMS_ROLE_SERVICE
See v12n_domain_roles()
V12N_PROP_LDOMS_UUID
See v12n_domain_uuid()
The v12n_list_envs(), v12n_list_env_props(), and v12n_get_prop_name()
functions will fail if:
ENOMEM Insufficient memory to complete the operation.
ENOENT The specified value does not exist.
The v12n_copy_env() function will fail if:
ENOMEM Insufficient memory to complete the operation.
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(7) for descriptions of the following attributes:
tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE TYPEAT‐
TRIBUTE VALUE _ Availabilitysystem/library/libv12n _ Interface Stabili‐
tyCommitted _ MT-LevelMT-Safe
SEE ALSO
libuuid(3LIB), libv12n(3LIB), attributes(7), virtinfo(8)
Oracle Solaris 11.4 27 Nov 2017 v12n(3EXT)