Collapse All
Virtuozzo Virtualization SDK C API Reference
ContentsIndex
PreviousUpNext
PrlVm_GenerateVmDevFilename Function
PHT_VIRTUAL_MACHINE

Automatically generates a name for a virtual device which will be unique within a home directory of the specified virtual machine.

Syntax
PRL_HANDLE PrlVm_GenerateVmDevFilename(
    PRL_HANDLE hVm, 
    PRL_CONST_STR sFilenamePrefix, 
    PRL_CONST_STR sFilenameSuffix, 
    PRL_CONST_STR sIndexDelimiter
);
File

PrlApiVm.h

Parameters

sFilenamePrefix
A prefix to add to the name. Pass a null pointer to use a default value: "tmpfile". The name will be generated by adding a number to the prefix (e.g. tmpfile1, tmpfile2, tmpfile3, etc.)
sFilenameSuffix
A suffix to add to the name. Pass a null pointer for no suffix.
sIndexDelimiter
A character(s) that will be inserted between the prefix and the index (e.g. tmpfile_1, tmpfile_2, tmpfile_3, etc). You can specify a null pointer or an empty string if you don't want to insert any extra characters there.
hVM
A handle of type PHT_VIRTUAL_MACHINE identifying the virtual machine.

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.

Remarks

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

PRL_ERR_INVALID_ARG - invalid handle or null pointer was passed. 

PRL_ERR_NO_DATA - the home directory information is missing in the specified virtual machine object. If this is a new virtual machine, try updating the local object by calling the PrlVm_RefreshConfig or PrlSrv_GetVmList function. 

PRL_ERR_SUCCESS - function completed successfully. 

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