int controller;
int bus;
int port;
- int present; // boolean
+ bool present;
int scsi_virtualDev[4] = { -1, -1, -1, -1 };
int unit;
/* vmx:config.version */
if (esxUtil_GetConfigLong(conf, "config.version", &config_version, 0,
- 0) < 0) {
+ false) < 0) {
goto cleanup;
}
/* vmx:virtualHW.version */
if (esxUtil_GetConfigLong(conf, "virtualHW.version", &virtualHW_version, 0,
- 0) < 0) {
+ false) < 0) {
goto cleanup;
}
/* vmx:uuid.bios -> def:uuid */
/* FIXME: Need to handle 'uuid.action = "create"' */
- if (esxUtil_GetConfigUUID(conf, "uuid.bios", def->uuid, 1) < 0) {
+ if (esxUtil_GetConfigUUID(conf, "uuid.bios", def->uuid, true) < 0) {
goto cleanup;
}
/* vmx:displayName -> def:name */
- if (esxUtil_GetConfigString(conf, "displayName", &def->name, 1) < 0) {
+ if (esxUtil_GetConfigString(conf, "displayName", &def->name, true) < 0) {
goto cleanup;
}
/* vmx:memsize -> def:maxmem */
- if (esxUtil_GetConfigLong(conf, "memsize", &memsize, 32, 1) < 0) {
+ if (esxUtil_GetConfigLong(conf, "memsize", &memsize, 32, true) < 0) {
goto cleanup;
}
def->maxmem = memsize * 1024; /* Scale from megabytes to kilobytes */
/* vmx:sched.mem.max -> def:memory */
- if (esxUtil_GetConfigLong(conf, "sched.mem.max", &memory, memsize, 1) < 0) {
+ if (esxUtil_GetConfigLong(conf, "sched.mem.max", &memory, memsize,
+ true) < 0) {
goto cleanup;
}
}
/* vmx:numvcpus -> def:vcpus */
- if (esxUtil_GetConfigLong(conf, "numvcpus", &numvcpus, 1, 1) < 0) {
+ if (esxUtil_GetConfigLong(conf, "numvcpus", &numvcpus, 1, true) < 0) {
goto cleanup;
}
/* vmx:sched.cpu.affinity -> def:cpumask */
// VirtualMachine:config.cpuAffinity.affinitySet
if (esxUtil_GetConfigString(conf, "sched.cpu.affinity", &sched_cpu_affinity,
- 1) < 0) {
+ true) < 0) {
goto cleanup;
}
}
/* vmx:guestOS -> def:os.arch */
- if (esxUtil_GetConfigString(conf, "guestOS", &guestOS, 1) < 0) {
+ if (esxUtil_GetConfigString(conf, "guestOS", &guestOS, true) < 0) {
goto cleanup;
}
int
esxVMX_ParseVNC(virConfPtr conf, virDomainGraphicsDefPtr *def)
{
- int enabled = 0; // boolean
+ bool enabled = false;
long long port = 0;
if (def == NULL || *def != NULL) {
}
if (esxUtil_GetConfigBoolean(conf, "RemoteDisplay.vnc.enabled", &enabled,
- 0, 1) < 0) {
+ false, true) < 0) {
return -1;
}
(*def)->type = VIR_DOMAIN_GRAPHICS_TYPE_VNC;
if (esxUtil_GetConfigLong(conf, "RemoteDisplay.vnc.port", &port, -1,
- 1) < 0 ||
+ true) < 0 ||
esxUtil_GetConfigString(conf, "RemoteDisplay.vnc.ip",
- &(*def)->data.vnc.listenAddr, 1) < 0 ||
+ &(*def)->data.vnc.listenAddr, true) < 0 ||
esxUtil_GetConfigString(conf, "RemoteDisplay.vnc.keymap",
- &(*def)->data.vnc.keymap, 1) < 0 ||
+ &(*def)->data.vnc.keymap, true) < 0 ||
esxUtil_GetConfigString(conf, "RemoteDisplay.vnc.password",
- &(*def)->data.vnc.passwd, 1) < 0) {
+ &(*def)->data.vnc.passwd, true) < 0) {
goto failure;
}
int
-esxVMX_ParseSCSIController(virConfPtr conf, int controller, int *present,
+esxVMX_ParseSCSIController(virConfPtr conf, int controller, bool *present,
int *virtualDev)
{
char present_name[32];
snprintf(virtualDev_name, sizeof(virtualDev_name), "scsi%d.virtualDev",
controller);
- if (esxUtil_GetConfigBoolean(conf, present_name, present, 0, 1) < 0) {
+ if (esxUtil_GetConfigBoolean(conf, present_name, present, false,
+ true) < 0) {
goto failure;
}
}
if (esxUtil_GetConfigString(conf, virtualDev_name, &virtualDev_string,
- 1) < 0) {
+ true) < 0) {
goto failure;
}
char *prefix = NULL;
char present_name[32] = "";
- int present = 0;
+ bool present = false;
char startConnected_name[32] = "";
- int startConnected = 0;
+ bool startConnected = false;
char deviceType_name[32] = "";
char *deviceType = NULL;
char clientDevice_name[32] = "";
- int clientDevice = 0;
+ bool clientDevice = false;
char fileType_name[32] = "";
char *fileType = NULL;
char *fileName = NULL;
char writeThrough_name[32] = "";
- int writeThrough = 0;
+ bool writeThrough = false;
if (def == NULL || *def != NULL) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
ESX_BUILD_VMX_NAME(writeThrough);
/* vmx:present */
- if (esxUtil_GetConfigBoolean(conf, present_name, &present, 0, 1) < 0) {
+ if (esxUtil_GetConfigBoolean(conf, present_name, &present, false,
+ true) < 0) {
goto cleanup;
}
/* vmx:startConnected */
if (esxUtil_GetConfigBoolean(conf, startConnected_name, &startConnected,
- 1, 1) < 0) {
+ true, true) < 0) {
goto cleanup;
}
}
/* vmx:deviceType -> def:type */
- if (esxUtil_GetConfigString(conf, deviceType_name, &deviceType, 1) < 0) {
+ if (esxUtil_GetConfigString(conf, deviceType_name, &deviceType, true) < 0) {
goto cleanup;
}
/* vmx:clientDevice */
- if (esxUtil_GetConfigBoolean(conf, clientDevice_name, &clientDevice, 0,
- 1) < 0) {
+ if (esxUtil_GetConfigBoolean(conf, clientDevice_name, &clientDevice, false,
+ true) < 0) {
goto cleanup;
}
}
/* vmx:fileType -> def:type */
- if (esxUtil_GetConfigString(conf, fileType_name, &fileType, 1) < 0) {
+ if (esxUtil_GetConfigString(conf, fileType_name, &fileType, true) < 0) {
goto cleanup;
}
/* vmx:fileName -> def:src, def:type */
- if (esxUtil_GetConfigString(conf, fileName_name, &fileName, 0) < 0) {
+ if (esxUtil_GetConfigString(conf, fileName_name, &fileName, false) < 0) {
goto cleanup;
}
/* vmx:writeThrough -> def:cachemode */
- if (esxUtil_GetConfigBoolean(conf, writeThrough_name, &writeThrough, 0,
- 1) < 0) {
+ if (esxUtil_GetConfigBoolean(conf, writeThrough_name, &writeThrough, false,
+ true) < 0) {
goto cleanup;
}
char prefix[48] = "";
char present_name[48] = "";
- int present = 0;
+ bool present = false;
char startConnected_name[48] = "";
- int startConnected = 0;
+ bool startConnected = false;
char connectionType_name[48] = "";
char *connectionType = NULL;
ESX_BUILD_VMX_NAME(vnet);
/* vmx:present */
- if (esxUtil_GetConfigBoolean(conf, present_name, &present, 0, 1) < 0) {
+ if (esxUtil_GetConfigBoolean(conf, present_name, &present, false,
+ true) < 0) {
goto cleanup;
}
/* vmx:startConnected */
- if (esxUtil_GetConfigBoolean(conf, startConnected_name, &startConnected, 1,
- 1) < 0) {
+ if (esxUtil_GetConfigBoolean(conf, startConnected_name, &startConnected,
+ true, true) < 0) {
goto cleanup;
}
/* vmx:connectionType -> def:type */
if (esxUtil_GetConfigString(conf, connectionType_name, &connectionType,
- 1) < 0) {
+ true) < 0) {
goto cleanup;
}
/* vmx:addressType, vmx:generatedAddress, vmx:address -> def:mac */
- if (esxUtil_GetConfigString(conf, addressType_name, &addressType, 1) < 0 ||
+ if (esxUtil_GetConfigString(conf, addressType_name, &addressType,
+ true) < 0 ||
esxUtil_GetConfigString(conf, generatedAddress_name, &generatedAddress,
- 1) < 0 ||
- esxUtil_GetConfigString(conf, address_name, &address, 1) < 0) {
+ true) < 0 ||
+ esxUtil_GetConfigString(conf, address_name, &address, true) < 0) {
goto cleanup;
}
}
/* vmx:virtualDev, vmx:features -> def:model */
- if (esxUtil_GetConfigString(conf, virtualDev_name, &virtualDev, 1) < 0 ||
- esxUtil_GetConfigLong(conf, features_name, &features, 0, 1) < 0) {
+ if (esxUtil_GetConfigString(conf, virtualDev_name, &virtualDev, true) < 0 ||
+ esxUtil_GetConfigLong(conf, features_name, &features, 0, true) < 0) {
goto cleanup;
}
if ((connectionType == NULL ||
STRCASEEQ(connectionType, "bridged") ||
STRCASEEQ(connectionType, "custom")) &&
- esxUtil_GetConfigString(conf, networkName_name, &networkName, 0) < 0) {
+ esxUtil_GetConfigString(conf, networkName_name, &networkName,
+ false) < 0) {
goto cleanup;
}
/* vmx:vnet -> def:data.ifname */
if (connectionType != NULL && STRCASEEQ(connectionType, "custom") &&
- esxUtil_GetConfigString(conf, vnet_name, &vnet, 0) < 0) {
+ esxUtil_GetConfigString(conf, vnet_name, &vnet, false) < 0) {
goto cleanup;
}
char prefix[48] = "";
char present_name[48] = "";
- int present = 0;
+ bool present = false;
char startConnected_name[48] = "";
- int startConnected = 0;
+ bool startConnected = false;
char fileType_name[48] = "";
char *fileType = NULL;
ESX_BUILD_VMX_NAME(fileName);
/* vmx:present */
- if (esxUtil_GetConfigBoolean(conf, present_name, &present, 0, 1) < 0) {
+ if (esxUtil_GetConfigBoolean(conf, present_name, &present, false,
+ true) < 0) {
goto cleanup;
}
/* vmx:startConnected */
- if (esxUtil_GetConfigBoolean(conf, startConnected_name, &startConnected, 1,
- 1) < 0) {
+ if (esxUtil_GetConfigBoolean(conf, startConnected_name, &startConnected,
+ true, true) < 0) {
goto cleanup;
}
}
/* vmx:fileType -> def:type */
- if (esxUtil_GetConfigString(conf, fileType_name, &fileType, 0) < 0) {
+ if (esxUtil_GetConfigString(conf, fileType_name, &fileType, false) < 0) {
goto cleanup;
}
/* vmx:fileName -> def:data.file.path */
- if (esxUtil_GetConfigString(conf, fileName_name, &fileName, 0) < 0) {
+ if (esxUtil_GetConfigString(conf, fileName_name, &fileName, false) < 0) {
goto cleanup;
}
char prefix[48] = "";
char present_name[48] = "";
- int present = 0;
+ bool present = false;
char startConnected_name[48] = "";
- int startConnected = 0;
+ bool startConnected = false;
char fileType_name[48] = "";
char *fileType = NULL;
ESX_BUILD_VMX_NAME(fileName);
/* vmx:present */
- if (esxUtil_GetConfigBoolean(conf, present_name, &present, 0, 1) < 0) {
+ if (esxUtil_GetConfigBoolean(conf, present_name, &present, false,
+ true) < 0) {
goto cleanup;
}
/* vmx:startConnected */
- if (esxUtil_GetConfigBoolean(conf, startConnected_name, &startConnected, 1,
- 1) < 0) {
+ if (esxUtil_GetConfigBoolean(conf, startConnected_name, &startConnected,
+ true, true) < 0) {
goto cleanup;
}
}
/* vmx:fileType -> def:type */
- if (esxUtil_GetConfigString(conf, fileType_name, &fileType, 0) < 0) {
+ if (esxUtil_GetConfigString(conf, fileType_name, &fileType, false) < 0) {
goto cleanup;
}
/* vmx:fileName -> def:data.file.path */
- if (esxUtil_GetConfigString(conf, fileName_name, &fileName, 0) < 0) {
+ if (esxUtil_GetConfigString(conf, fileName_name, &fileName, false) < 0) {
goto cleanup;
}