wlm_create_class Subroutine
Purpose
Creates a new Workload Manager (WLM) class.
Library
Workload Manager Library (libwlm.a)
Syntax
Description
The wlm_create_class subroutine creates a new class for a given WLM configuration using the values passed in the data structure of type struct wlm_args pointed to by wlmargs.
- If the name of a configuration is passed in the confdir field, the subroutine updates the WLM properties files for the target configuration. When creating the first subclass of a superclass, the subroutine creates a subdirectory of /etc/wlm/<confdir> with the name of the superclass and create the WLM properties files in this new directory. The newly created properties files have entries for the Default and Shared subclass automatically created in addition to entries for the new subclass.
- If a null string ('\0') is passed in the confdir field, the new superclass or subclass is created only in the in-core WLM data. No WLM properties file are updated. In that case, the new class definition is lost if WLM is stopped and restarted, or if the system reboots.
The structure of type struct class_definition, which is part of struct wlm_args, has normally been initialized with a call to wlm_init_class_definition. Once this has been done, initialize the fields of this structure which have no default value (such as the name of the new class) or for which the desired value is different from the default value. For a description of the possible values for all the class attributes and their default values, refer to the description of wlm.h in the Files Reference.
The caller must have root authority to create a superclass and must have administrator authority on a superclass to create a subclass of the superclass.
Parameter
Item | Description |
---|---|
wlmargs | Specifies the address of the struct wlm_args data structure containing the class_definition structure for the new class to be created. |
The following fields of the wlm_args structure and the embedded substructures need to be provided:
Item | Description |
---|---|
versflags | Needs to be initialized with WLM_VERSION. |
confdir | Specifies the name of the WLM configuration the new class is
to be added to. It must be either the name of a valid subdirectory
of /etc/wlm or an empty string (starting with '\0'). If the name is a valid subdirectory, the new class data is added to the given WLM configuration's class description files. If the name is a null string, no description files are updated. The new class is created and the data is passed to the kernel immediately. |
name | Specifies the name of the superclass or of the subclass to be created. If this is a subclass name, it must be of the form super_name.sub_name. There is no default for this field. |
All the other fields can be left at their default value if the user does not wish to use specific values.
Return Values
Upon successful completion, the wlm_create_class subroutine returns a value of 0. If the wlm_create_class subroutine is unsuccessful, a nonzero value is returned.
Error Codes
For a list of the possible error codes returned by the WLM API functions, see the description of the wlm.h header file.