- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Vix api problems
Hi,
I am using the latest release of the vix api and I am not getting anywhere from C or from perl. I tried this on both 32 and 64 bit linux hosts and it seems like Vix_JobWait hangs forever. The example in the docs that passes NULL for hostname, username and password also need to be corrected since they result in a segfault as it seems that some code tries to do strlen on these params.
below is my code, which is pretty much out of the examples. I appreciate any tips :
int main()
{
VixError err;
// Connect to specified host.
jobHandle = VixHost_Connect(VIX_API_VERSION,
VIX_SERVICEPROVIDER_VMWARE_SERVER,
"mymachine.com", // hostName
904, // hostPort
"root", // userName
"password", // 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...
goto abort;
}
Vix_ReleaseHandle(jobHandle);
printf("\nLooking for running virtual machines");
jobHandle = VixHost_FindItems(hostHandle,
VIX_FIND_RUNNING_VMS,
VIX_INVALID_HANDLE, // searchCriteria
-1, // timeout
VixDiscoveryProc,
NULL);
VixJob_Wait(jobHandle, VIX_PROPERTY_NONE);
abort:
Vix_ReleaseHandle(jobHandle);
VixHost_Disconnect(hostHandle);
}