int
esxVI_LookupNumberOfDomainsByPowerState(esxVI_Context *ctx,
esxVI_VirtualMachinePowerState powerState,
- esxVI_Boolean inverse)
+ bool inverse)
{
bool success = false;
esxVI_String *propertyNameList = NULL;
goto cleanup;
}
- if ((inverse != esxVI_Boolean_True &&
- powerState_ == powerState) ||
- (inverse == esxVI_Boolean_True &&
- powerState_ != powerState)) {
+ if ((!inverse && powerState_ == powerState) ||
+ ( inverse && powerState_ != powerState)) {
count++;
}
} else {
esxVI_String *completePropertyNameList = NULL;
esxVI_VirtualMachineQuestionInfo *questionInfo = NULL;
esxVI_TaskInfo *pendingTaskInfoList = NULL;
- esxVI_Boolean blocked = esxVI_Boolean_Undefined;
+ bool blocked;
if (esxVI_String_DeepCopyList(&completePropertyNameList,
propertyNameList) < 0 ||
esxVI_LookupAndHandleVirtualMachineQuestion(esxVI_Context *ctx,
const unsigned char *uuid,
esxVI_Occurrence occurrence,
- bool autoAnswer,
- esxVI_Boolean *blocked)
+ bool autoAnswer, bool *blocked)
{
int result = -1;
esxVI_ObjectContent *virtualMachine = NULL;
int
esxVI_HandleVirtualMachineQuestion
(esxVI_Context *ctx, esxVI_ManagedObjectReference *virtualMachine,
- esxVI_VirtualMachineQuestionInfo *questionInfo,
- bool autoAnswer, esxVI_Boolean *blocked)
+ esxVI_VirtualMachineQuestionInfo *questionInfo, bool autoAnswer,
+ bool *blocked)
{
int result = -1;
esxVI_ElementDescription *elementDescription = NULL;
int answerIndex = 0;
char *possibleAnswers = NULL;
- if (blocked == NULL || *blocked != esxVI_Boolean_Undefined) {
+ if (blocked == NULL) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
- *blocked = esxVI_Boolean_False;
+ *blocked = false;
if (questionInfo->choice->choiceInfo != NULL) {
for (elementDescription = questionInfo->choice->choiceInfo;
"question is '%s', no possible answers"),
questionInfo->text);
- *blocked = esxVI_Boolean_True;
+ *blocked = true;
goto cleanup;
} else if (answerChoice == NULL) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
"default answer is specified"), questionInfo->text,
possibleAnswers);
- *blocked = esxVI_Boolean_True;
+ *blocked = true;
goto cleanup;
}
questionInfo->text);
}
- *blocked = esxVI_Boolean_True;
+ *blocked = true;
goto cleanup;
}
esxVI_PropertyChange *propertyChange = NULL;
esxVI_AnyType *propertyValue = NULL;
esxVI_TaskInfoState state = esxVI_TaskInfoState_Undefined;
- esxVI_Boolean blocked = esxVI_Boolean_Undefined;
+ bool blocked;
esxVI_TaskInfo *taskInfo = NULL;
if (errorMessage == NULL || *errorMessage != NULL) {
}
if (taskInfo->cancelable == esxVI_Boolean_True) {
- if (esxVI_CancelTask(ctx, task) < 0 &&
- blocked == esxVI_Boolean_True) {
+ if (esxVI_CancelTask(ctx, task) < 0 && blocked) {
VIR_ERROR(_("Cancelable task is blocked by an "
"unanswered question but cancelation "
"failed"));
}
- } else if (blocked == esxVI_Boolean_True) {
+ } else if (blocked) {
VIR_ERROR(_("Non-cancelable task is blocked by an "
"unanswered question"));
}
int esxVI_LookupNumberOfDomainsByPowerState
(esxVI_Context *ctx, esxVI_VirtualMachinePowerState powerState,
- esxVI_Boolean inverse);
+ bool inverse);
int esxVI_GetVirtualMachineIdentity(esxVI_ObjectContent *virtualMachine,
int *id, char **name, unsigned char *uuid);
int esxVI_LookupAndHandleVirtualMachineQuestion(esxVI_Context *ctx,
const unsigned char *uuid,
esxVI_Occurrence occurrence,
- bool autoAnswer,
- esxVI_Boolean *blocked);
+ bool autoAnswer, bool *blocked);
int esxVI_LookupRootSnapshotTreeList
(esxVI_Context *ctx, const unsigned char *virtualMachineUuid,
esxVI_AutoStartPowerInfo **powerInfoList);
int esxVI_HandleVirtualMachineQuestion
- (esxVI_Context *ctx,
- esxVI_ManagedObjectReference *virtualMachine,
- esxVI_VirtualMachineQuestionInfo *questionInfo,
- bool autoAnswer, esxVI_Boolean *blocked);
+ (esxVI_Context *ctx, esxVI_ManagedObjectReference *virtualMachine,
+ esxVI_VirtualMachineQuestionInfo *questionInfo, bool autoAnswer,
+ bool *blocked);
int esxVI_WaitForTaskCompletion(esxVI_Context *ctx,
esxVI_ManagedObjectReference *task,