VixError VixDiskLib_PrepareForAccess(const VixDiskLibConnectParams *connectParams, const char *identity);
This function is used to notify the host of the virtual machine that the disks of the virtual machine will be opened. The host disables operations on the virtual machine that may be adversely affected if they are performed while the disks are open by a third party application.
This function must be called before creating a snapshot on the virtual machine or opening any disks of the virtual machine
See also VixDiskLib_EndAccess.
VixError vixError; VixDiskLibConnectParams cnxParams = {0}; cnxParams.vmName = "moRef=XXXX"; cnxParams.serverName = hostName; cnxParams.credType = VIXDISKLIB_CRED_UID; cnxParams.creds.uid.userName = userName; cnxParams.creds.uid.password = password; cnxParams.port = port; vixError = VixDiskLib_PrepareForAccess(&cnxParams, "myApp");