Registers a function callback with workload partition (WPAR) kernel services. Callback functions are subsequently performed when specific WPAR conditions occur.
Item | Description |
---|---|
hooktype | Identifies the form of the hookp pointer. |
hookp | A pointer to a memory location that might contain function pointers or other structure elements that are interpreted depending on the supplied hooktype value. |
Hook Types
The hooktype parameter is supplied on input to the kwpar_reghook return and describes the form of the second parameter. The supported hook types are as follows:
Item | Description |
---|---|
WPAR_NOTIFY_HOOK | Identifies the form of the hookp parameter as being of type wpar_config_hook_t. |
The wpar_config_hook_t structure contains the following fields:
Item | Description |
---|---|
uint current_hiwater | On output from the kwpar_reghook service, this field contains the current upper number of WPARs that have become active on this boot instance of AIX® 5.1. WPAR IDs are allocated in numeric order. Kernel subsystems that want to size internal components according to the number of active WPARs must register a WPAR_NOTIFY_HOOK hook type and examine the current_hiwater value for existing WPARs during registration. Future WPAR activation after hook registration calls the specified configp function within the wpar_config_hook_t element. See the WPARSTART flags later in this section for a further description of the WPAR activation. |
wpar_config_func_t configp | On input, this field contains a pointer to a callback routine that is invoked by the WPAR kernel services during the activation and the deactivation of workload partitions within the AIX 5.1 kernel. |
The syntax for the wpar_config_func_t is as follows:
#include <sys/wpar.h>
typedef int * wpar_config_func_t ( flags, cid, corralp, unused)
int flags;
cid_t cid;
struct corral * corralp;
void * unused;
The parameters are as follows:
Item | Description |
---|---|
flags | Information regarding the type of condition that is occurring within the workload partition. |
cid | The ID for the workload partition experiencing the condition. |
corralp | A pointer to a kernel copy of the corral structure that might have been supplied from the user space at the start of the condition processing. |
unused | Currently unused and must be set to NULL. It might be expanded to contain additional information in later revisions of this API. |
The flags parameter can have the following potential values:
Item | Description |
---|---|
WPARSTART | Signifies that the WPAR is undergoing activation. The callout to registered routines occurs before any other kernel subsystem processing occurs. Kernel components registering and desiring to see the WPAR activation are informed that a new WPAR with the cid parameter set is going to enter the AIX 5.1 kernel system. |
WPARSTOP | Signifies that the WPAR has undergone deactivation. The callout to registered routines occurs after all other kernel subsystem processing occurs. Kernel components registering and desiring to see the WPAR deactivation are informed that an existing WPAR with the cid parameter set has now left the AIX 5.1 kernel system. |
The kwpar_reghook kernel service provides a mechanism for other kernel services to register callbacks and retrieve information when certain workload partition conditions occur.
The kwpar_reghook kernel service can be called from the process environment only.
If the kwpar_reghook kernel service is successful, it returns a registration key that can subsequently be used with the kwpar_unreghook kernel service. If the kernel service fails, it returns a numeric value equivalent to the BADREGKEY definition found in the wparid.h file.
The kwpar_reghook kernel service fails if no space remains to record additional registration hook.