Generate almost all SOAP method mapping code.
Update the driver code to use the complete paramater list of some methods
that had parameters skipped before.
Improve the ESX_VI__METHOD marco to do automatic output deserialization
based on output occurrence. Also incorporate automatic _this binding and
output pointer check.
Fix invalid code generating in esx_vi_generator.py regarding deep copy
types that contain enum properties.
Add strptime and timegm to bootstrap.conf. Both are used to convert a
xsd:dateTime to calendar time.
Add a testcase of the xsd:dateTime conversion.
Also define ESX_ERROR and ESX_VI_ERROR in a central place, instead of
defining them in each source file.
Add ESX_ERROR and ESX_VI_ERROR to the msg_gen_function list in cfg.mk.
Update po/POTFILES.in accordingly.
The Python script generates the mappings based on the type descriptions
in the esx_vi_generator.input file.
This also improves the inheritance handling and allows to get rid of the
ugly, inflexible, and error prone _base/_super approach. Now every struct
that represents a SOAP type contains a _type member, that allows to
recreate C++-like dynamic dispatch for "method" calls in C.
If esxVI_String_DeepCopyValue or esxVI_SelectionSpec_AppendToList fail
then selectionSpec would leak. Add a free call in the failure path to
fix the leak.
This is actually a consequence of the reworked required parameter
checking: Unify the required parameter check into a Validate function
instead of doing it separately im the (de)serialization part.
The required parameter checking for the mapped methods parameter was
done in the (de)serialize functions before. Now it's explicitly done
in the mapped method itself.
Currently only the faultcode and faultstring are deserialized, the
detail part is ignored. The implementation of many new SOAP types
would be necessary to deserialize the detail part correctly. As an
intermediate solution the raw response is dumped to the debug log.
The data passed to the callback is not guaranteed to be zero terminated,
take care of that by coping the data and adding a zero terminator.
Also dump the data for other types than CURLINFO_TEXT.
Set CURLOPT_VERBOSE to 1 so the debug callback is called when enabled.
Questions can block tasks, to handle them automatically the driver can answers
them with the default answer. The auto_answer query parameter allows to enable
this automatic question handling.
* src/esx/README: add a detailed explanation for automatic question handling
* src/esx/esx_driver.c: add automatic question handling for all task related
driver functions
* src/esx/esx_util.[ch]: add handling for the auto_answer query parameter
* src/esx/esx_vi.[ch], src/esx/esx_vi_methods.[ch], src/esx/esx_vi_types.[ch]:
add new VI API methods and types and additional helper functions for
automatic question handling
* src/esx/esx_vi.c (esxVI_List_CastFromAnyType): For invalid
inputs, fail right away. Do not "goto failure" where a NULL
input pointer would be dereferenced.
Replace free(virBufferContentAndReset()) with virBufferFreeAndReset().
Update documentation and replace all remaining calls to free() with
calls to VIR_FREE(). Also add missing calls to virBufferFreeAndReset()
and virReportOOMError() in OOM error cases.
If an error occurs between the allocation of an item and appending it
to the list, the item leaks. Free such orphaned items in error cases.
* src/esx/esx_vi.c: free orphaned items in error cases
The default transport for the VI API is HTTPS. If the server redirects
from HTTPS to HTTP the driver would silently follow that redirection.
The user assumes to communicate with the server over a secure transport
but isn't.
This patch disables automatical redirection following. The driver reports
an error if the server tries to redirect.
* src/esx/esx_vi.c: refactor the call to curl_easy_perform() into a
function and do error handling there, disable automatical redirection
following for curl
* src/esx/esx_vi.h: change the type of responseCode to int
Unified function naming scheme:
- 'lookup' functions query the ESX or vCenter for information
- 'get' functions return information from a local object
* src/esx/esx_driver.c, src/esx/esx_vi.[ch]: unify function naming
An inaccessible datastore has no valid URL property so don't
access its URI property.
* src/esx/esx_vi.c: esxVI_LookupDatastoreByName(): check if datastore is
accessible before accessing its URL property
* src/esx/esx_vmx.c: update to changed datastore properties
A given domain XML gets converted to a VMX config, uploaded to the host
and registered as new virtual machine.
* src/esx/esx_driver.c: refactor datastore related path parsing into
esxUtil_ParseDatastoreRelatedPath()
* src/esx/esx_util.[ch]: add esxUtil_ParseDatastoreRelatedPath()
* src/esx/esx_vi.[ch]: add esxVI_Context_UploadFile(), add datastores to
the traversal in esxVI_BuildFullTraversalSpecList(), add
esxVI_LookupDatastoreByName()
* src/esx/esx_vi_methods.[ch]: add esxVI_RegisterVM_Task()
* src/esx/esx_vi_types.c: make some error message more verbose
* src/esx/esx_vmx.[ch]: add esxVMX_AbsolutePathToDatastoreRelatedPath()
to convert a path into a datastore related path, add esxVMX_ParseFileName()
to convert from VMX path format to domain XML path format, extend the other
parsing function to be datastore aware, add esxVMX_FormatFileName() to
convert from domain XML path format to VMX path format, fix VMX ethernet
entry formating
* tests/esxutilstest.c: add test for esxUtil_ParseDatastoreRelatedPath()
* tests/vmx2xmldata/*: update domain XML files to use datastore related paths
* tests/xml2vmxdata/*: update domain XML files to use datastore related paths,
update VMX files to use absolute paths
Add esxVI_Occurence enum to describe expected occurence of items
* src/esx/esx_driver.c: update the use of esxVI_LookupVirtualMachineByUuid()
* src/esx/esx_vi.c: add an esxVI_Occurence parameter to
esxVI_LookupVirtualMachineByUuid() and take care if esxVI_FindByUuid()
can't find anything for a given uuid
* src/esx/esx_vi.h: add esxVI_Occurence enum
* src/esx/esx_vi_methods.c: expect null or more items to be returned
from esxVI_FindByUuid()
* src/esx/esx_driver.c: add esxSupportsLongMode() and update esxCapsInit()
* src/esx/esx_vi.[ch]: Add AnyType handling for lists
* src/esx/esx_vi_types.c: bind VI type HostCpuIdInfo
* src/esx/esx_driver.c: add esxNodeGetFreeMemory(), cache IP address
* src/esx/esx_vi.[ch]: refactor resource pool query into esxVI_GetResourcePool()
* src/esx/esx_vi_types.[ch]: bind VI type ResourcePoolResourceUsage
* src/esx/esx_vi.[ch]: convert esxVI_RemoteRequest_Execute() to a
simpler esxVI_Context_Execute() version, remove esxVI_RemoteRequest
and convert esxVI_RemoteResponse to esxVI_Response
* src/esx/esx_vi_methods.c: update and simplify callers to use
esxVI_Context_Execute() instead of esxVI_RemoteRequest_Execute()
* src/esx/esx_vi.[ch]: use virXPathNode*() in
esxVI_RemoteRequest_Execute() and remove
esxVI_RemoteResponse_DeserializeXPathObject*()
* src/esx/esx_vi_methods.c: update callers to use the new syntax of
esxVI_RemoteRequest_Execute()
* src/esx/esx_driver.c: add configStatus to the requested properties
to check it in esxVI_GetVirtualMachineIdentity()
* src/esx/esx_vi.[ch]: add esxVI_GetManagedEntityStatus()
and use it in esxVI_GetVirtualMachineIdentity()
* src/esx/esx_vi_types.[ch]: add VI type esxVI_ManagedEntityStatus
* src/esx/esx_driver.c: handle spaces in VMX file path and use a
virBuffer to encode spaces correctly in the resulting URL
* src/esx/esx_vi.c: include the URL in the error message in case
of a download error
* src/esx/esx_driver.c src/esx/esx_vi.[ch] src/esx/esx_vmx.[ch]:
adds version checking for GSX 2.0, allows to pass a specific port
for the connection and also add a new specific gsx scheme for
easier connections to GSX hosts
* src/esx/esx_driver.c src/esx/esx_vi.c src/esx/esx_vi.h
src/esx/esx_vmx.c src/esx/esx_vmx.h: extend the VI API version checks
to accept version 4.0 and takes care of the virtualHW.version change
from 4 to 7.
* src/esx/esx_driver.c src/esx/esx_util.c src/esx/esx_util.h
src/esx/esx_vi.c src/esx/esx_vi.h: adds a no_verify query parameter to
stop libcurl from verifying theserver certificate for the https
transport.
* src/esx/esx_*.[ch]: the driver, uses a remote minimal SOAP client
to talk to the VI services on ESX nodes.
* configure.in include/libvirt/virterror.h src/Makefile.am src/driver.h
src/libvirt.c src/virterror.c: glue in the new driver