Retrieves the characteristics of the calling partition.
#include <sys/dr.h>
int lpar_get_info (command, lparinfo, bufsize)
int command;
void *lparinfo;
size_t bufsize;
The lpar_get_info subroutine retrieves processor module information, and both LPAR and Micro-Partitioning® attributes of low-frequency use and high-frequency use. Because the low-frequency attributes, as defined in the lpar_info_format1_t structure, are static in nature, a reboot is required to effect any change. The high-frequency attributes, as defined in the lpar_info_format2_t structure, can be changed dynamically at any time either by the platform or through dynamic logical partitioning (DLPAR) procedures. The latter provides a mechanism for notifying applications of changes. The signature of this system call, its parameter types, and the order of the member fields in both the lpar_info_format1_t and lpar_info_format2_t structures are specific to the AIX® platform. If the WPAR_INFO_FORMAT command is specified, the WPAR attributes are returned in a wpar_info_format_t structure. To request processor module information, specify the PROC_MODULE_INFO command. The information is provided as an array of proc_module_info_t structures. To obtain this information, you must provide a buffer of exact length to accommodate one proc_module_info_t structure for each module type. The module count can be obtained by using the NUM_PROC_MODULE_TYPES command, and it is in the form of a uint64_t type. Processor module information is reported for the entire system. This information is available on POWER6® and later systems.
To see the complete structures of lpar_info_format1_t, lpar_info_format2_t, wpar_info_format_t, and proc_module_info_t, see the dr.h header file.
This subroutine is used by the DRM to determine whether a client partition is migration capable and MSP capable. The kernel presents these capabilities based on the presence of the hcall-vasi function set and the type of partition that is evident. If the partition is a VIOS partition, the MSP capability will be noted. Otherwise, the OS partition migration capability will be noted.
Item | Description |
---|---|
command | Specifies whether the user wants format1, format2, workload partition, or processor module details. |
lparinfo | Pointer to the user-allocated buffer that is passed in. |
bufsize | Size of the buffer that is passed in. |
Upon success, the lpar_get_info subroutine returns a value of 0. Upon failure, a value of -1 is returned, and errno is set to indicate the appropriate error.
Item | Description |
---|---|
EFAULT | Buffer size is smaller than expected. |
EINVAL | Invalid input parameter. |
ENOSYS | The hardware or the current firmware level does not support this operation. |
ENOTSUP | The platform does not support this operation. |
uint64_t module_count;
proc_module_info_t *buffer = NULL;
int rc = 0;
/* Retrieve the total count of modules on the system */
rc = lpar_get_info(NUM_PROC_MODULE_TYPES,
&module_count, sizeof(uint64_t));
if (rc)
return(1); /* Error */
/* Allocate buffer of exact size to accomodate module information */
buffer = malloc(module_count * sizeof(proc_module_info_t));
if (buffer == NULL)
return(2);
rc = lpar_get_info(PROC_MODULE_INFO, buffer, sizeof(buffer));
if (rc)
return(3); /* Error */
/* If rc is 0, then buffer contains an array of proc_module_info_t
* structures with module_count elements. For an element of
* index i:
*
* buffer[i].nsockets is the total number of sockets
* buffer[i].nchips is the number of chips per socket
* buffer[i].ncores is the number of cores per chip
*/