mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 07:17:44 +00:00
esx: Mark error message in macros for translation
This commit is contained in:
parent
d460169610
commit
991f97d827
@ -77,12 +77,12 @@
|
|||||||
int \
|
int \
|
||||||
esxVI_##__type##_Validate(esxVI_##__type *item) \
|
esxVI_##__type##_Validate(esxVI_##__type *item) \
|
||||||
{ \
|
{ \
|
||||||
const char *type_name = esxVI_Type_ToString(esxVI_Type_##__type); \
|
const char *typeName = esxVI_Type_ToString(esxVI_Type_##__type); \
|
||||||
\
|
\
|
||||||
if (item->_type <= esxVI_Type_Undefined || \
|
if (item->_type <= esxVI_Type_Undefined || \
|
||||||
item->_type >= esxVI_Type_Other) { \
|
item->_type >= esxVI_Type_Other) { \
|
||||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
|
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
|
||||||
"%s object has invalid dynamic type", type_name); \
|
_("%s object has invalid dynamic type"), typeName); \
|
||||||
return -1; \
|
return -1; \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
@ -293,7 +293,7 @@
|
|||||||
childNode = childNode->next) { \
|
childNode = childNode->next) { \
|
||||||
if (childNode->type != XML_ELEMENT_NODE) { \
|
if (childNode->type != XML_ELEMENT_NODE) { \
|
||||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
|
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
|
||||||
"Wrong XML element type %d", childNode->type); \
|
_("Wrong XML element type %d"), childNode->type);\
|
||||||
goto failure; \
|
goto failure; \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
@ -343,22 +343,22 @@
|
|||||||
\
|
\
|
||||||
if (string == NULL) { \
|
if (string == NULL) { \
|
||||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
|
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
|
||||||
"XML node doesn't contain text, expecting an " \
|
_("XML node doesn't contain text, expecting an %s " \
|
||||||
_xsdType" value"); \
|
"value"), _xsdType); \
|
||||||
goto cleanup; \
|
goto cleanup; \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
if (virStrToLong_ll(string, NULL, 10, &value) < 0) { \
|
if (virStrToLong_ll(string, NULL, 10, &value) < 0) { \
|
||||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
|
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
|
||||||
"Unknown value '%s' for "_xsdType, string); \
|
_("Unknown value '%s' for %s"), string, _xsdType); \
|
||||||
goto cleanup; \
|
goto cleanup; \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
if (((_min) != INT64_MIN && value < (_min)) \
|
if (((_min) != INT64_MIN && value < (_min)) \
|
||||||
|| ((_max) != INT64_MAX && value > (_max))) { \
|
|| ((_max) != INT64_MAX && value > (_max))) { \
|
||||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
|
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
|
||||||
"Value '%s' is not representable as "_xsdType, \
|
_("Value '%s' is not representable as %s"), \
|
||||||
(const char *)string); \
|
string, _xsdType); \
|
||||||
goto cleanup; \
|
goto cleanup; \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
@ -482,8 +482,8 @@
|
|||||||
#define ESX_VI__TEMPLATE__PROPERTY__REQUIRE(_name) \
|
#define ESX_VI__TEMPLATE__PROPERTY__REQUIRE(_name) \
|
||||||
if (item->_name == 0) { \
|
if (item->_name == 0) { \
|
||||||
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
|
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
|
||||||
"%s object is missing the required '%s' property", \
|
_("%s object is missing the required '%s' property"), \
|
||||||
type_name, #_name); \
|
typeName, #_name); \
|
||||||
return -1; \
|
return -1; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user