summaryrefslogtreecommitdiff
path: root/src/esx/esx_util.c
Commit message (Collapse)AuthorAgeFilesLines
...
* esx: Parse the path of the URIMatthias Bolte2010-08-021-39/+65
| | | | | The path will be used to specify the datacenter, compute resource and host system to be used with a vpx:// connection.
* esx: Use bool instead of int where appropriatedMatthias Bolte2010-06-241-5/+5
|
* esx: Add proxy query parameterMatthias Bolte2010-06-091-0/+57
| | | | Allow to specify a proxy to be used by libcurl.
* esx: Refactor esxUtil_ParseQuery's parameter handlingMatthias Bolte2010-06-091-50/+50
| | | | | Pass a struct containing the parameters instead of passing each one individually. This make future extensions a bit simpler.
* esx: Simplify goto usageMatthias Bolte2010-05-271-38/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Eliminate almost all backward jumps by replacing this common pattern: int some_random_function(void) { int result = 0; ... cleanup: <unconditional cleanup code> return result; failure: <cleanup code in case of an error> result = -1; goto cleanup } with this simpler pattern: int some_random_function(void) { int result = -1; ... result = 0; cleanup: if (result < 0) { <cleanup code in case of an error> } <unconditional cleanup code> return result; } Add a bool success variable in functions that don't have a int result that can be used for the new pattern. Also remove some unnecessary memsets in error paths.
* build: update gnulibEric Blake2010-05-111-6/+0
| | | | | | | | * .gnulib: Update to latest. * bootstrap.conf (gnulib_modules): Import netdb. * src/esx/esx_util.c (AI_ADDRCONFIG): Rely on gnulib. * src/remote/remote_driver.c (AI_ADDRCONFIG): Likewise. * tools/virsh.c (WEXITSTATUS, O_SYNC): Likewise.
* esx: Replace scanf with STRSKIP and strtok_rMatthias Bolte2010-04-151-26/+27
| | | | | | This also fixes a portability problem with the %a format modifier. %a is not portable and made esxDomainDumpXML fail at runtime in MinGW builds.
* esx: Mark error messages for translationMatthias Bolte2010-04-061-34/+30
| | | | | | | | | 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.
* esx: Cleanup file header commentsMatthias Bolte2010-03-231-1/+1
| | | | Replace 'method' with 'function' and get the filename's suffix right.
* esx: Move username and password helper functions to authhelper.cMatthias Bolte2010-03-161-83/+0
|
* build: consistently use C99 varargs macrosEric Blake2010-03-081-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to this patch, there was an inconsistent mix between GNU and C99. For consistency, and potential portability to other compilers, stick with the C99 vararg macro syntax. * src/conf/cpu_conf.c (virCPUReportError): Use C99 rather than GNU vararg macro syntax. * src/conf/domain_conf.c (virDomainReportError): Likewise. * src/conf/domain_event.c (eventReportError): Likewise. * src/conf/interface_conf.c (virInterfaceReportError): Likewise. * src/conf/network_conf.c (virNetworkReportError): Likewise. * src/conf/node_device_conf.h (virNodeDeviceReportError): Likewise. * src/conf/secret_conf.h (virSecretReportError): Likewise. * src/conf/storage_conf.h (virStorageReportError): Likewise. * src/esx/esx_device_monitor.c (ESX_ERROR): Use C99 rather than GNU vararg macro syntax. * src/esx/esx_driver.c (ESX_ERROR): Likewise. * src/esx/esx_interface_driver.c (ESX_ERROR): Likewise. * src/esx/esx_network_driver.c (ESX_ERROR): Likewise. * src/esx/esx_secret_driver.c (ESX_ERROR): Likewise. * src/esx/esx_storage_driver.c (ESX_ERROR): Likewise. * src/esx/esx_util.c (ESX_ERROR): Likewise. * src/esx/esx_vi.c (ESX_VI_ERROR): Likewise. * src/esx/esx_vi_methods.c (ESX_VI_ERROR): Likewise. * src/esx/esx_vi_types.c (ESX_VI_ERROR): Likewise. * src/esx/esx_vmx.c (ESX_ERROR): Likewise. * src/util/hostusb.c (usbReportError): Use C99 rather than GNU vararg macro syntax. * src/util/json.c (virJSONError): Likewise. * src/util/macvtap.c (ReportError): Likewise. * src/util/pci.c (pciReportError): Likewise. * src/util/stats_linux.c (virStatsError): Likewise. * src/util/util.c (virUtilError): Likewise. * src/util/xml.c (virXMLError): Likewise. * src/xen/proxy_internal.c (virProxyError): Use C99 rather than GNU vararg macro syntax. * src/xen/sexpr.c (virSexprError): Likewise. * src/xen/xen_driver.c (xenUnifiedError): Likewise. * src/xen/xen_hypervisor.c (virXenError): Likewise. * src/xen/xen_inotify.c (virXenInotifyError): Likewise. * src/xen/xend_internal.c (virXendError): Likewise. * src/xen/xm_internal.c (xenXMError): Likewise. * src/xen/xs_internal.c (virXenStoreError): Likewise. * src/cpu/cpu.h (virCPUReportError): Use C99 rather than GNU vararg macro syntax. * src/datatypes.c (virLibConnError): Likewise. * src/interface/netcf_driver.c (interfaceReportError): Likewise. * src/libvirt.c (virLibStreamError): Likewise. * src/lxc/lxc_conf.h (lxcError): Likewise. * src/network/bridge_driver.c (networkReportError): Likewise. * src/nodeinfo.c (nodeReportError): Likewise. * src/opennebula/one_conf.h (oneError): Likewise. * src/openvz/openvz_conf.h (openvzError): Likewise. * src/phyp/phyp_driver.c (PHYP_ERROR): Likewise. * src/qemu/qemu_conf.h (qemuReportError): Likewise. * src/remote/remote_driver.c (errorf): Likewise. * src/security/security_driver.h (virSecurityReportError): Likewise. * src/test/test_driver.c (testError): Likewise. * src/uml/uml_conf.h (umlReportError): Likewise. * src/vbox/vbox_driver.c (vboxError): Likewise. * src/vbox/vbox_tmpl.c (vboxError): Likewise.
* Remove conn parameter from virReportOOMErrorMatthias Bolte2010-02-091-5/+5
|
* esx: Stop passing around virConnectPtr for error reportingMatthias Bolte2010-01-261-47/+45
|
* esx: Add automatic question handlingMatthias Bolte2009-12-181-1/+21
| | | | | | | | | | | | | | 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
* esx_util.c: avoid NULL deref for invalid inputsJim Meyering2009-12-161-1/+1
| | | | | | * src/esx/esx_util.c (esxUtil_ParseDatastoreRelatedPath): Return right away for invalid inputs, rather than using them (which would dereference NULL pointers) in clean-up code.
* ESX replace esxUtil_EqualSuffix() with virFileHasSuffix()Matthias Bolte2009-09-231-14/+0
| | | | | | * src/esx/esx_util.[ch]: remove esxUtil_EqualSuffix() * src/esx/esx_driver.c, src/esx/esx_vmx.c: replace esxUtil_EqualSuffix() with virFileHasSuffix()
* ESX add esxDomainDefineXML()Matthias Bolte2009-09-231-0/+83
| | | | | | | | | | | | | | | | | | | | | | | | 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
* ESX Whitespace cleanupMatthias Bolte2009-09-231-6/+6
|
* ESX Set challenge for auth callback to hostnameMatthias Bolte2009-09-231-6/+6
| | | | | | | This enables the auth callback to automatically distinguish between requests for ESX host and vCenter credentials. * src/esx/esx_util.[ch]: set challenge for auth callback to hostname
* ESX raise error if UUID parse failedMatthias Bolte2009-09-041-1/+5
| | | | | * src/esx/esx_util.c: let esxUtil_GetConfigUUID() report an error if virUUIDParse() fails
* VMware ESX: Don't warn on some query parameterMatthias Bolte2009-09-021-4/+16
| | | | | | * src/esx/esx_util.c: esxUtil_ParseQuery() warns if a known query parameter should be ignored due to the corresponding char/int pointer being NULL, instead of silently ignoring it. Fix the control flow.
* Cleanup structure name namingMatthias Bolte2009-08-061-14/+14
| | | | | * src/esx/esx_driver.c src/esx/esx_util.[ch] src/esx/esx_vi.[ch]: just a name change
* Enable ESX driver build on Mingw32Daniel P. Berrange2009-07-311-4/+8
| | | | | | | | * autobuild.sh, mingw32-libvirt.spec.in: Enable esx on mingw32 * src/esx/esx_driver.c: Define AI_ADDRCONFIG if not set * src/esx/esx_util.c, src/esx/esx_vi_types.c: Always use %lld & friends, since gnulib guarentees we have these and not the target's own variants
* Add no_verify query parameter to ESX URIsMatthias Bolte2009-07-271-1/+11
| | | | | | | * 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.
* First version of the driver for VMWare ESXMatthias Bolte2009-07-231-0/+488
* 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