Collapse All
Virtuozzo Virtualization SDK C API Reference
ContentsIndex
PreviousUpNext
PrlSrv_AttachToLostTask Function
PHT_SERVER

The PrlSrv_AttachToLostTask function allows to obtain a handle to a running task after the connection to the Virtuozzo Service was lost.

Syntax
PRL_HANDLE PrlSrv_AttachToLostTask(
    PRL_HANDLE hServer, 
    PRL_CONST_STR sTaskId
);
File

PrlApiDisp.h

Parameters

hServer
A handle of type PHT_SERVER identifying the Virtuozzo Service.
sTaskId
The ID of the task to get a job handle for.

Returns

A handle of type PHT_JOB containing the results of this asynchronous operation, or PRL_INVALID_HANDLE if there's not enough memory to instantiate the job object. The returned PHT_JOB object will be attached to the specified task. 

 

Remarks

If you've started a long asynchronous operation and then lost a connection with the Virtuozzo Service, you may use this function to get a handle to the task after reconnecting to the Virtuozzo Service. In order to do that, log in to the Virtuozzo Service using the PrlSrv_Login or the PrlSrv_LoginLocal function passing the UUID of the session that you've lost. The returned PHT_LOGIN_RESPONSE object will contain the list of the tasks that belong to the lost session and are still running. Select a task that you want to get a handle to and pass its ID to the PrlSrv_AttachToLostTask function. The function will return a handle of type PHT_JOB which you may use to continue controlling and monitoring the task as usual. 

To get the return code from the PHT_JOB object, use the PrlJob_GetRetCode function. Possible values are: 

PRL_ERR_INVALID_ARG - invalid handle or null pointer was passed. 

PRL_ERR_SUCCESS - function completed successfully. 

Links
Copyright ©2016-2017 Parallels International GmbH. All rights reserved.