Collapse All
Parallels C API Reference Guide
PrlSrv_CreateVm Function
PrlApi.h PHT_SERVER Example

Obtains a new handle of type PHT_VIRTUAL_MACHINE .

Syntax
PRL_RESULT PrlSrv_CreateVm(
    PRL_HANDLE hServer, 
    PRL_HANDLE_PTR phVm
);
File
Parameters

hServer
A handle of type PHT_SERVER identifying the Parallels Service.
phVm
[out] A pointer to a variable that receives the handle.
Returns

PRL_RESULT . Possible values:

PRL_ERR_INVALID_ARG - invalid handle or null pointer was passed.

PRL_ERR_SUCCESS - function completed successfully.

Remarks

Obtaining a new PHT_VIRTUAL_MACHINE handle is the first step when creating a virtual machine. The second step is setting the virtual machine configuration parameters. The final step is calling the PrlVm_Reg function, which will create a new virtual machine.

Example
// Create a new virtual machine handle
// (assumes hServer is a valid handle obtained using PrlSrv_Create,
// and a successful Parallels Service login was made using PrlSrv_Login).
PRL_HANDLE hNewVm;
ret = PrlSrv_CreateVm(hServer, &hNewVm);
if (PRL_FAILED(ret))
{
    printf("PrlSvr_CreateVm call failed with: %s.\n", PRL_RESULT_TO_STRING(ret));
    return ret;
}
printf("PrlSvr_CreateVm completed successfully.\n");
Links
Copyright © 1999-2011 Parallels Holdings, Ltd. and its affiliates. All rights reserved.
What do you think about this topic? Send feedback!