mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 02:51:16 +00:00
openvzLog: mark its string arguments for translation
* Makefile.maint (msg_gen_function): Add openvzLog. * src/openvz_conf.c (openvzAssignVMDef, openvzParseXML): Mark strings. * src/openvz_driver.c (openvzDomainShutdown, openvzDomainReboot): (openvzDomainDefineXML, openvzDomainCreateLinux): (openvzDomainCreate, openvzDomainUndefine): Likewise.
This commit is contained in:
parent
5bb81e1d87
commit
7f8639261a
@ -1,5 +1,12 @@
|
||||
Thu Mar 27 14:36:56 CET 2008 Jim Meyering <meyering@redhat.com>
|
||||
|
||||
openvzLog: mark its string arguments for translation
|
||||
* Makefile.maint (msg_gen_function): Add openvzLog.
|
||||
* src/openvz_conf.c (openvzAssignVMDef, openvzParseXML): Mark strings.
|
||||
* src/openvz_driver.c (openvzDomainShutdown, openvzDomainReboot):
|
||||
(openvzDomainDefineXML, openvzDomainCreateLinux):
|
||||
(openvzDomainCreate, openvzDomainUndefine): Likewise.
|
||||
|
||||
error: mark most string arguments for translation
|
||||
Also mark some arguments to __virRaiseError.
|
||||
* Makefile.maint (msg_gen_function): Add error.
|
||||
|
@ -315,13 +315,13 @@ msg_gen_function += virStorageLog
|
||||
msg_gen_function += xenXMError
|
||||
msg_gen_function += ReportError
|
||||
msg_gen_function += qemudReportError
|
||||
msg_gen_function += openvzLog
|
||||
|
||||
# Uncomment this after adjusting remaining diagnostics to be translatable.
|
||||
# msg_gen_function += error
|
||||
|
||||
# msg_gen_function += virXenError
|
||||
# msg_gen_function += testError
|
||||
# msg_gen_function += openvzLog
|
||||
|
||||
func_or := $(shell printf '$(msg_gen_function)'|tr -s '[[:space:]]' '|')
|
||||
func_re := ($(func_or))
|
||||
|
@ -237,8 +237,9 @@ openvzAssignVMDef(virConnectPtr conn,
|
||||
}
|
||||
else
|
||||
{
|
||||
openvzLog(OPENVZ_ERR, "Error already an active OPENVZ VM having id '%s'",
|
||||
def->name);
|
||||
openvzLog(OPENVZ_ERR,
|
||||
_("Error already an active OPENVZ VM having id '%s'"),
|
||||
def->name);
|
||||
openvzFreeVMDef(def);
|
||||
return NULL; /* can't redefine an active domain */
|
||||
}
|
||||
@ -383,8 +384,9 @@ static struct openvz_vm_def
|
||||
obj = xmlXPathEval(BAD_CAST"string(/domain/container/network/ipaddress[1])", ctxt);
|
||||
if ((obj == NULL) || (obj->type != XPATH_STRING) || (obj->stringval == NULL)
|
||||
|| (obj->stringval[0] == 0)) {
|
||||
openvzLog(OPENVZ_WARN, "No IP address in the given xml config file '%s'",
|
||||
xml->name);
|
||||
openvzLog(OPENVZ_WARN,
|
||||
_("No IP address in the given xml config file '%s'"),
|
||||
xml->name);
|
||||
}
|
||||
if (xmlStrlen(obj->stringval) >= (OPENVZ_IP_MAX)) {
|
||||
char errorMessage[OPENVZ_MAX_ERROR_LEN];
|
||||
@ -395,7 +397,8 @@ static struct openvz_vm_def
|
||||
goto bail_out;
|
||||
}
|
||||
if (!(ovzIp = calloc(1, sizeof(*ovzIp)))) {
|
||||
openvzLog(OPENVZ_ERR, "Failed to Create Memory for 'ovz_ip' structure");
|
||||
openvzLog(OPENVZ_ERR,
|
||||
_("Failed to Create Memory for 'ovz_ip' structure"));
|
||||
goto bail_out;
|
||||
}
|
||||
strncpy(ovzIp->ip, (const char *) obj->stringval, OPENVZ_IP_MAX);
|
||||
@ -406,8 +409,9 @@ static struct openvz_vm_def
|
||||
obj = xmlXPathEval(BAD_CAST "string(/domain/container/network/netmask[1])", ctxt);
|
||||
if ((obj == NULL) || (obj->type != XPATH_STRING)
|
||||
|| (obj->stringval == NULL) || (obj->stringval[0] == 0))
|
||||
openvzLog(OPENVZ_WARN, "No Netmask address in the given xml config file '%s'",
|
||||
xml->name);
|
||||
openvzLog(OPENVZ_WARN,
|
||||
_("No Netmask address in the given xml config file '%s'"),
|
||||
xml->name);
|
||||
|
||||
if (strlen((const char *) obj->stringval) >= (OPENVZ_IP_MAX)) {
|
||||
char errorMessage[OPENVZ_MAX_ERROR_LEN];
|
||||
@ -424,7 +428,9 @@ static struct openvz_vm_def
|
||||
obj = xmlXPathEval(BAD_CAST "string(/domain/container/network/hostname[1])", ctxt);
|
||||
if ((obj == NULL) || (obj->type != XPATH_STRING) || (obj->stringval == NULL)
|
||||
|| (obj->stringval[0] == 0))
|
||||
openvzLog(OPENVZ_WARN, "No hostname in the given xml config file '%s'", xml->name);
|
||||
openvzLog(OPENVZ_WARN,
|
||||
_("No hostname in the given xml config file '%s'"),
|
||||
xml->name);
|
||||
|
||||
if (strlen((const char *) obj->stringval) >= (OPENVZ_HOSTNAME_MAX - 1)) {
|
||||
char errorMessage[OPENVZ_MAX_ERROR_LEN];
|
||||
@ -441,8 +447,9 @@ static struct openvz_vm_def
|
||||
obj = xmlXPathEval(BAD_CAST"string(/domain/container/network/gateway[1])", ctxt);
|
||||
if ((obj == NULL) || (obj->type != XPATH_STRING) || (obj->stringval == NULL)
|
||||
|| (obj->stringval[0] == 0))
|
||||
openvzLog(OPENVZ_WARN, "No Gateway address in the given xml config file '%s'",
|
||||
xml->name);
|
||||
openvzLog(OPENVZ_WARN,
|
||||
_("No Gateway address in the given xml config file '%s'"),
|
||||
xml->name);
|
||||
|
||||
if (strlen((const char *) obj->stringval) >= (OPENVZ_IP_MAX)) {
|
||||
char errorMessage[OPENVZ_MAX_ERROR_LEN];
|
||||
@ -459,8 +466,9 @@ static struct openvz_vm_def
|
||||
obj = xmlXPathEval(BAD_CAST "string(/domain/container/network/nameserver[1])", ctxt);
|
||||
if ((obj == NULL) || (obj->type != XPATH_STRING) || (obj->stringval == NULL)
|
||||
|| (obj->stringval[0] == 0))
|
||||
openvzLog(OPENVZ_WARN, "No Nameserver address inthe given xml config file '%s'",
|
||||
xml->name);
|
||||
openvzLog(OPENVZ_WARN,
|
||||
_("No Nameserver address inthe given xml config file '%s'"),
|
||||
xml->name);
|
||||
|
||||
if (strlen((const char *) obj->stringval) >= (OPENVZ_IP_MAX)) {
|
||||
char errorMessage[OPENVZ_MAX_ERROR_LEN];
|
||||
@ -471,7 +479,8 @@ static struct openvz_vm_def
|
||||
goto bail_out;
|
||||
}
|
||||
if (!(ovzNs = calloc(1, sizeof(*ovzNs)))) {
|
||||
openvzLog(OPENVZ_ERR, "Failed to Create Memory for 'ovz_ns' structure");
|
||||
openvzLog(OPENVZ_ERR,
|
||||
_("Failed to Create Memory for 'ovz_ns' structure"));
|
||||
goto bail_out;
|
||||
}
|
||||
strncpy(ovzNs->ip, (const char *) obj->stringval, OPENVZ_IP_MAX);
|
||||
|
@ -253,7 +253,7 @@ static int openvzDomainShutdown(virDomainPtr dom) {
|
||||
|
||||
if((ret = convCmdbufExec(cmdbuf, cmdExec)) == -1)
|
||||
{
|
||||
openvzLog(OPENVZ_ERR, "Error in parsing Options to OPENVZ");
|
||||
openvzLog(OPENVZ_ERR, "%s", _("Error in parsing Options to OPENVZ"));
|
||||
goto bail_out;
|
||||
}
|
||||
|
||||
@ -298,7 +298,7 @@ static int openvzDomainReboot(virDomainPtr dom,
|
||||
|
||||
if((ret = convCmdbufExec(cmdbuf, cmdExec)) == -1)
|
||||
{
|
||||
openvzLog(OPENVZ_ERR, "Error in parsing Options to OPENVZ");
|
||||
openvzLog(OPENVZ_ERR, "%s", _("Error in parsing Options to OPENVZ"));
|
||||
goto bail_out1;
|
||||
}
|
||||
ret = virExec(dom->conn, (char **)cmdExec, &pid, -1, &outfd, &errfd);
|
||||
@ -328,13 +328,13 @@ openvzDomainDefineXML(virConnectPtr conn, const char *xml)
|
||||
|
||||
vm = openvzFindVMByID(driver, strtoI(vmdef->name));
|
||||
if (vm) {
|
||||
openvzLog(OPENVZ_ERR, "Already an OPENVZ VM active with the id '%s'",
|
||||
vmdef->name);
|
||||
openvzLog(OPENVZ_ERR, _("Already an OPENVZ VM active with the id '%s'"),
|
||||
vmdef->name);
|
||||
goto bail_out2;
|
||||
}
|
||||
if (!(vm = openvzAssignVMDef(conn, driver, vmdef))) {
|
||||
openvzFreeVMDef(vmdef);
|
||||
openvzLog(OPENVZ_ERR, "Error creating OPENVZ VM");
|
||||
openvzLog(OPENVZ_ERR, "%s", _("Error creating OPENVZ VM"));
|
||||
}
|
||||
|
||||
snprintf(cmdbuf, CMDBUF_LEN - 1, VZCTL " create %s", vmdef->name);
|
||||
@ -357,7 +357,7 @@ openvzDomainDefineXML(virConnectPtr conn, const char *xml)
|
||||
|
||||
if((ret = convCmdbufExec(cmdbuf, cmdExec)) == -1)
|
||||
{
|
||||
openvzLog(OPENVZ_ERR, "Error in parsing Options to OPENVZ");
|
||||
openvzLog(OPENVZ_ERR, "%s", _("Error in parsing Options to OPENVZ"));
|
||||
goto bail_out2;
|
||||
}
|
||||
ret = virExec(conn, (char **)cmdExec, &pid, -1, &outfd, &errfd);
|
||||
@ -395,12 +395,13 @@ openvzDomainCreateLinux(virConnectPtr conn, const char *xml,
|
||||
vm = openvzFindVMByID(driver, strtoI(vmdef->name));
|
||||
if (vm) {
|
||||
openvzFreeVMDef(vmdef);
|
||||
openvzLog(OPENVZ_ERR, "Already an OPENVZ VM defined with the id '%d'",
|
||||
openvzLog(OPENVZ_ERR,
|
||||
_("Already an OPENVZ VM defined with the id '%d'"),
|
||||
strtoI(vmdef->name));
|
||||
return NULL;
|
||||
}
|
||||
if (!(vm = openvzAssignVMDef(conn, driver, vmdef))) {
|
||||
openvzLog(OPENVZ_ERR, "Error creating OPENVZ VM");
|
||||
openvzLog(OPENVZ_ERR, "%s", _("Error creating OPENVZ VM"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -424,7 +425,7 @@ openvzDomainCreateLinux(virConnectPtr conn, const char *xml,
|
||||
|
||||
if((ret = convCmdbufExec(cmdbuf, cmdExec)) == -1)
|
||||
{
|
||||
openvzLog(OPENVZ_ERR, "Error in parsing Options to OPENVZ");
|
||||
openvzLog(OPENVZ_ERR, "%s", _("Error in parsing Options to OPENVZ"));
|
||||
goto bail_out3;
|
||||
}
|
||||
ret = virExec(conn, (char **)cmdExec, &pid, -1, &outfd, &errfd);
|
||||
@ -440,7 +441,7 @@ openvzDomainCreateLinux(virConnectPtr conn, const char *xml,
|
||||
|
||||
if((ret = convCmdbufExec(cmdbuf, cmdExec)) == -1)
|
||||
{
|
||||
openvzLog(OPENVZ_ERR, "Error in parsing Options to OPENVZ");
|
||||
openvzLog(OPENVZ_ERR, "%s", _("Error in parsing Options to OPENVZ"));
|
||||
goto bail_out3;
|
||||
}
|
||||
ret = virExec(conn, (char **)cmdExec, &pid, -1, &outfd, &errfd);
|
||||
@ -494,7 +495,7 @@ openvzDomainCreate(virDomainPtr dom)
|
||||
|
||||
if((ret = convCmdbufExec(cmdbuf, cmdExec)) == -1)
|
||||
{
|
||||
openvzLog(OPENVZ_ERR, "Error in parsing Options to OPENVZ");
|
||||
openvzLog(OPENVZ_ERR, "%s", _("Error in parsing Options to OPENVZ"));
|
||||
goto bail_out4;
|
||||
}
|
||||
ret = virExec(dom->conn, (char **)cmdExec, &pid, -1, &outfd, &errfd);
|
||||
@ -537,7 +538,7 @@ openvzDomainUndefine(virDomainPtr dom)
|
||||
|
||||
if((ret = convCmdbufExec(cmdbuf, cmdExec)) == -1)
|
||||
{
|
||||
openvzLog(OPENVZ_ERR, "Error in parsing Options to OPENVZ");
|
||||
openvzLog(OPENVZ_ERR, "%s", _("Error in parsing Options to OPENVZ"));
|
||||
goto bail_out5;
|
||||
}
|
||||
ret = virExec(conn, (char **)cmdExec, &pid, -1, &outfd, &errfd);
|
||||
|
Loading…
Reference in New Issue
Block a user