提交 028db0bf 编写于 作者: M Matthias Bolte

esx: Mark error messages for translation

Also define ESX_ERROR and ESX_VI_ERROR in a central place, instead of
defining them in each source file.

Add ESX_ERROR and ESX_VI_ERROR to the msg_gen_function list in cfg.mk.

Update po/POTFILES.in accordingly.
上级 dbfa2ff5
......@@ -172,6 +172,8 @@ msg_gen_function += DEBUG0
msg_gen_function += DISABLE_fprintf
msg_gen_function += ERROR
msg_gen_function += ERROR0
msg_gen_function += ESX_ERROR
msg_gen_function += ESX_VI_ERROR
msg_gen_function += REMOTE_DEBUG
msg_gen_function += ReportError
msg_gen_function += VIR_FREE
......
......@@ -18,6 +18,12 @@ src/cpu/cpu_generic.c
src/cpu/cpu_map.c
src/cpu/cpu_x86.c
src/datatypes.c
src/esx/esx_driver.c
src/esx/esx_util.c
src/esx/esx_vi.c
src/esx/esx_vi_methods.c
src/esx/esx_vi_types.c
src/esx/esx_vmx.c
src/interface/netcf_driver.c
src/libvirt.c
src/lxc/lxc_container.c
......
......@@ -25,7 +25,6 @@
#include <config.h>
#include "internal.h"
#include "virterror_internal.h"
#include "util.h"
#include "memory.h"
#include "logging.h"
......@@ -38,10 +37,6 @@
#define VIR_FROM_THIS VIR_FROM_ESX
#define ESX_ERROR(conn, code, ...) \
virReportErrorHelper(conn, VIR_FROM_ESX, code, __FILE__, __FUNCTION__, \
__LINE__, __VA_ARGS__)
static virDrvOpenStatus
......
此差异已折叠。
......@@ -25,7 +25,6 @@
#include <config.h>
#include "internal.h"
#include "virterror_internal.h"
#include "util.h"
#include "memory.h"
#include "logging.h"
......@@ -38,10 +37,6 @@
#define VIR_FROM_THIS VIR_FROM_ESX
#define ESX_ERROR(conn, code, ...) \
virReportErrorHelper(conn, VIR_FROM_ESX, code, __FILE__, __FUNCTION__, \
__LINE__, __VA_ARGS__)
static virDrvOpenStatus
......
......@@ -25,7 +25,6 @@
#include <config.h>
#include "internal.h"
#include "virterror_internal.h"
#include "util.h"
#include "memory.h"
#include "logging.h"
......@@ -38,10 +37,6 @@
#define VIR_FROM_THIS VIR_FROM_ESX
#define ESX_ERROR(conn, code, ...) \
virReportErrorHelper(conn, VIR_FROM_ESX, code, __FILE__, __FUNCTION__, \
__LINE__, __VA_ARGS__)
static virDrvOpenStatus
......
......@@ -24,9 +24,14 @@
# define __ESX_PRIVATE_H__
# include "internal.h"
# include "virterror_internal.h"
# include "capabilities.h"
# include "esx_vi.h"
# define ESX_ERROR(code, ...) \
virReportErrorHelper(NULL, VIR_FROM_ESX, code, __FILE__, __FUNCTION__, \
__LINE__, __VA_ARGS__)
typedef struct _esxPrivate {
esxVI_Context *host;
esxVI_Context *vCenter;
......
......@@ -24,7 +24,6 @@
#include <config.h>
#include "internal.h"
#include "virterror_internal.h"
#include "util.h"
#include "memory.h"
#include "logging.h"
......@@ -37,10 +36,6 @@
#define VIR_FROM_THIS VIR_FROM_ESX
#define ESX_ERROR(conn, code, ...) \
virReportErrorHelper(conn, VIR_FROM_ESX, code, __FILE__, __FUNCTION__, \
__LINE__, __VA_ARGS__)
static virDrvOpenStatus
......
......@@ -25,7 +25,6 @@
#include <config.h>
#include "internal.h"
#include "virterror_internal.h"
#include "util.h"
#include "memory.h"
#include "logging.h"
......@@ -38,10 +37,6 @@
#define VIR_FROM_THIS VIR_FROM_ESX
#define ESX_ERROR(conn, code, ...) \
virReportErrorHelper(conn, VIR_FROM_ESX, code, __FILE__, __FUNCTION__, \
__LINE__, __VA_ARGS__)
static virDrvOpenStatus
......
......@@ -27,21 +27,17 @@
#include <netdb.h>
#include "internal.h"
#include "virterror_internal.h"
#include "datatypes.h"
#include "qparams.h"
#include "util.h"
#include "memory.h"
#include "logging.h"
#include "uuid.h"
#include "esx_private.h"
#include "esx_util.h"
#define VIR_FROM_THIS VIR_FROM_ESX
#define ESX_ERROR(code, ...) \
virReportErrorHelper(NULL, VIR_FROM_ESX, code, __FILE__, __FUNCTION__, \
__LINE__, __VA_ARGS__)
/* AI_ADDRCONFIG is missing on some systems. */
#ifndef AI_ADDRCONFIG
# define AI_ADDRCONFIG 0
......@@ -101,8 +97,8 @@ esxUtil_ParseQuery(xmlURIPtr uri, char **transport, char **vCenter,
if (STRNEQ(*transport, "http") && STRNEQ(*transport, "https")) {
ESX_ERROR(VIR_ERR_INVALID_ARG,
"Query parameter 'transport' has unexpected value "
"'%s' (should be http|https)", *transport);
_("Query parameter 'transport' has unexpected value "
"'%s' (should be http|https)"), *transport);
goto failure;
}
} else if (STRCASEEQ(queryParam->name, "vcenter")) {
......@@ -124,8 +120,8 @@ esxUtil_ParseQuery(xmlURIPtr uri, char **transport, char **vCenter,
if (virStrToLong_i(queryParam->value, NULL, 10, noVerify) < 0 ||
(*noVerify != 0 && *noVerify != 1)) {
ESX_ERROR(VIR_ERR_INVALID_ARG,
"Query parameter 'no_verify' has unexpected value "
"'%s' (should be 0 or 1)", queryParam->value);
_("Query parameter 'no_verify' has unexpected value "
"'%s' (should be 0 or 1)"), queryParam->value);
goto failure;
}
} else if (STRCASEEQ(queryParam->name, "auto_answer")) {
......@@ -136,8 +132,8 @@ esxUtil_ParseQuery(xmlURIPtr uri, char **transport, char **vCenter,
if (virStrToLong_i(queryParam->value, NULL, 10, autoAnswer) < 0 ||
(*autoAnswer != 0 && *autoAnswer != 1)) {
ESX_ERROR(VIR_ERR_INVALID_ARG,
"Query parameter 'auto_answer' has unexpected value "
"'%s' (should be 0 or 1)", queryParam->value);
_("Query parameter 'auto_answer' has unexpected "
"value '%s' (should be 0 or 1)"), queryParam->value);
goto failure;
}
} else {
......@@ -213,7 +209,7 @@ esxUtil_ParseDatastoreRelatedPath(const char *datastoreRelatedPath,
if (datastoreName == NULL || *datastoreName != NULL ||
directoryName == NULL || *directoryName != NULL ||
fileName == NULL || *fileName != NULL) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
......@@ -234,8 +230,8 @@ esxUtil_ParseDatastoreRelatedPath(const char *datastoreRelatedPath,
if (sscanf(datastoreRelatedPath, "[%a[^]%]] %a[^\n]", datastoreName,
&directoryAndFileName) != 2) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
"Datastore related path '%s' doesn't have expected format "
"'[<datastore>] <path>'", datastoreRelatedPath);
_("Datastore related path '%s' doesn't have expected format "
"'[<datastore>] <path>'"), datastoreRelatedPath);
goto failure;
}
......@@ -250,7 +246,7 @@ esxUtil_ParseDatastoreRelatedPath(const char *datastoreRelatedPath,
if (*separator == '\0') {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
"Datastore related path '%s' doesn't reference a file",
_("Datastore related path '%s' doesn't reference a file"),
datastoreRelatedPath);
goto failure;
}
......@@ -302,14 +298,14 @@ esxUtil_ResolveHostname(const char *hostname,
if (errcode != 0) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
"IP address lookup for host '%s' failed: %s", hostname,
_("IP address lookup for host '%s' failed: %s"), hostname,
gai_strerror(errcode));
return -1;
}
if (result == NULL) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
"No IP address for host '%s' found: %s", hostname,
_("No IP address for host '%s' found: %s"), hostname,
gai_strerror(errcode));
return -1;
}
......@@ -319,7 +315,7 @@ esxUtil_ResolveHostname(const char *hostname,
if (errcode != 0) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
"Formating IP address for host '%s' failed: %s", hostname,
_("Formating IP address for host '%s' failed: %s"), hostname,
gai_strerror(errcode));
freeaddrinfo(result);
return -1;
......@@ -347,13 +343,13 @@ esxUtil_GetConfigString(virConfPtr conf, const char *name, char **string,
}
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
"Missing essential config entry '%s'", name);
_("Missing essential config entry '%s'"), name);
return -1;
}
if (value->type != VIR_CONF_STRING) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
"Config entry '%s' must be a string", name);
_("Config entry '%s' must be a string"), name);
return -1;
}
......@@ -363,7 +359,7 @@ esxUtil_GetConfigString(virConfPtr conf, const char *name, char **string,
}
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
"Missing essential config entry '%s'", name);
_("Missing essential config entry '%s'"), name);
return -1;
}
......@@ -392,14 +388,14 @@ esxUtil_GetConfigUUID(virConfPtr conf, const char *name, unsigned char *uuid,
return 0;
} else {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
"Missing essential config entry '%s'", name);
_("Missing essential config entry '%s'"), name);
return -1;
}
}
if (value->type != VIR_CONF_STRING) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
"Config entry '%s' must be a string", name);
_("Config entry '%s' must be a string"), name);
return -1;
}
......@@ -408,14 +404,14 @@ esxUtil_GetConfigUUID(virConfPtr conf, const char *name, unsigned char *uuid,
return 0;
} else {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
"Missing essential config entry '%s'", name);
_("Missing essential config entry '%s'"), name);
return -1;
}
}
if (virUUIDParse(value->str, uuid) < 0) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
"Could not parse UUID from string '%s'", value->str);
_("Could not parse UUID from string '%s'"), value->str);
return -1;
}
......@@ -438,7 +434,7 @@ esxUtil_GetConfigLong(virConfPtr conf, const char *name, long long *number,
return 0;
} else {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
"Missing essential config entry '%s'", name);
_("Missing essential config entry '%s'"), name);
return -1;
}
}
......@@ -449,7 +445,7 @@ esxUtil_GetConfigLong(virConfPtr conf, const char *name, long long *number,
return 0;
} else {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
"Missing essential config entry '%s'", name);
_("Missing essential config entry '%s'"), name);
return -1;
}
}
......@@ -458,13 +454,13 @@ esxUtil_GetConfigLong(virConfPtr conf, const char *name, long long *number,
*number = -1;
} else if (virStrToLong_ll(value->str, NULL, 10, number) < 0) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
"Config entry '%s' must represent an integer value",
_("Config entry '%s' must represent an integer value"),
name);
return -1;
}
} else {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
"Config entry '%s' must be a string", name);
_("Config entry '%s' must be a string"), name);
return -1;
}
......@@ -487,7 +483,7 @@ esxUtil_GetConfigBoolean(virConfPtr conf, const char *name, int *boolean_,
return 0;
} else {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
"Missing essential config entry '%s'", name);
_("Missing essential config entry '%s'"), name);
return -1;
}
}
......@@ -498,7 +494,7 @@ esxUtil_GetConfigBoolean(virConfPtr conf, const char *name, int *boolean_,
return 0;
} else {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
"Missing essential config entry '%s'", name);
_("Missing essential config entry '%s'"), name);
return -1;
}
}
......@@ -509,13 +505,13 @@ esxUtil_GetConfigBoolean(virConfPtr conf, const char *name, int *boolean_,
*boolean_ = 0;
} else {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
"Config entry '%s' must represent a boolean value "
"(true|false)", name);
_("Config entry '%s' must represent a boolean value "
"(true|false)"), name);
return -1;
}
} else {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
"Config entry '%s' must be a string", name);
_("Config entry '%s' must be a string"), name);
return -1;
}
......
此差异已折叠。
......@@ -28,9 +28,18 @@
# include <curl/curl.h>
# include "internal.h"
# include "virterror_internal.h"
# include "datatypes.h"
# include "esx_vi_types.h"
# define ESX_VI_ERROR(code, ...) \
virReportErrorHelper(NULL, VIR_FROM_ESX, code, __FILE__, __FUNCTION__, \
__LINE__, __VA_ARGS__)
typedef enum _esxVI_APIVersion esxVI_APIVersion;
typedef enum _esxVI_ProductVersion esxVI_ProductVersion;
typedef enum _esxVI_Occurrence esxVI_Occurrence;
......
......@@ -27,15 +27,12 @@
#include "memory.h"
#include "logging.h"
#include "uuid.h"
#include "virterror_internal.h"
#include "esx_vi_methods.h"
#include "esx_util.h"
#define VIR_FROM_THIS VIR_FROM_ESX
#define ESX_VI_ERROR(code, ...) \
virReportErrorHelper(NULL, VIR_FROM_ESX, code, __FILE__, __FUNCTION__, \
__LINE__, __VA_ARGS__)
#define ESX_VI__SOAP__REQUEST_HEADER \
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" \
......@@ -46,6 +43,8 @@
"xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" \
"<soapenv:Body>"
#define ESX_VI__SOAP__REQUEST_FOOTER \
"</soapenv:Body>" \
"</soapenv:Envelope>"
......@@ -109,7 +108,7 @@
#define ESX_VI__METHOD__CHECK_SERVICE() \
if (ctx->service == NULL) { \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid call"); \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid call")); \
return -1; \
}
......@@ -117,7 +116,7 @@
#define ESX_VI__METHOD__PARAMETER__CHECK_OUTPUT(_name) \
if (_name == NULL || *_name != NULL) { \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument"); \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument")); \
return -1; \
}
......@@ -198,7 +197,7 @@ esxVI_RetrieveServiceContent(esxVI_Context *ctx,
esxVI_Response *response = NULL;
if (serviceContent == NULL || *serviceContent != NULL) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
......@@ -276,7 +275,7 @@ ESX_VI__METHOD(SessionIsActive,
ESX_VI__METHOD__CHECK_SERVICE()
if (active == NULL) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
},
......
......@@ -32,16 +32,11 @@
#include "memory.h"
#include "logging.h"
#include "util.h"
#include "virterror_internal.h"
#include "esx_vi.h"
#include "esx_vi_types.h"
#define VIR_FROM_THIS VIR_FROM_ESX
#define ESX_VI_ERROR(code, ...) \
virReportErrorHelper(NULL, VIR_FROM_ESX, code, __FILE__, __FUNCTION__, \
__LINE__, __VA_ARGS__)
#define ESV_VI__XML_TAG__OPEN(_buffer, _element, _type) \
......@@ -123,7 +118,8 @@
esxVI_##_type##_DeepCopy(esxVI_##_type **dest, esxVI_##_type *src) \
{ \
if (dest == NULL || *dest != NULL) { \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument"); \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", \
_("Invalid argument")); \
return -1; \
} \
\
......@@ -213,7 +209,8 @@
esxVI_##_type **ptrptr) \
{ \
if (anyType == NULL || ptrptr == NULL || *ptrptr != NULL) { \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument"); \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", \
_("Invalid argument")); \
return -1; \
} \
\
......@@ -236,7 +233,8 @@
const char *element, virBufferPtr output) \
{ \
if (element == NULL || output == NULL ) { \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument"); \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", \
_("Invalid argument")); \
return -1; \
} \
\
......@@ -274,7 +272,8 @@
xmlNodePtr childNode = NULL; \
\
if (ptrptr == NULL || *ptrptr != NULL) { \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument"); \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", \
_("Invalid argument")); \
return -1; \
} \
\
......@@ -318,7 +317,8 @@
long long value; \
\
if (number == NULL || *number != NULL) { \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument"); \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", \
_("Invalid argument")); \
return -1; \
} \
\
......@@ -565,7 +565,8 @@
esxVI_##__type##_DynamicCast(void *item) \
{ \
if (item == NULL) { \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument"); \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", \
_("Invalid argument")); \
return NULL; \
} \
\
......@@ -709,7 +710,7 @@ esxVI_AnyType_ExpectType(esxVI_AnyType *anyType, esxVI_Type type)
{
if (anyType->type != type) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
"Expecting type '%s' but found '%s'",
_("Expecting type '%s' but found '%s'"),
esxVI_Type_ToString(type),
anyType->type != esxVI_Type_Other
? esxVI_Type_ToString(anyType->type)
......@@ -724,7 +725,7 @@ int
esxVI_AnyType_DeepCopy(esxVI_AnyType **dest, esxVI_AnyType *src)
{
if (dest == NULL || *dest != NULL) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
......@@ -740,7 +741,8 @@ esxVI_AnyType_DeepCopy(esxVI_AnyType **dest, esxVI_AnyType *src)
(*dest)->node = xmlCopyNode(src->node, 1);
if ((*dest)->node == NULL) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Could not copy an XML node");
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
_("Could not copy an XML node"));
goto failure;
}
......@@ -790,7 +792,7 @@ esxVI_AnyType_Deserialize(xmlNodePtr node, esxVI_AnyType **anyType)
long long int number;
if (anyType == NULL || *anyType != NULL) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
......@@ -801,7 +803,8 @@ esxVI_AnyType_Deserialize(xmlNodePtr node, esxVI_AnyType **anyType)
(*anyType)->node = xmlCopyNode(node, 1);
if ((*anyType)->node == NULL) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Could not copy an XML node");
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
_("Could not copy an XML node"));
goto failure;
}
......@@ -811,8 +814,8 @@ esxVI_AnyType_Deserialize(xmlNodePtr node, esxVI_AnyType **anyType)
BAD_CAST "http://www.w3.org/2001/XMLSchema-instance");
if ((*anyType)->other == NULL) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
"AnyType is missing 'type' property");
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
_("AnyType is missing 'type' property"));
goto failure;
}
......@@ -820,7 +823,7 @@ esxVI_AnyType_Deserialize(xmlNodePtr node, esxVI_AnyType **anyType)
if ((*anyType)->type == esxVI_Type_Undefined) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
"Unknown value '%s' for AnyType 'type' property",
_("Unknown value '%s' for AnyType 'type' property"),
(*anyType)->other);
goto failure;
}
......@@ -837,19 +840,19 @@ esxVI_AnyType_Deserialize(xmlNodePtr node, esxVI_AnyType **anyType)
}
}
#define _DESERIALIZE_NUMBER(_type, _xsdType, _name, _min, _max) \
#define _DESERIALIZE_NUMBER(_type, _xsdType, _name, _min, _max) \
do { \
if (virStrToLong_ll((*anyType)->value, NULL, 10, &number) < 0) { \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
"Unknown value '%s' for "_xsdType, \
(*anyType)->value); \
_("Unknown value '%s' for %s"), \
(*anyType)->value, _xsdType); \
goto failure; \
} \
\
if (number < (_min) || number > (_max)) { \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
"Value '%s' is out of "_xsdType" range", \
(*anyType)->value); \
_("Value '%s' is out of %s range"), \
(*anyType)->value, _xsdType); \
goto failure; \
} \
\
......@@ -864,7 +867,7 @@ esxVI_AnyType_Deserialize(xmlNodePtr node, esxVI_AnyType **anyType)
(*anyType)->boolean = esxVI_Boolean_False;
} else {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
"Unknown value '%s' for xsd:boolean",
_("Unknown value '%s' for xsd:boolean"),
(*anyType)->value);
goto failure;
}
......@@ -995,7 +998,7 @@ int
esxVI_String_DeepCopyValue(char **dest, const char *src)
{
if (dest == NULL || *dest != NULL) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
......@@ -1029,7 +1032,7 @@ esxVI_String_SerializeValue(const char *value, const char *element,
virBufferPtr output)
{
if (element == NULL || output == NULL) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
......@@ -1059,7 +1062,7 @@ int
esxVI_String_DeserializeValue(xmlNodePtr node, char **value)
{
if (value == NULL || *value != NULL) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
......@@ -1184,7 +1187,7 @@ int
esxVI_DateTime_Deserialize(xmlNodePtr node, esxVI_DateTime **dateTime)
{
if (dateTime == NULL || *dateTime != NULL) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
......@@ -1196,9 +1199,9 @@ esxVI_DateTime_Deserialize(xmlNodePtr node, esxVI_DateTime **dateTime)
(char *)xmlNodeListGetString(node->doc, node->children, 1);
if ((*dateTime)->value == NULL) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
"XML node doesn't contain text, expecting an "
"xsd:dateTime value");
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
_("XML node doesn't contain text, expecting an "
"xsd:dateTime value"));
goto failure;
}
......@@ -1281,7 +1284,7 @@ esxVI_ManagedObjectReference_Serialize
const char *element, virBufferPtr output)
{
if (element == NULL || output == NULL) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
......@@ -1311,7 +1314,7 @@ esxVI_ManagedObjectReference_Deserialize
(xmlNodePtr node, esxVI_ManagedObjectReference **managedObjectReference)
{
if (managedObjectReference == NULL || *managedObjectReference != NULL) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
......@@ -1323,8 +1326,8 @@ esxVI_ManagedObjectReference_Deserialize
(char *)xmlGetNoNsProp(node, BAD_CAST "type");
if ((*managedObjectReference)->type == NULL) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
"ManagedObjectReference is missing 'type' property");
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
_("ManagedObjectReference is missing 'type' property"));
goto failure;
}
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册