Name

VixHost_Disconnect

Description

void
VixHost_Disconnect(VixHandle hostHandle);

Destroys the state for a particular host handle.

Parameters

handle
The host handle returned by VixHost_Connect().

Return Value

None.

Remarks

Call this function to disconnect the host. After you call this function the handle is no longer valid and you should not use it in any Vix function. Similarly, you should not use any handles obtained from the host while it was connected.

Side Effects

None.

Requirements

vix.h, since VMware Server 1.0

Example

int main()
{
   VixHandle hostHandle = VIX_INVALID_HANDLE;
   VixHandle jobHandle = VIX_INVALID_HANDLE;
   VixError err;
   jobHandle = VixHost_Connect(VIX_API_VERSION,
                               VIX_SERVICEPROVIDER_VMWARE_VI_SERVER,
                               "https://viserver/sdk", // hostName
                               0, // hostPort
                               "Administrator", // userName
                               "adminpass", // password,
                               0, // options
                               VIX_INVALID_HANDLE, // propertyListHandle
                               NULL, // callbackProc
                               NULL); // clientData
   err = VixJob_Wait(jobHandle,
                     VIX_PROPERTY_JOB_RESULT_HANDLE,
                     &hostHandle,
                     VIX_PROPERTY_NONE);
   if (VIX_OK != err) {
      // Handle the error...
   }
   Vix_ReleaseHandle(jobHandle);
   // ...Do everything in your program...
   VixHost_Disconnect(hostHandle);
   return(0);
}

Copyright (C) 2007-2010 VMware, Inc. All rights reserved.