WPAR_CKPT_QUERY (Checkpoint Query) Device Driver ioctl Operation

Purpose

Queries a device driver about its checkpoint capabilities.

Syntax

#include <sys/ioctl.h>

int ioctl ( FileDescriptor, WPAR_CKPT_QUERY, Arg )
int FileDescriptor;
wpar_ckpt_resp_t * Arg;

Parameters

Item Description
FileDescriptor Open file descriptor that refers to the device being queried for the checkpoint capability.
WPAR_CKPT_QUERY The command that requests information on the device checkpoint capability.
Arg Pointer to a wpar_ckpt_resp_t structure which will contain a device driver response on the checkpoint capability upon a successful return from the ioctl call.

Description

The WPAR_CKPT_QUERY operation allows a caller to ask a device driver connected to the ioctl input file descriptor if it supports checkpoint and restart operations. If a device driver supports checkpoint and restart operations, the returned answer can describe what operations are required to accomplish a checkpoint and restart.

If the device is not checkpoint and restart capable, checkpoint-aware devices fail this ioctl request with the ENOSYS error. Non-checkpoint-aware devices fail this ioctl request as an unknown ioctl. If the device is checkpoint and restart capable, checkpoint-aware devices return success.

The arg parameter to a WPAR_CKPT_QUERY ioctl request allows the caller to receive specific information regarding how the device supports checkpoint and restart if it is capable. The caller of a WPAR_CKPT_QUERY ioctl request must supply a pointer to a structure of the wpar_ckpt_resp_t type in the arg parameter.

wpar_ckpt_resp_t structure

The wpar_ckpt_resp_t structure is supplied as the input to the WPAR_CKPT_QUERY ioctl request.

#define WPAR_CKPT_OP_MAX 5
typedef struct wpar_ckpt_resp_t {
int opcnt;
wpar_ckpt_op_top [WPAR_CKPT_OP_MAX];
}wpar_ckpt_resp_t;

The fields of the wpar_ckpt_resp_t structure are as follows:

Item Description
opcnt Returned from an WPAR_CKPT_QUERY ioctl request as the number of the wpar_ckpt_op_t sub-structures that contain return information.
wpar_ckpt_op_top A sub-structure that contains specific information on operation types that must occur on a device for it to save or restore its state correctly.

wpar_ckpt_op_t structure

The wpar_ckpt_op_t structure is a sub-structure of the wpar_ckpt_resp_t structure.

typedef struct wpar_ckpt_op_t {
int op;
int opt; /*extended options of openx*/
}wpar_ckpt_op_t;

The fields of the wpar_ckpt_op_t structure are as follows:

Item Description
op Returned from a WPAR_CKPT_QUERY ioctl request. Defined as a set of one or more operations that must be performed to successfully checkpoint and restart the device.
opt Options to supply to the openx function if the device is to be re-opened on the arrival server through the openx function.

wpar_ckpt_op_t op field

Item Description
WPAR_CKPT_OP_NULL Device requires no special handling for checkpoint and restart operations.
WPAR_CKPT_OP_REOPEN Device needs to be re-opened through the open function with the access modes applicable at checkpoint time.
WPAR_CKPT_OP_OPENX Device needs to be re-opened with the openx function. The opt field denotes the desired extension argument to the openx function.

Return Values

Upon successful completion, this operation returns a value of 0. Otherwise, it returns a value of -1 and the errno global variable is set to one of the following values:

Item Description
ENOSYS Device cannot participate in checkpoint and restart operations.
EINVAL Device does not accept the WPAR_CKPT_QUERY operation.