lpar_set_resources Subroutine

Purpose

Modifies the calling partition's characteristics.

Library

Standard C Library (lib.c)

Syntax

#include  <sys/dr.h>
int lpar_set_resources ( lpar_resource_id,lpar_resource )
int lpar_resource_id;
void *lpar_resource;

Description

The lpar_set_resources subroutine modifies the configuration attributes (dynamic resources) on a current partition indicated by the lpar_resource_id. The pointer to a value of the dynamic resource indicated by lpar_resource_id is passed to this call in lpar_resource. This subroutine modifies one partition dynamic resource at a time. To reconfigure multiple resources, multiple calls must be made. The following resources for the calling partition can be modified:
  • Processor Entitled Capacity
  • Processor Variable Capacity Weight
  • Number of online virtual processors
  • Number of available memory in megabytes
  • I/O Entitled Memory Capacity in bytes
  • Variable Memory Capacity Weight

These resource IDs are defined in the <sys/dr.h> header file. To modify the Processor Entitled Capacity and Processor Variable Capacity Weight attributes, ensure that the current partition is an SPLPAR partition. Otherwise, an error is returned.

Note: The lpar_set_resources subroutine can only be called in a process owned by a root user or a user with the CAP_EWLM_AGENT capability. Otherwise, an error is returned.

Parameters

Item Description
lpar_resource_id Identifies the dynamic resource whose value is being changed.
lpar_resource Pointer to a new value of the dynamic resource identified by the lpar_resource_id.

Security

The lpar_set_resources subroutine can only be called in a process owned by a root user (super user) or a user with the CAP_EWLM_AGENT capability.

Return Values

Upon success, the lpar_set_resources subroutine returns a value of 0. Upon failure, a negative value is returned, and errno is set to the appropriate error.

Error Codes

Item Description
EINVAL Invalid configuration parameters.
EPERM Insufficient authority.
EEXIST Resource already exists.
EBUSY Resource is busy.
EAGAIN Resource is temporarily unavailable.
ENOMEM Resource allocation failed.
ENOTREADY Resource is not ready.
ENOTSUP Operation is not supported.
EFAULT/EIO Operation failed because of an I/O error.
EINPROGRESS Operation in progress.
ENXIO Resource is not available.
ERANGE Parameter value is out of range.
All others Internal error.