diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index f575362059..b065cdc513 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -3603,10 +3603,9 @@ esxDomainGetSchedulerParametersFlags(virDomainPtr domain, params[i].value.i = -3; break; + case esxVI_SharesLevel_Undefined: default: - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Shares level has unknown value %d"), - (int)sharesInfo->level); + virReportEnumRangeError(esxVI_SharesLevel, sharesInfo->level); esxVI_SharesInfo_Free(&sharesInfo); goto cleanup; } diff --git a/src/esx/esx_vi.c b/src/esx/esx_vi.c index edf52ff828..43ff7ea048 100644 --- a/src/esx/esx_vi.c +++ b/src/esx/esx_vi.c @@ -483,7 +483,7 @@ esxVI_SharedCURL_Lock(CURL *handle ATTRIBUTE_UNUSED, curl_lock_data data, size_t i; esxVI_SharedCURL *shared = userptr; - switch (data) { + switch ((int)data) { case CURL_LOCK_DATA_SHARE: i = 0; break; @@ -511,7 +511,7 @@ esxVI_SharedCURL_Unlock(CURL *handle ATTRIBUTE_UNUSED, curl_lock_data data, size_t i; esxVI_SharedCURL *shared = userptr; - switch (data) { + switch ((int)data) { case CURL_LOCK_DATA_SHARE: i = 0; break; @@ -1563,9 +1563,9 @@ esxVI_Context_Execute(esxVI_Context *ctx, const char *methodName, break; + case esxVI_Occurrence_Undefined: default: - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Invalid argument (occurrence)")); + virReportEnumRangeError(esxVI_Occurrence, occurrence); goto cleanup; } } @@ -2280,9 +2280,10 @@ esxVI_LookupObjectContentByType(esxVI_Context *ctx, type, root->type); break; + case esxVI_Occurrence_None: + case esxVI_Occurrence_Undefined: default: - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Invalid occurrence value")); + virReportEnumRangeError(esxVI_Occurrence, occurrence); break; } diff --git a/src/esx/esx_vi_types.c b/src/esx/esx_vi_types.c index be35af861c..ec7fda9865 100644 --- a/src/esx/esx_vi_types.c +++ b/src/esx/esx_vi_types.c @@ -544,7 +544,7 @@ VIR_LOG_INIT("esx.esx_vi_types"); #define ESX_VI__TEMPLATE__DISPATCH(_actual_type, _actual_type_name, __type, \ _dispatch, _error_return) \ - switch (_actual_type) { \ + switch ((int)_actual_type) { \ _dispatch \ \ case esxVI_Type_##__type: \ @@ -690,7 +690,7 @@ VIR_LOG_INIT("esx.esx_vi_types"); return -1; \ } \ \ - switch (type) { \ + switch ((int)type) { \ _dispatch \ \ case esxVI_Type_##__type: \ @@ -967,7 +967,7 @@ esxVI_AnyType_DeepCopy(esxVI_AnyType **dest, esxVI_AnyType *src) goto failure; } - switch (src->type) { + switch ((int)src->type) { case esxVI_Type_Boolean: (*dest)->boolean = src->boolean; break; @@ -1071,7 +1071,7 @@ esxVI_AnyType_Deserialize(xmlNodePtr node, esxVI_AnyType **anyType) (*anyType)->_name = number; \ } while (0) - switch ((*anyType)->type) { + switch ((int)(*anyType)->type) { case esxVI_Type_Boolean: if (STREQ((*anyType)->value, "true")) { (*anyType)->boolean = esxVI_Boolean_True; @@ -1876,6 +1876,7 @@ esxVI_VirtualMachinePowerState_ConvertToLibvirt case esxVI_VirtualMachinePowerState_Suspended: return VIR_DOMAIN_PAUSED; + case esxVI_VirtualMachinePowerState_Undefined: default: return VIR_DOMAIN_NOSTATE; }