A SERVICE OF

logo

CHAPTER 4 Operations on Virtual Machines
49
RC1
VixVM_GetRootSnapshot
Function Signature
VixError
VixVM_GetRootSnapshot(VixHandle vmHandle,
int index,
VixHandle *snapshotHandle);
Parameters
Results
VixError. Refer to Error Codes on page 91 for possible error values.
Notes
This function returns the handle of the specified snapshot belonging to the
virtual machine referenced by vmHandle.
This release of the C API can manage only a single snapshot for each virtual
machine. The value of index can only be 0.
The snapshotHandle returned by this function is reference counted. The
calling application is responsible for releasing the handle.
Example
VixError err = VIX_OK;
VixHandle hostHandle = VIX_INVALID_HANDLE;
VixHandle jobHandle = VIX_INVALID_HANDLE;
VixHandle vmHandle = VIX_INVALID_HANDLE;
VixHandle snapshotHandle = VIX_INVALID_HANDLE;
int numRootSnapshots;
int index;
jobHandle = VixHost_Connect(VIX_API_VERSION,
VIX_SERVICEPROVIDER_VMWARE_SERVER,
NULL, // hostName
0, // hostPort
NULL, // userName
NULL, // password,
vmHandle Identifies a virtual machine. Call VixVM_Open() to create a virtual
machine handle.
index Identifies a root snapshot. See below for range of values.
snapshotHandle An output parameter that receives a handle to a snapshot.