Commit Graph

10 Commits

Author SHA1 Message Date
Matthias Bolte
8ce9f2b161 ESX replace esxUtil_EqualSuffix() with virFileHasSuffix()
* src/esx/esx_util.[ch]: remove esxUtil_EqualSuffix()
* src/esx/esx_driver.c, src/esx/esx_vmx.c: replace esxUtil_EqualSuffix()
  with virFileHasSuffix()
2009-09-23 15:00:54 +02:00
Matthias Bolte
49faa15e4f ESX add esxDomainDefineXML()
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
2009-09-23 15:00:54 +02:00
Matthias Bolte
a1c4d7d765 ESX Add esxDomainXMLToNative()
Extend and cleanup the VMX to domain XML mapping. Add the domain XML to
VMX mapping functions.

* src/esx/esx_driver.c: add esxDomainXMLToNative()
* src/esx/esx_vmx.[ch]: add esxVMX_SCSIDiskNameToControllerAndID(),
  esxVMX_IDEDiskNameToControllerAndID(), esxVMX_FloppyDiskNameToController(),
  esxVMX_GatherSCSIControllers(), add basic handling for the VMX guestOS entry
  to distinguish between i686 and x86_64, make SCSI virtualDev VMX entry
  optional as it should be, map the VMX networkName entry to the domain XML
  interface bridge name, add basic mapping for serial devices in pipe mode,
  add several esxVMX_Format*() functions
2009-09-23 15:00:54 +02:00
Chris Lalancette
03d777f345 Introduce virStrncpy.
Add the virStrncpy function, which takes a dst string, source string,
the number of bytes to copy and the number of bytes available in the
dest string.  If the source string is too large to fit into the
destination string, including the \0 byte, then no data is copied and
the function returns NULL.  Otherwise, this function copies n bytes
from source into dst, including the \0, and returns a pointer to the
dst string.  This function is intended to replace all unsafe uses
of strncpy in the code base, since strncpy does *not* guarantee that
the buffer terminates with a \0.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2009-09-22 20:10:00 +02:00
Shahar Klein
3c80fac258 ESX add support for vmxnet3 virtual device
* src/esx/esx_vmx.c: add it to the list of accepted devices when
  parsing the Ethernet section.
2009-09-16 12:04:49 +02:00
Matthias Bolte
b6e747ec5a VMware ESX: Allow ethernet address type 'vpx'
* src/esx/esx_vmx.c: add an extra type of addressType beside 'static'
  and 'generated', 'vpx' indicates that the MAC address was generated
  by a vCenter.
2009-09-02 16:24:06 +02:00
Chris Lalancette
47919e46ab Remove unsafe strncpy from esx_vmx.c
While trying to remove uses of unsafe strncpy in the tree, I came
across a couple of usages in the ESX driver.  To my eyes, the snprintf
replacements do the same thing in less code, and are also safer.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
Tested-by: Mattias Bolte <matthias.bolte@googlemail.com>
2009-08-07 13:50:32 +02:00
Matthias Bolte
10a4e969a6 Extend the ESX URL to habdle ports and GSX
* 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
2009-08-05 10:23:59 +02:00
Matthias Bolte
84255632cb ESX driver accept VI API version 4.0
* 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.
2009-07-27 14:27:09 +02:00
Matthias Bolte
e2aeee6811 First version of the driver for VMWare ESX
* 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
2009-07-23 22:25:34 +02:00