}
def = esxVMX_ParseConfig(priv->host, vmx, datastoreName, directoryName,
- priv->host->apiVersion);
+ priv->host->productVersion);
if (def != NULL) {
xml = virDomainDefFormat(def, flags);
}
def = esxVMX_ParseConfig(priv->host, nativeConfig, "?", "?",
- priv->host->apiVersion);
+ priv->host->productVersion);
if (def != NULL) {
xml = virDomainDefFormat(def, VIR_DOMAIN_XML_INACTIVE);
return NULL;
}
- vmx = esxVMX_FormatConfig(priv->host, def, priv->host->apiVersion);
+ vmx = esxVMX_FormatConfig(priv->host, def, priv->host->productVersion);
virDomainDefFree(def);
}
/* Build VMX from domain XML */
- vmx = esxVMX_FormatConfig(priv->host, def, priv->host->apiVersion);
+ vmx = esxVMX_FormatConfig(priv->host, def, priv->host->productVersion);
if (vmx == NULL) {
goto failure;
virDomainDefPtr
esxVMX_ParseConfig(esxVI_Context *ctx, const char *vmx,
const char *datastoreName, const char *directoryName,
- esxVI_APIVersion apiVersion)
+ esxVI_ProductVersion productVersion)
{
virConfPtr conf = NULL;
virDomainDefPtr def = NULL;
goto failure;
}
- switch (apiVersion) {
- case esxVI_APIVersion_25:
+ /*
+ * virtualHW.version compatibility matrix:
+ *
+ * 4 7 API
+ * ESX 3.5 + 2.5
+ * ESX 4.0 + + 4.0
+ * GSX 2.0 + + 2.5
+ */
+ switch (productVersion) {
+ case esxVI_ProductVersion_ESX35:
if (virtualHW_version != 4) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Expecting VMX entry 'virtualHW.version' to be 4 for "
- "VI API version 2.5 but found %lld"),
+ _("Expecting VMX entry 'virtualHW.version' to be 4 "
+ "but found %lld"),
virtualHW_version);
goto failure;
}
break;
- case esxVI_APIVersion_40:
+ case esxVI_ProductVersion_GSX20:
+ case esxVI_ProductVersion_ESX40:
if (virtualHW_version != 4 && virtualHW_version != 7) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
_("Expecting VMX entry 'virtualHW.version' to be 4 or 7 "
- "for VI API version 4.0 but found %lld"),
+ "but found %lld"),
virtualHW_version);
goto failure;
}
break;
- case esxVI_APIVersion_Unknown:
- if (virtualHW_version != 4 && virtualHW_version != 7) {
- ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Expecting VMX entry 'virtualHW.version' to be 4 or 7 "
- "but found %lld"), virtualHW_version);
- goto failure;
- }
-
- break;
-
default:
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Expecting VI API version 2.5 or 4.0"));
+ _("Unexpected product version"));
goto failure;
}
char *
esxVMX_FormatConfig(esxVI_Context *ctx, virDomainDefPtr def,
- esxVI_APIVersion apiVersion)
+ esxVI_ProductVersion productVersion)
{
int i;
int sched_cpu_affinity_length;
virBufferAddLit(&buffer, "config.version = \"8\"\n");
/* vmx:virtualHW.version */
- switch (apiVersion) {
- case esxVI_APIVersion_25:
+ switch (productVersion) {
+ case esxVI_ProductVersion_ESX35:
virBufferAddLit(&buffer, "virtualHW.version = \"4\"\n");
break;
- case esxVI_APIVersion_40:
+ case esxVI_ProductVersion_GSX20:
+ case esxVI_ProductVersion_ESX40:
virBufferAddLit(&buffer, "virtualHW.version = \"7\"\n");
break;
default:
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Expecting VI API version 2.5 or 4.0"));
+ _("Unexpected product version"));
goto failure;
}
virDomainDefPtr
esxVMX_ParseConfig(esxVI_Context *ctx, const char *vmx,
const char *datastoreName, const char *directoryName,
- esxVI_APIVersion apiVersion);
+ esxVI_ProductVersion productVersion);
int
esxVMX_ParseVNC(virConfPtr conf, virDomainGraphicsDefPtr *def);
char *
esxVMX_FormatConfig(esxVI_Context *ctx, virDomainDefPtr def,
- esxVI_APIVersion apiVersion);
+ esxVI_ProductVersion productVersion);
int
esxVMX_FormatVNC(virDomainGraphicsDefPtr def, virBufferPtr buffer);
# define MAX_FILE 4096
static int
-testCompareFiles(const char *vmx, const char *xml, esxVI_APIVersion apiVersion)
+testCompareFiles(const char *vmx, const char *xml,
+ esxVI_ProductVersion productVersion)
{
int result = -1;
char vmxData[MAX_FILE];
}
def = esxVMX_ParseConfig(NULL, vmxData, "datastore", "directory",
- apiVersion);
+ productVersion);
if (def == NULL) {
err = virGetLastError();
struct testInfo {
const char *input;
const char *output;
- esxVI_APIVersion version;
+ esxVI_ProductVersion version;
};
static int
return EXIT_FAILURE;
}
-# define DO_TEST(_in, _out, _version) \
+# define DO_TEST(_in, _out, _version) \
do { \
struct testInfo info = { _in, _out, _version }; \
virResetLastError(); \
} \
} while (0)
- DO_TEST("case-insensitive-1", "case-insensitive-1", esxVI_APIVersion_25);
- DO_TEST("case-insensitive-2", "case-insensitive-2", esxVI_APIVersion_25);
+ DO_TEST("case-insensitive-1", "case-insensitive-1", esxVI_ProductVersion_ESX35);
+ DO_TEST("case-insensitive-2", "case-insensitive-2", esxVI_ProductVersion_ESX35);
- DO_TEST("minimal", "minimal", esxVI_APIVersion_25);
- DO_TEST("minimal-64bit", "minimal-64bit", esxVI_APIVersion_25);
+ DO_TEST("minimal", "minimal", esxVI_ProductVersion_ESX35);
+ DO_TEST("minimal-64bit", "minimal-64bit", esxVI_ProductVersion_ESX35);
- DO_TEST("graphics-vnc", "graphics-vnc", esxVI_APIVersion_25);
+ DO_TEST("graphics-vnc", "graphics-vnc", esxVI_ProductVersion_ESX35);
- DO_TEST("scsi-driver", "scsi-driver", esxVI_APIVersion_25);
- DO_TEST("scsi-writethrough", "scsi-writethrough", esxVI_APIVersion_25);
+ DO_TEST("scsi-driver", "scsi-driver", esxVI_ProductVersion_ESX35);
+ DO_TEST("scsi-writethrough", "scsi-writethrough", esxVI_ProductVersion_ESX35);
- DO_TEST("harddisk-scsi-file", "harddisk-scsi-file", esxVI_APIVersion_25);
- DO_TEST("harddisk-ide-file", "harddisk-ide-file", esxVI_APIVersion_25);
+ DO_TEST("harddisk-scsi-file", "harddisk-scsi-file", esxVI_ProductVersion_ESX35);
+ DO_TEST("harddisk-ide-file", "harddisk-ide-file", esxVI_ProductVersion_ESX35);
- DO_TEST("cdrom-scsi-file", "cdrom-scsi-file", esxVI_APIVersion_25);
- DO_TEST("cdrom-scsi-device", "cdrom-scsi-device", esxVI_APIVersion_25);
- DO_TEST("cdrom-ide-file", "cdrom-ide-file", esxVI_APIVersion_25);
- DO_TEST("cdrom-ide-device", "cdrom-ide-device", esxVI_APIVersion_25);
+ DO_TEST("cdrom-scsi-file", "cdrom-scsi-file", esxVI_ProductVersion_ESX35);
+ DO_TEST("cdrom-scsi-device", "cdrom-scsi-device", esxVI_ProductVersion_ESX35);
+ DO_TEST("cdrom-ide-file", "cdrom-ide-file", esxVI_ProductVersion_ESX35);
+ DO_TEST("cdrom-ide-device", "cdrom-ide-device", esxVI_ProductVersion_ESX35);
- DO_TEST("floppy-file", "floppy-file", esxVI_APIVersion_25);
- DO_TEST("floppy-device", "floppy-device", esxVI_APIVersion_25);
+ DO_TEST("floppy-file", "floppy-file", esxVI_ProductVersion_ESX35);
+ DO_TEST("floppy-device", "floppy-device", esxVI_ProductVersion_ESX35);
- DO_TEST("ethernet-e1000", "ethernet-e1000", esxVI_APIVersion_25);
- DO_TEST("ethernet-vmxnet2", "ethernet-vmxnet2", esxVI_APIVersion_25);
+ DO_TEST("ethernet-e1000", "ethernet-e1000", esxVI_ProductVersion_ESX35);
+ DO_TEST("ethernet-vmxnet2", "ethernet-vmxnet2", esxVI_ProductVersion_ESX35);
- DO_TEST("ethernet-custom", "ethernet-custom", esxVI_APIVersion_25);
- DO_TEST("ethernet-bridged", "ethernet-bridged", esxVI_APIVersion_25);
+ DO_TEST("ethernet-custom", "ethernet-custom", esxVI_ProductVersion_ESX35);
+ DO_TEST("ethernet-bridged", "ethernet-bridged", esxVI_ProductVersion_ESX35);
- DO_TEST("ethernet-generated", "ethernet-generated", esxVI_APIVersion_25);
- DO_TEST("ethernet-static", "ethernet-static", esxVI_APIVersion_25);
- DO_TEST("ethernet-vpx", "ethernet-vpx", esxVI_APIVersion_25);
- DO_TEST("ethernet-other", "ethernet-other", esxVI_APIVersion_25);
+ DO_TEST("ethernet-generated", "ethernet-generated", esxVI_ProductVersion_ESX35);
+ DO_TEST("ethernet-static", "ethernet-static", esxVI_ProductVersion_ESX35);
+ DO_TEST("ethernet-vpx", "ethernet-vpx", esxVI_ProductVersion_ESX35);
+ DO_TEST("ethernet-other", "ethernet-other", esxVI_ProductVersion_ESX35);
- DO_TEST("serial-file", "serial-file", esxVI_APIVersion_25);
- DO_TEST("serial-device", "serial-device", esxVI_APIVersion_25);
- DO_TEST("serial-pipe-client-app", "serial-pipe", esxVI_APIVersion_25);
- DO_TEST("serial-pipe-server-vm", "serial-pipe", esxVI_APIVersion_25);
- DO_TEST("serial-pipe-client-app", "serial-pipe", esxVI_APIVersion_25);
- DO_TEST("serial-pipe-server-vm", "serial-pipe", esxVI_APIVersion_25);
+ DO_TEST("serial-file", "serial-file", esxVI_ProductVersion_ESX35);
+ DO_TEST("serial-device", "serial-device", esxVI_ProductVersion_ESX35);
+ DO_TEST("serial-pipe-client-app", "serial-pipe", esxVI_ProductVersion_ESX35);
+ DO_TEST("serial-pipe-server-vm", "serial-pipe", esxVI_ProductVersion_ESX35);
+ DO_TEST("serial-pipe-client-app", "serial-pipe", esxVI_ProductVersion_ESX35);
+ DO_TEST("serial-pipe-server-vm", "serial-pipe", esxVI_ProductVersion_ESX35);
- DO_TEST("parallel-file", "parallel-file", esxVI_APIVersion_25);
- DO_TEST("parallel-device", "parallel-device", esxVI_APIVersion_25);
+ DO_TEST("parallel-file", "parallel-file", esxVI_ProductVersion_ESX35);
+ DO_TEST("parallel-device", "parallel-device", esxVI_ProductVersion_ESX35);
- DO_TEST("esx-in-the-wild-1", "esx-in-the-wild-1", esxVI_APIVersion_25);
- DO_TEST("esx-in-the-wild-2", "esx-in-the-wild-2", esxVI_APIVersion_25);
- DO_TEST("esx-in-the-wild-3", "esx-in-the-wild-3", esxVI_APIVersion_25);
- DO_TEST("esx-in-the-wild-4", "esx-in-the-wild-4", esxVI_APIVersion_25);
+ DO_TEST("esx-in-the-wild-1", "esx-in-the-wild-1", esxVI_ProductVersion_ESX35);
+ DO_TEST("esx-in-the-wild-2", "esx-in-the-wild-2", esxVI_ProductVersion_ESX35);
+ DO_TEST("esx-in-the-wild-3", "esx-in-the-wild-3", esxVI_ProductVersion_ESX35);
+ DO_TEST("esx-in-the-wild-4", "esx-in-the-wild-4", esxVI_ProductVersion_ESX35);
- DO_TEST("gsx-in-the-wild-1", "gsx-in-the-wild-1", esxVI_APIVersion_25);
- DO_TEST("gsx-in-the-wild-2", "gsx-in-the-wild-2", esxVI_APIVersion_25);
- DO_TEST("gsx-in-the-wild-3", "gsx-in-the-wild-3", esxVI_APIVersion_25);
- DO_TEST("gsx-in-the-wild-4", "gsx-in-the-wild-4", esxVI_APIVersion_25);
+ DO_TEST("gsx-in-the-wild-1", "gsx-in-the-wild-1", esxVI_ProductVersion_ESX35);
+ DO_TEST("gsx-in-the-wild-2", "gsx-in-the-wild-2", esxVI_ProductVersion_ESX35);
+ DO_TEST("gsx-in-the-wild-3", "gsx-in-the-wild-3", esxVI_ProductVersion_ESX35);
+ DO_TEST("gsx-in-the-wild-4", "gsx-in-the-wild-4", esxVI_ProductVersion_ESX35);
return result == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
}
static int
-testCompareFiles(const char *xml, const char *vmx, esxVI_APIVersion apiVersion)
+testCompareFiles(const char *xml, const char *vmx,
+ esxVI_ProductVersion productVersion)
{
int result = -1;
char xmlData[MAX_FILE];
goto failure;
}
- formatted = esxVMX_FormatConfig(NULL, def, apiVersion);
+ formatted = esxVMX_FormatConfig(NULL, def, productVersion);
if (formatted == NULL) {
goto failure;
struct testInfo {
const char *input;
const char *output;
- esxVI_APIVersion version;
+ esxVI_ProductVersion version;
};
static int
return EXIT_FAILURE;
}
- DO_TEST("minimal", "minimal", esxVI_APIVersion_25);
- DO_TEST("minimal-64bit", "minimal-64bit", esxVI_APIVersion_25);
+ DO_TEST("minimal", "minimal", esxVI_ProductVersion_ESX35);
+ DO_TEST("minimal-64bit", "minimal-64bit", esxVI_ProductVersion_ESX35);
- DO_TEST("graphics-vnc", "graphics-vnc", esxVI_APIVersion_25);
+ DO_TEST("graphics-vnc", "graphics-vnc", esxVI_ProductVersion_ESX35);
- DO_TEST("scsi-driver", "scsi-driver", esxVI_APIVersion_25);
- DO_TEST("scsi-writethrough", "scsi-writethrough", esxVI_APIVersion_25);
+ DO_TEST("scsi-driver", "scsi-driver", esxVI_ProductVersion_ESX35);
+ DO_TEST("scsi-writethrough", "scsi-writethrough", esxVI_ProductVersion_ESX35);
- DO_TEST("harddisk-scsi-file", "harddisk-scsi-file", esxVI_APIVersion_25);
- DO_TEST("harddisk-ide-file", "harddisk-ide-file", esxVI_APIVersion_25);
+ DO_TEST("harddisk-scsi-file", "harddisk-scsi-file", esxVI_ProductVersion_ESX35);
+ DO_TEST("harddisk-ide-file", "harddisk-ide-file", esxVI_ProductVersion_ESX35);
- DO_TEST("cdrom-scsi-file", "cdrom-scsi-file", esxVI_APIVersion_25);
- DO_TEST("cdrom-scsi-device", "cdrom-scsi-device", esxVI_APIVersion_25);
- DO_TEST("cdrom-ide-file", "cdrom-ide-file", esxVI_APIVersion_25);
- DO_TEST("cdrom-ide-device", "cdrom-ide-device", esxVI_APIVersion_25);
+ DO_TEST("cdrom-scsi-file", "cdrom-scsi-file", esxVI_ProductVersion_ESX35);
+ DO_TEST("cdrom-scsi-device", "cdrom-scsi-device", esxVI_ProductVersion_ESX35);
+ DO_TEST("cdrom-ide-file", "cdrom-ide-file", esxVI_ProductVersion_ESX35);
+ DO_TEST("cdrom-ide-device", "cdrom-ide-device", esxVI_ProductVersion_ESX35);
- DO_TEST("floppy-file", "floppy-file", esxVI_APIVersion_25);
- DO_TEST("floppy-device", "floppy-device", esxVI_APIVersion_25);
+ DO_TEST("floppy-file", "floppy-file", esxVI_ProductVersion_ESX35);
+ DO_TEST("floppy-device", "floppy-device", esxVI_ProductVersion_ESX35);
- DO_TEST("ethernet-e1000", "ethernet-e1000", esxVI_APIVersion_25);
- DO_TEST("ethernet-vmxnet2", "ethernet-vmxnet2", esxVI_APIVersion_25);
+ DO_TEST("ethernet-e1000", "ethernet-e1000", esxVI_ProductVersion_ESX35);
+ DO_TEST("ethernet-vmxnet2", "ethernet-vmxnet2", esxVI_ProductVersion_ESX35);
- DO_TEST("ethernet-custom", "ethernet-custom", esxVI_APIVersion_25);
- DO_TEST("ethernet-bridged", "ethernet-bridged", esxVI_APIVersion_25);
+ DO_TEST("ethernet-custom", "ethernet-custom", esxVI_ProductVersion_ESX35);
+ DO_TEST("ethernet-bridged", "ethernet-bridged", esxVI_ProductVersion_ESX35);
- DO_TEST("ethernet-generated", "ethernet-generated", esxVI_APIVersion_25);
- DO_TEST("ethernet-static", "ethernet-static", esxVI_APIVersion_25);
- DO_TEST("ethernet-vpx", "ethernet-vpx", esxVI_APIVersion_25);
- DO_TEST("ethernet-other", "ethernet-other", esxVI_APIVersion_25);
+ DO_TEST("ethernet-generated", "ethernet-generated", esxVI_ProductVersion_ESX35);
+ DO_TEST("ethernet-static", "ethernet-static", esxVI_ProductVersion_ESX35);
+ DO_TEST("ethernet-vpx", "ethernet-vpx", esxVI_ProductVersion_ESX35);
+ DO_TEST("ethernet-other", "ethernet-other", esxVI_ProductVersion_ESX35);
- DO_TEST("serial-file", "serial-file", esxVI_APIVersion_25);
- DO_TEST("serial-device", "serial-device", esxVI_APIVersion_25);
- DO_TEST("serial-pipe", "serial-pipe", esxVI_APIVersion_25);
+ DO_TEST("serial-file", "serial-file", esxVI_ProductVersion_ESX35);
+ DO_TEST("serial-device", "serial-device", esxVI_ProductVersion_ESX35);
+ DO_TEST("serial-pipe", "serial-pipe", esxVI_ProductVersion_ESX35);
- DO_TEST("parallel-file", "parallel-file", esxVI_APIVersion_25);
- DO_TEST("parallel-device", "parallel-device", esxVI_APIVersion_25);
+ DO_TEST("parallel-file", "parallel-file", esxVI_ProductVersion_ESX35);
+ DO_TEST("parallel-device", "parallel-device", esxVI_ProductVersion_ESX35);
- DO_TEST("esx-in-the-wild-1", "esx-in-the-wild-1", esxVI_APIVersion_25);
- DO_TEST("esx-in-the-wild-2", "esx-in-the-wild-2", esxVI_APIVersion_25);
- DO_TEST("esx-in-the-wild-3", "esx-in-the-wild-3", esxVI_APIVersion_25);
- DO_TEST("esx-in-the-wild-4", "esx-in-the-wild-4", esxVI_APIVersion_25);
+ DO_TEST("esx-in-the-wild-1", "esx-in-the-wild-1", esxVI_ProductVersion_ESX35);
+ DO_TEST("esx-in-the-wild-2", "esx-in-the-wild-2", esxVI_ProductVersion_ESX35);
+ DO_TEST("esx-in-the-wild-3", "esx-in-the-wild-3", esxVI_ProductVersion_ESX35);
+ DO_TEST("esx-in-the-wild-4", "esx-in-the-wild-4", esxVI_ProductVersion_ESX35);
- DO_TEST("gsx-in-the-wild-1", "gsx-in-the-wild-1", esxVI_APIVersion_25);
- DO_TEST("gsx-in-the-wild-2", "gsx-in-the-wild-2", esxVI_APIVersion_25);
- DO_TEST("gsx-in-the-wild-3", "gsx-in-the-wild-3", esxVI_APIVersion_25);
- DO_TEST("gsx-in-the-wild-4", "gsx-in-the-wild-4", esxVI_APIVersion_25);
+ DO_TEST("gsx-in-the-wild-1", "gsx-in-the-wild-1", esxVI_ProductVersion_ESX35);
+ DO_TEST("gsx-in-the-wild-2", "gsx-in-the-wild-2", esxVI_ProductVersion_ESX35);
+ DO_TEST("gsx-in-the-wild-3", "gsx-in-the-wild-3", esxVI_ProductVersion_ESX35);
+ DO_TEST("gsx-in-the-wild-4", "gsx-in-the-wild-4", esxVI_ProductVersion_ESX35);
virCapabilitiesFree(caps);