Devel
Threads by month
- ----- 2026 -----
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- 40 participants
- 40153 discussions
[Libvir] [PATCH 8/9] testError: mark most string arguments for translation
by Jim Meyering 28 Mar '08
by Jim Meyering 28 Mar '08
28 Mar '08
testError: mark most string arguments for translation
Signed-off-by: Jim Meyering <meyering(a)redhat.com>
---
Makefile.maint | 5 +++--
src/test.c | 30 +++++++++++++++---------------
2 files changed, 18 insertions(+), 17 deletions(-)
diff --git a/Makefile.maint b/Makefile.maint
index 55a9677..518e59b 100644
--- a/Makefile.maint
+++ b/Makefile.maint
@@ -317,9 +317,10 @@ msg_gen_function += ReportError
msg_gen_function += qemudReportError
msg_gen_function += openvzLog
-# Uncomment this after adjusting remaining diagnostics to be translatable.
+# Uncomment the following and run "make syntax-check" to see diagnostics
+# that are not yet marked for translation, but that need to be rewritten
+# so that they are translatable.
# msg_gen_function += error
-
# msg_gen_function += virXenError
# msg_gen_function += testError
diff --git a/src/test.c b/src/test.c
index f401d7d..6cf3fda 100644
--- a/src/test.c
+++ b/src/test.c
@@ -1307,31 +1307,31 @@ static int testDomainSave(virDomainPtr domain,
xml = testDomainDumpXML(domain, 0);
if (xml == NULL) {
testError(domain->conn, domain, NULL, VIR_ERR_INTERNAL_ERROR,
- "cannot allocate space for metadata");
+ _("cannot allocate space for metadata"));
return (-1);
}
if ((fd = open(path, O_CREAT|O_TRUNC|O_WRONLY, S_IRUSR|S_IWUSR)) < 0) {
testError(domain->conn, domain, NULL, VIR_ERR_INTERNAL_ERROR,
- "cannot save domain");
+ _("cannot save domain"));
return (-1);
}
len = strlen(xml);
if (safewrite(fd, TEST_SAVE_MAGIC, sizeof(TEST_SAVE_MAGIC)) < 0) {
testError(domain->conn, domain, NULL, VIR_ERR_INTERNAL_ERROR,
- "cannot write header");
+ _("cannot write header"));
close(fd);
return (-1);
}
if (safewrite(fd, (char*)&len, sizeof(len)) < 0) {
testError(domain->conn, domain, NULL, VIR_ERR_INTERNAL_ERROR,
- "cannot write metadata length");
+ _("cannot write metadata length"));
close(fd);
return (-1);
}
if (safewrite(fd, xml, len) < 0) {
testError(domain->conn, domain, NULL, VIR_ERR_INTERNAL_ERROR,
- "cannot write metadata");
+ _("cannot write metadata"));
free(xml);
close(fd);
return (-1);
@@ -1339,7 +1339,7 @@ static int testDomainSave(virDomainPtr domain,
free(xml);
if (close(fd) < 0) {
testError(domain->conn, domain, NULL, VIR_ERR_INTERNAL_ERROR,
- "cannot save domain data");
+ _("cannot save domain data"));
close(fd);
return (-1);
}
@@ -1363,30 +1363,30 @@ static int testDomainRestore(virConnectPtr conn,
if ((fd = open(path, O_RDONLY)) < 0) {
testError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- "cannot read domain image");
+ _("cannot read domain image"));
return (-1);
}
if (read(fd, magic, sizeof(magic)) != sizeof(magic)) {
testError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- "incomplete save header");
+ _("incomplete save header"));
close(fd);
return (-1);
}
if (memcmp(magic, TEST_SAVE_MAGIC, sizeof(magic))) {
testError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- "mismatched header magic");
+ _("mismatched header magic"));
close(fd);
return (-1);
}
if (read(fd, (char*)&len, sizeof(len)) != sizeof(len)) {
testError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- "failed to read metadata length");
+ _("failed to read metadata length"));
close(fd);
return (-1);
}
if (len < 1 || len > 8192) {
testError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- "length of metadata out of range");
+ _("length of metadata out of range"));
close(fd);
return (-1);
}
@@ -1398,7 +1398,7 @@ static int testDomainRestore(virConnectPtr conn,
}
if (read(fd, xml, len) != len) {
testError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- "incomplete metdata");
+ _("incomplete metdata"));
close(fd);
return (-1);
}
@@ -1419,18 +1419,18 @@ static int testDomainCoreDump(virDomainPtr domain,
if ((fd = open(to, O_CREAT|O_TRUNC|O_WRONLY, S_IRUSR|S_IWUSR)) < 0) {
testError(domain->conn, domain, NULL, VIR_ERR_INTERNAL_ERROR,
- "cannot save domain core");
+ _("cannot save domain core"));
return (-1);
}
if (safewrite(fd, TEST_SAVE_MAGIC, sizeof(TEST_SAVE_MAGIC)) < 0) {
testError(domain->conn, domain, NULL, VIR_ERR_INTERNAL_ERROR,
- "cannot write header");
+ _("cannot write header"));
close(fd);
return (-1);
}
if (close(fd) < 0) {
testError(domain->conn, domain, NULL, VIR_ERR_INTERNAL_ERROR,
- "cannot save domain data");
+ _("cannot save domain data"));
close(fd);
return (-1);
}
--
1.5.5.rc0.22.g467c
2
2
[Libvir] [PATCH 9/9] lxcError: mark a string and add to the list of nearly-checked functions
by Jim Meyering 28 Mar '08
by Jim Meyering 28 Mar '08
28 Mar '08
lxcError: mark a string and add to the list of nearly-checked functions
* Makefile.maint (msg_gen_function): Add, but commented-out.
* src/lxc_conf.c (lxcParseXML): Mark a diagnostic for translation.
Signed-off-by: Jim Meyering <meyering(a)redhat.com>
---
Makefile.maint | 1 +
src/lxc_conf.c | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/Makefile.maint b/Makefile.maint
index 518e59b..a357d74 100644
--- a/Makefile.maint
+++ b/Makefile.maint
@@ -323,6 +323,7 @@ msg_gen_function += openvzLog
# msg_gen_function += error
# msg_gen_function += virXenError
# msg_gen_function += testError
+# msg_gen_function += lxcError
func_or := $(shell printf '$(msg_gen_function)'|tr -s '[[:space:]]' '|')
func_re := ($(func_or))
diff --git a/src/lxc_conf.c b/src/lxc_conf.c
index e0896ec..3923807 100644
--- a/src/lxc_conf.c
+++ b/src/lxc_conf.c
@@ -398,7 +398,7 @@ static lxc_vm_def_t * lxcParseXML(virConnectPtr conn, xmlDocPtr docPtr)
if ((xmlProp = xmlGetProp(rootNodePtr, BAD_CAST "id"))) {
if (0 > virStrToLong_i((char*)xmlProp, NULL, 10, &(containerDef->id))) {
lxcError(conn, NULL, VIR_ERR_INTERNAL_ERROR,
- "invalid domain id");
+ _("invalid domain id"));
goto error;
}
} else {
--
1.5.5.rc0.22.g467c
2
1
[Libvir] [PATCH 7/9] openvzLog: mark its string arguments for translation
by Jim Meyering 28 Mar '08
by Jim Meyering 28 Mar '08
28 Mar '08
openvzLog: mark its string arguments for translation
Signed-off-by: Jim Meyering <meyering(a)redhat.com>
---
Makefile.maint | 2 +-
src/openvz_conf.c | 35 ++++++++++++++++++++++-------------
src/openvz_driver.c | 25 +++++++++++++------------
3 files changed, 36 insertions(+), 26 deletions(-)
diff --git a/Makefile.maint b/Makefile.maint
index fce59b4..55a9677 100644
--- a/Makefile.maint
+++ b/Makefile.maint
@@ -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))
diff --git a/src/openvz_conf.c b/src/openvz_conf.c
index 4a2b037..65344c5 100644
--- a/src/openvz_conf.c
+++ b/src/openvz_conf.c
@@ -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);
diff --git a/src/openvz_driver.c b/src/openvz_driver.c
index 0e94d02..1db3c60 100644
--- a/src/openvz_driver.c
+++ b/src/openvz_driver.c
@@ -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);
--
1.5.5.rc0.22.g467c
2
1
28 Mar '08
error: mark most string arguments for translation
Also mark some arguments to __virRaiseError.
Signed-off-by: Jim Meyering <meyering(a)redhat.com>
---
Makefile.maint | 4 +-
po/POTFILES.in | 2 +
src/openvz_conf.c | 42 +++++++++++--------
src/openvz_driver.c | 31 +++++++++-----
src/remote_internal.c | 108 ++++++++++++++++++++++++++++---------------------
5 files changed, 110 insertions(+), 77 deletions(-)
diff --git a/Makefile.maint b/Makefile.maint
index 6e4868e..fce59b4 100644
--- a/Makefile.maint
+++ b/Makefile.maint
@@ -316,10 +316,12 @@ msg_gen_function += xenXMError
msg_gen_function += ReportError
msg_gen_function += qemudReportError
+# 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
-# msg_gen_function += error
func_or := $(shell printf '$(msg_gen_function)'|tr -s '[[:space:]]' '|')
func_re := ($(func_or))
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 54cb077..dfdb583 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -8,6 +8,8 @@ src/iptables.c
src/libvirt.c
src/lxc_conf.c
src/lxc_driver.c
+src/openvz_conf.c
+src/openvz_driver.c
src/proxy_internal.c
src/qemu_conf.c
src/qemu_driver.c
diff --git a/src/openvz_conf.c b/src/openvz_conf.c
index 364cb25..4a2b037 100644
--- a/src/openvz_conf.c
+++ b/src/openvz_conf.c
@@ -307,7 +307,7 @@ static struct openvz_vm_def
root = xmlDocGetRootElement(xml);
if ((root == NULL) || (!xmlStrEqual(root->name, BAD_CAST "domain"))) {
- error(conn, VIR_ERR_INTERNAL_ERROR, "incorrect root element");
+ error(conn, VIR_ERR_INTERNAL_ERROR, _("incorrect root element"));
goto bail_out;
}
@@ -319,12 +319,12 @@ static struct openvz_vm_def
/* Find out what type of OPENVZ virtualization to use */
if (!(prop = xmlGetProp(root, BAD_CAST "type"))) {
- error(conn, VIR_ERR_INTERNAL_ERROR, "missing domain type attribute");
+ error(conn, VIR_ERR_INTERNAL_ERROR, _("missing domain type attribute"));
goto bail_out;
}
if (strcmp((char *)prop, "openvz")){
- error(conn, VIR_ERR_INTERNAL_ERROR, "invalid domain type attribute");
+ error(conn, VIR_ERR_INTERNAL_ERROR, _("invalid domain type attribute"_));
goto bail_out;
}
free(prop);
@@ -334,14 +334,14 @@ static struct openvz_vm_def
obj = xmlXPathEval(BAD_CAST "string(/domain/name[1])", ctxt);
if ((obj == NULL) || (obj->type != XPATH_STRING) ||
(obj->stringval == NULL) || (obj->stringval[0] == 0)) {
- error(conn, VIR_ERR_INTERNAL_ERROR,"invalid domain name");
+ error(conn, VIR_ERR_INTERNAL_ERROR, _("invalid domain name"));
goto bail_out;
}
/* rejecting VPS ID <= OPENVZ_RSRV_VM_LIMIT for they are reserved */
if (strtoI((const char *) obj->stringval) <= OPENVZ_RSRV_VM_LIMIT) {
error(conn, VIR_ERR_INTERNAL_ERROR,
- "VPS ID Error (must be an integer greater than 100");
+ _("VPS ID Error (must be an integer greater than 100"));
goto bail_out;
}
strncpy(def->name, (const char *) obj->stringval, OPENVZ_NAME_MAX);
@@ -354,11 +354,11 @@ static struct openvz_vm_def
int err;
if ((err = virUUIDGenerate(def->uuid))) {
- error(conn, VIR_ERR_INTERNAL_ERROR, "Failed to generate UUID");
+ error(conn, VIR_ERR_INTERNAL_ERROR, _("Failed to generate UUID"));
goto bail_out;
}
} else if (virUUIDParse((const char *)obj->stringval, def->uuid) < 0) {
- error(conn, VIR_ERR_INTERNAL_ERROR, "malformed uuid element");
+ error(conn, VIR_ERR_INTERNAL_ERROR, _("malformed uuid element"));
goto bail_out;
}
xmlXPathFreeObject(obj);
@@ -389,7 +389,8 @@ static struct openvz_vm_def
if (xmlStrlen(obj->stringval) >= (OPENVZ_IP_MAX)) {
char errorMessage[OPENVZ_MAX_ERROR_LEN];
- snprintf(errorMessage, OPENVZ_MAX_ERROR_LEN - 1, "%s", "ipaddress length too long");
+ snprintf(errorMessage, OPENVZ_MAX_ERROR_LEN - 1, "%s",
+ _("ipaddress length too long"));
error(conn, VIR_ERR_INTERNAL_ERROR, errorMessage);
goto bail_out;
}
@@ -411,7 +412,8 @@ static struct openvz_vm_def
if (strlen((const char *) obj->stringval) >= (OPENVZ_IP_MAX)) {
char errorMessage[OPENVZ_MAX_ERROR_LEN];
- snprintf(errorMessage, OPENVZ_MAX_ERROR_LEN - 1, "%s", "netmask length too long");
+ snprintf(errorMessage, OPENVZ_MAX_ERROR_LEN - 1, "%s",
+ _("netmask length too long"));
error(conn, VIR_ERR_INTERNAL_ERROR, errorMessage);
goto bail_out;
}
@@ -427,7 +429,8 @@ static struct openvz_vm_def
if (strlen((const char *) obj->stringval) >= (OPENVZ_HOSTNAME_MAX - 1)) {
char errorMessage[OPENVZ_MAX_ERROR_LEN];
- snprintf(errorMessage, OPENVZ_MAX_ERROR_LEN - 1, "%s", "hostname length too long");
+ snprintf(errorMessage, OPENVZ_MAX_ERROR_LEN - 1,
+ "%s", _("hostname length too long"));
error(conn, VIR_ERR_INTERNAL_ERROR, errorMessage);
goto bail_out;
}
@@ -444,7 +447,8 @@ static struct openvz_vm_def
if (strlen((const char *) obj->stringval) >= (OPENVZ_IP_MAX)) {
char errorMessage[OPENVZ_MAX_ERROR_LEN];
- snprintf(errorMessage, OPENVZ_MAX_ERROR_LEN - 1, "%s", "gateway length too long");
+ snprintf(errorMessage, OPENVZ_MAX_ERROR_LEN - 1,
+ "%s", _("gateway length too long"));
error(conn, VIR_ERR_INTERNAL_ERROR, errorMessage);
goto bail_out;
}
@@ -461,7 +465,8 @@ static struct openvz_vm_def
if (strlen((const char *) obj->stringval) >= (OPENVZ_IP_MAX)) {
char errorMessage[OPENVZ_MAX_ERROR_LEN];
- snprintf(errorMessage, OPENVZ_MAX_ERROR_LEN - 1, "%s", "nameserver length too long");
+ snprintf(errorMessage, OPENVZ_MAX_ERROR_LEN - 1,
+ "%s", _("nameserver length too long"));
error(conn, VIR_ERR_INTERNAL_ERROR, errorMessage);
goto bail_out;
}
@@ -483,7 +488,8 @@ static struct openvz_vm_def
if (strlen((const char *) obj->stringval) >= (OPENVZ_PROFILE_MAX - 1)) {
char errorMessage[OPENVZ_MAX_ERROR_LEN];
- snprintf(errorMessage, OPENVZ_MAX_ERROR_LEN - 1, "%s", "profile length too long");
+ snprintf(errorMessage, OPENVZ_MAX_ERROR_LEN - 1,
+ "%s", _("profile length too long"));
error(conn, VIR_ERR_INTERNAL_ERROR, errorMessage);
goto bail_out;
}
@@ -519,14 +525,14 @@ openvzGetVPSInfo(virConnectPtr conn) {
driver->num_inactive = 0;
if((fp = popen(VZLIST " -a -ovpsid,status -H 2>/dev/null", "r")) == NULL) {
- error(conn, VIR_ERR_INTERNAL_ERROR, "popen failed");
+ error(conn, VIR_ERR_INTERNAL_ERROR, _("popen failed"));
return NULL;
}
pnext = &vm;
while(!feof(fp)) {
*pnext = calloc(1, sizeof(**pnext));
if(!*pnext) {
- error(conn, VIR_ERR_INTERNAL_ERROR, "calloc failed");
+ error(conn, VIR_ERR_INTERNAL_ERROR, _("calloc failed"));
goto error;
}
@@ -535,7 +541,7 @@ openvzGetVPSInfo(virConnectPtr conn) {
if (fscanf(fp, "%d %s\n", &veid, status) != 2) {
error(conn, VIR_ERR_INTERNAL_ERROR,
- "Failed to parse vzlist output");
+ _("Failed to parse vzlist output"));
goto error;
}
if(strcmp(status, "stopped")) {
@@ -555,7 +561,7 @@ openvzGetVPSInfo(virConnectPtr conn) {
vmdef = calloc(1, sizeof(*vmdef));
if(!vmdef) {
- error(conn, VIR_ERR_INTERNAL_ERROR, "calloc failed");
+ error(conn, VIR_ERR_INTERNAL_ERROR, _("calloc failed"));
goto error;
}
@@ -565,7 +571,7 @@ openvzGetVPSInfo(virConnectPtr conn) {
if(ret == -1) {
error(conn, VIR_ERR_INTERNAL_ERROR,
- "UUID in config file malformed");
+ _("UUID in config file malformed"));
free(vmdef);
goto error;
}
diff --git a/src/openvz_driver.c b/src/openvz_driver.c
index 29cb244..0e94d02 100644
--- a/src/openvz_driver.c
+++ b/src/openvz_driver.c
@@ -146,7 +146,7 @@ static virDomainPtr openvzDomainLookupByID(virConnectPtr conn,
virDomainPtr dom;
if (!vm) {
- error(conn, VIR_ERR_INTERNAL_ERROR, "no domain with matching id");
+ error(conn, VIR_ERR_INTERNAL_ERROR, _("no domain with matching id"));
return NULL;
}
@@ -174,7 +174,7 @@ static virDomainPtr openvzDomainLookupByUUID(virConnectPtr conn,
virDomainPtr dom;
if (!vm) {
- error(conn, VIR_ERR_INVALID_DOMAIN, "no domain with matching uuid");
+ error(conn, VIR_ERR_INVALID_DOMAIN, _("no domain with matching uuid"));
return NULL;
}
@@ -195,7 +195,7 @@ static virDomainPtr openvzDomainLookupByName(virConnectPtr conn,
virDomainPtr dom;
if (!vm) {
- error(conn, VIR_ERR_INTERNAL_ERROR, "no domain with matching name");
+ error(conn, VIR_ERR_INTERNAL_ERROR, _("no domain with matching name"));
return NULL;
}
@@ -215,7 +215,8 @@ static int openvzDomainGetInfo(virDomainPtr dom,
struct openvz_vm *vm = openvzFindVMByUUID(driver, dom->uuid);
if (!vm) {
- error(dom->conn, VIR_ERR_INVALID_DOMAIN, "no domain with matching uuid");
+ error(dom->conn, VIR_ERR_INVALID_DOMAIN,
+ _("no domain with matching uuid"));
return -1;
}
@@ -238,12 +239,14 @@ static int openvzDomainShutdown(virDomainPtr dom) {
struct openvz_vm *vm = openvzFindVMByID(driver, dom->id);
if (!vm) {
- error(dom->conn, VIR_ERR_INVALID_DOMAIN, "no domain with matching id");
+ error(dom->conn, VIR_ERR_INVALID_DOMAIN,
+ _("no domain with matching id"));
return -1;
}
if (vm->status != VIR_DOMAIN_RUNNING) {
- error(dom->conn, VIR_ERR_OPERATION_DENIED, "domain is not in running state");
+ error(dom->conn, VIR_ERR_OPERATION_DENIED,
+ _("domain is not in running state"));
return -1;
}
snprintf(cmdbuf, CMDBUF_LEN - 1, VZCTL " stop %d ", dom->id);
@@ -281,12 +284,14 @@ static int openvzDomainReboot(virDomainPtr dom,
struct openvz_vm *vm = openvzFindVMByID(driver, dom->id);
if (!vm) {
- error(dom->conn, VIR_ERR_INVALID_DOMAIN, "no domain with matching id");
+ error(dom->conn, VIR_ERR_INVALID_DOMAIN,
+ _("no domain with matching id"));
return -1;
}
if (vm->status != VIR_DOMAIN_RUNNING) {
- error(dom->conn, VIR_ERR_OPERATION_DENIED, "domain is not in running state");
+ error(dom->conn, VIR_ERR_OPERATION_DENIED,
+ _("domain is not in running state"));
return -1;
}
snprintf(cmdbuf, CMDBUF_LEN - 1, VZCTL " restart %d ", dom->id);
@@ -473,12 +478,14 @@ openvzDomainCreate(virDomainPtr dom)
struct openvz_vm_def *vmdef;
if (!vm) {
- error(dom->conn, VIR_ERR_INVALID_DOMAIN, "no domain with matching id");
+ error(dom->conn, VIR_ERR_INVALID_DOMAIN,
+ _("no domain with matching id"));
return -1;
}
if (vm->status != VIR_DOMAIN_SHUTOFF) {
- error(dom->conn, VIR_ERR_OPERATION_DENIED, "domain is not in shutoff state");
+ error(dom->conn, VIR_ERR_OPERATION_DENIED,
+ _("domain is not in shutoff state"));
return -1;
}
@@ -518,12 +525,12 @@ openvzDomainUndefine(virDomainPtr dom)
struct openvz_vm *vm = openvzFindVMByUUID(driver, dom->uuid);
if (!vm) {
- error(conn, VIR_ERR_INVALID_DOMAIN, "no domain with matching uuid");
+ error(conn, VIR_ERR_INVALID_DOMAIN, _("no domain with matching uuid"));
return -1;
}
if (openvzIsActiveVM(vm)) {
- error(conn, VIR_ERR_INTERNAL_ERROR, "cannot delete active domain");
+ error(conn, VIR_ERR_INTERNAL_ERROR, _("cannot delete active domain"));
return -1;
}
snprintf(cmdbuf, CMDBUF_LEN - 1, VZCTL " destroy %s ", vm->vmdef->name);
diff --git a/src/remote_internal.c b/src/remote_internal.c
index 8d2d9e5..be4c573 100644
--- a/src/remote_internal.c
+++ b/src/remote_internal.c
@@ -879,7 +879,7 @@ check_cert_file (virConnectPtr conn, const char *type, const char *file)
if (stat(file, &sb) < 0) {
__virRaiseError (conn, NULL, NULL, VIR_FROM_REMOTE, VIR_ERR_RPC,
VIR_ERR_ERROR, LIBVIRT_CACERT, NULL, NULL, 0, 0,
- "Cannot access %s '%s': %s (%d)",
+ _("Cannot access %s '%s': %s (%d)"),
type, file, strerror(errno), errno);
return -1;
}
@@ -1018,7 +1018,7 @@ negotiate_gnutls_on_connection (virConnectPtr conn,
}
if (len != 1 || buf[0] != '\1') {
error (conn, VIR_ERR_RPC,
- "server verification (of our certificate or IP address) failed\n");
+ _("server verification (of our certificate or IP address) failed\n"));
return NULL;
}
@@ -1117,7 +1117,7 @@ verify_certificate (virConnectPtr conn ATTRIBUTE_UNUSED,
VIR_FROM_REMOTE, VIR_ERR_RPC,
VIR_ERR_ERROR, priv->hostname, NULL, NULL,
0, 0,
- "Certificate's owner does not match the hostname (%s)",
+ _("Certificate's owner does not match the hostname (%s)"),
priv->hostname);
gnutls_x509_crt_deinit (cert);
return -1;
@@ -3473,8 +3473,9 @@ remoteAuthenticate (virConnectPtr conn, struct private_data *priv, int in_open,
want = REMOTE_AUTH_POLKIT;
} else {
__virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
- VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
- "unknown authentication type %s", authtype);
+ VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR,
+ NULL, NULL, NULL, 0, 0,
+ _("unknown authentication type %s"), authtype);
return -1;
}
for (i = 0 ; i < ret.types.types_len ; i++) {
@@ -3484,7 +3485,8 @@ remoteAuthenticate (virConnectPtr conn, struct private_data *priv, int in_open,
if (type == REMOTE_AUTH_NONE) {
__virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
- "requested authentication type %s rejected", authtype);
+ _("requested authentication type %s rejected"),
+ authtype);
return -1;
}
} else {
@@ -3522,8 +3524,10 @@ remoteAuthenticate (virConnectPtr conn, struct private_data *priv, int in_open,
default:
__virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
- VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
- "unsupported authentication type %d", ret.types.types_val[0]);
+ VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR,
+ NULL, NULL, NULL, 0, 0,
+ _("unsupported authentication type %d"),
+ ret.types.types_val[0]);
free(ret.types.types_val);
return -1;
}
@@ -3550,15 +3554,18 @@ static char *addrToString(struct sockaddr_storage *sa, socklen_t salen)
port, sizeof(port),
NI_NUMERICHOST | NI_NUMERICSERV)) != 0) {
__virRaiseError (NULL, NULL, NULL, VIR_FROM_REMOTE,
- VIR_ERR_NO_MEMORY, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
- "Cannot resolve address %d: %s", err, gai_strerror(err));
+ VIR_ERR_NO_MEMORY, VIR_ERR_ERROR,
+ NULL, NULL, NULL, 0, 0,
+ _("Cannot resolve address %d: %s"),
+ err, gai_strerror(err));
return NULL;
}
addr = malloc(strlen(host) + 1 + strlen(port) + 1);
if (!addr) {
__virRaiseError (NULL, NULL, NULL, VIR_FROM_REMOTE,
- VIR_ERR_NO_MEMORY, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
+ VIR_ERR_NO_MEMORY, VIR_ERR_ERROR,
+ NULL, NULL, NULL, 0, 0,
"address");
return NULL;
}
@@ -3769,7 +3776,7 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv, int in_open,
if (err != SASL_OK) {
__virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
- "failed to initialize SASL library: %d (%s)",
+ _("failed to initialize SASL library: %d (%s)"),
err, sasl_errstring(err, NULL, NULL));
goto cleanup;
}
@@ -3779,7 +3786,7 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv, int in_open,
if (getsockname(priv->sock, (struct sockaddr*)&sa, &salen) < 0) {
__virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
- "failed to get sock address %d (%s)",
+ _("failed to get sock address %d (%s)"),
socket_errno (), strerror(socket_errno ()));
goto cleanup;
}
@@ -3791,7 +3798,7 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv, int in_open,
if (getpeername(priv->sock, (struct sockaddr*)&sa, &salen) < 0) {
__virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
- "failed to get peer address %d (%s)",
+ _("failed to get peer address %d (%s)"),
socket_errno (), strerror(socket_errno ()));
goto cleanup;
}
@@ -3817,7 +3824,7 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv, int in_open,
if (err != SASL_OK) {
__virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
- "Failed to create SASL client context: %d (%s)",
+ _("Failed to create SASL client context: %d (%s)"),
err, sasl_errstring(err, NULL, NULL));
goto cleanup;
}
@@ -3830,7 +3837,7 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv, int in_open,
if (!(ssf = (sasl_ssf_t)gnutls_cipher_get_key_size(cipher))) {
__virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_INTERNAL_ERROR, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
- "invalid cipher size for TLS session");
+ "%s", _("invalid cipher size for TLS session"));
goto cleanup;
}
ssf *= 8; /* key size is bytes, sasl wants bits */
@@ -3840,7 +3847,7 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv, int in_open,
if (err != SASL_OK) {
__virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_INTERNAL_ERROR, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
- "cannot set external SSF %d (%s)",
+ _("cannot set external SSF %d (%s)"),
err, sasl_errstring(err, NULL, NULL));
goto cleanup;
}
@@ -3859,7 +3866,7 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv, int in_open,
if (err != SASL_OK) {
__virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_INTERNAL_ERROR, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
- "cannot set security props %d (%s)",
+ _("cannot set security props %d (%s)"),
err, sasl_errstring(err, NULL, NULL));
goto cleanup;
}
@@ -3876,8 +3883,10 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv, int in_open,
if (wantmech) {
if (strstr(mechlist, wantmech) == NULL) {
__virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
- VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
- "SASL mechanism %s not supported by server", wantmech);
+ VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR,
+ NULL, NULL, NULL, 0, 0,
+ _("SASL mechanism %s not supported by server"),
+ wantmech);
free(iret.mechlist);
goto cleanup;
}
@@ -3895,7 +3904,7 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv, int in_open,
if (err != SASL_OK && err != SASL_CONTINUE && err != SASL_INTERACT) {
__virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
- "Failed to start SASL negotiation: %d (%s)",
+ _("Failed to start SASL negotiation: %d (%s)"),
err, sasl_errdetail(saslconn));
free(iret.mechlist);
goto cleanup;
@@ -3911,8 +3920,9 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv, int in_open,
if ((ncred =
remoteAuthMakeCredentials(interact, &cred)) < 0) {
__virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
- VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
- "Failed to make auth credentials");
+ VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR,
+ NULL, NULL, NULL, 0, 0,
+ "%s", _("Failed to make auth credentials"));
free(iret.mechlist);
goto cleanup;
}
@@ -3936,7 +3946,8 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv, int in_open,
if (clientoutlen > REMOTE_AUTH_SASL_DATA_MAX) {
__virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
- "SASL negotiation data too long: %d bytes", clientoutlen);
+ _("SASL negotiation data too long: %d bytes"),
+ clientoutlen);
goto cleanup;
}
/* NB, distinction of NULL vs "" is *critical* in SASL */
@@ -3975,7 +3986,7 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv, int in_open,
if (err != SASL_OK && err != SASL_CONTINUE && err != SASL_INTERACT) {
__virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
- "Failed SASL step: %d (%s)",
+ _("Failed SASL step: %d (%s)"),
err, sasl_errdetail(saslconn));
goto cleanup;
}
@@ -3989,7 +4000,7 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv, int in_open,
if ((ncred = remoteAuthMakeCredentials(interact, &cred)) < 0) {
__virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
- "Failed to make auth credentials");
+ "%s", _("Failed to make auth credentials"));
goto cleanup;
}
/* Run the authentication callback */
@@ -4053,7 +4064,7 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv, int in_open,
if (err != SASL_OK) {
__virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
- "cannot query SASL ssf on connection %d (%s)",
+ _("cannot query SASL ssf on connection %d (%s)"),
err, sasl_errstring(err, NULL, NULL));
goto cleanup;
}
@@ -4062,7 +4073,7 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv, int in_open,
if (ssf < 56) { /* 56 == DES level, good for Kerberos */
__virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
- "negotiation SSF %d was not strong enough", ssf);
+ _("negotiation SSF %d was not strong enough"), ssf);
goto cleanup;
}
}
@@ -4116,7 +4127,7 @@ remoteAuthPolkit (virConnectPtr conn, struct private_data *priv, int in_open,
if ((*(auth->cb))(&cred, 1, auth->cbdata) < 0) {
__virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
- "Failed to collect auth credentials");
+ _("Failed to collect auth credentials"));
return -1;
}
} else {
@@ -4183,7 +4194,7 @@ call (virConnectPtr conn, struct private_data *priv,
xdrmem_create (&xdr, buffer, sizeof buffer, XDR_ENCODE);
if (!xdr_remote_message_header (&xdr, &hdr)) {
error (flags & REMOTE_CALL_IN_OPEN ? NULL : conn,
- VIR_ERR_RPC, "xdr_remote_message_header");
+ VIR_ERR_RPC, _("xdr_remote_message_header failed"));
return -1;
}
@@ -4205,7 +4216,8 @@ call (virConnectPtr conn, struct private_data *priv,
/* Encode the length word. */
xdrmem_create (&xdr, buffer2, sizeof buffer2, XDR_ENCODE);
if (!xdr_int (&xdr, &len)) {
- error (flags & REMOTE_CALL_IN_OPEN ? NULL : conn, VIR_ERR_RPC, _("xdr_int (length word)"));
+ error (flags & REMOTE_CALL_IN_OPEN ? NULL : conn, VIR_ERR_RPC,
+ _("xdr_int (length word)"));
return -1;
}
xdr_destroy (&xdr);
@@ -4222,7 +4234,7 @@ call (virConnectPtr conn, struct private_data *priv,
xdrmem_create (&xdr, buffer2, sizeof buffer2, XDR_DECODE);
if (!xdr_int (&xdr, &len)) {
error (flags & REMOTE_CALL_IN_OPEN ? NULL : conn,
- VIR_ERR_RPC, "xdr_int (length word, reply)");
+ VIR_ERR_RPC, _("xdr_int (length word, reply)"));
return -1;
}
xdr_destroy (&xdr);
@@ -4232,7 +4244,7 @@ call (virConnectPtr conn, struct private_data *priv,
if (len < 0 || len > REMOTE_MESSAGE_MAX) {
error (flags & REMOTE_CALL_IN_OPEN ? NULL : conn,
- VIR_ERR_RPC, "packet received from server too large");
+ VIR_ERR_RPC, _("packet received from server too large"));
return -1;
}
@@ -4244,22 +4256,24 @@ call (virConnectPtr conn, struct private_data *priv,
xdrmem_create (&xdr, buffer, len, XDR_DECODE);
if (!xdr_remote_message_header (&xdr, &hdr)) {
error (flags & REMOTE_CALL_IN_OPEN ? NULL : conn,
- VIR_ERR_RPC, "xdr_remote_message_header (reply)");
+ VIR_ERR_RPC, _("invalid header in reply"));
return -1;
}
/* Check program, version, etc. are what we expect. */
if (hdr.prog != REMOTE_PROGRAM) {
- __virRaiseError (flags & REMOTE_CALL_IN_OPEN ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
+ __virRaiseError (flags & REMOTE_CALL_IN_OPEN ? NULL : conn,
+ NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_RPC, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
- "unknown program (received %x, expected %x)",
+ _("unknown program (received %x, expected %x)"),
hdr.prog, REMOTE_PROGRAM);
return -1;
}
if (hdr.vers != REMOTE_PROTOCOL_VERSION) {
- __virRaiseError (flags & REMOTE_CALL_IN_OPEN ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
+ __virRaiseError (flags & REMOTE_CALL_IN_OPEN ? NULL : conn,
+ NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_RPC, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
- "unknown protocol version (received %x, expected %x)",
+ _("unknown protocol version (received %x, expected %x)"),
hdr.vers, REMOTE_PROTOCOL_VERSION);
return -1;
}
@@ -4269,23 +4283,25 @@ call (virConnectPtr conn, struct private_data *priv,
* message being received at this point.
*/
if (hdr.proc != proc_nr) {
- __virRaiseError (flags & REMOTE_CALL_IN_OPEN ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
+ __virRaiseError (flags & REMOTE_CALL_IN_OPEN ? NULL : conn,
+ NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_RPC, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
- "unknown procedure (received %x, expected %x)",
+ _("unknown procedure (received %x, expected %x)"),
hdr.proc, proc_nr);
return -1;
}
if (hdr.direction != REMOTE_REPLY) {
- __virRaiseError (flags & REMOTE_CALL_IN_OPEN ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
+ __virRaiseError (flags & REMOTE_CALL_IN_OPEN ? NULL : conn,
+ NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_RPC, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
- "unknown direction (received %x, expected %x)",
+ _("unknown direction (received %x, expected %x)"),
hdr.direction, REMOTE_REPLY);
return -1;
}
if (hdr.serial != serial) {
__virRaiseError (flags & REMOTE_CALL_IN_OPEN ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_RPC, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
- "unknown serial (received %x, expected %x)",
+ _("unknown serial (received %x, expected %x)"),
hdr.serial, serial);
return -1;
}
@@ -4328,7 +4344,7 @@ call (virConnectPtr conn, struct private_data *priv,
default:
__virRaiseError (flags & REMOTE_CALL_IN_OPEN ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_RPC, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
- "unknown status (received %x)",
+ _("unknown status (received %x)"),
hdr.status);
xdr_destroy (&xdr);
return -1;
@@ -4437,7 +4453,7 @@ really_read_buf (virConnectPtr conn, struct private_data *priv,
}
if (err == 0) {
error (in_open ? NULL : conn,
- VIR_ERR_RPC, "socket closed unexpectedly");
+ VIR_ERR_RPC, _("socket closed unexpectedly"));
return -1;
}
return err;
@@ -4454,7 +4470,7 @@ really_read_buf (virConnectPtr conn, struct private_data *priv,
}
if (err == 0) {
error (in_open ? NULL : conn,
- VIR_ERR_RPC, "socket closed unexpectedly");
+ VIR_ERR_RPC, _("socket closed unexpectedly"));
return -1;
}
return err;
--
1.5.5.rc0.22.g467c
2
1
[Libvir] [PATCH 5/9] Convert diagnostics like "VAR > MAX_VAR" to translatable messages.
by Jim Meyering 28 Mar '08
by Jim Meyering 28 Mar '08
28 Mar '08
Convert diagnostics like "VAR > MAX_VAR" to translatable messages.
* src/remote_internal.c (errorf): New function.
(remoteListDomains, remoteDomainPinVcpu, remoteDomainGetVcpus):
(remoteListDefinedDomains, remoteListNetworks):
(remoteListDefinedNetworks):
Signed-off-by: Jim Meyering <meyering(a)redhat.com>
---
src/remote_internal.c | 79 +++++++++++++++++++++++++++++++++++++++---------
1 files changed, 64 insertions(+), 15 deletions(-)
diff --git a/src/remote_internal.c b/src/remote_internal.c
index 0909481..8d2d9e5 100644
--- a/src/remote_internal.c
+++ b/src/remote_internal.c
@@ -146,6 +146,8 @@ static int remoteAuthPolkit (virConnectPtr conn, struct private_data *priv, int
virConnectAuthPtr auth);
#endif /* HAVE_POLKIT */
static void error (virConnectPtr conn, virErrorNumber code, const char *info);
+static void errorf (virConnectPtr conn, virErrorNumber code,
+ const char *fmt, ...) ATTRIBUTE_FORMAT(printf, 3, 4);
static void server_error (virConnectPtr conn, remote_error *err);
static virDomainPtr get_nonnull_domain (virConnectPtr conn, remote_nonnull_domain domain);
static virNetworkPtr get_nonnull_network (virConnectPtr conn, remote_nonnull_network network);
@@ -1330,7 +1332,9 @@ remoteListDomains (virConnectPtr conn, int *ids, int maxids)
GET_PRIVATE (conn, -1);
if (maxids > REMOTE_DOMAIN_ID_LIST_MAX) {
- error (conn, VIR_ERR_RPC, _("maxids > REMOTE_DOMAIN_ID_LIST_MAX"));
+ errorf (conn, VIR_ERR_RPC,
+ _("too many remote domain IDs: %d > %d"),
+ maxids, REMOTE_DOMAIN_ID_LIST_MAX);
return -1;
}
args.maxids = maxids;
@@ -1342,7 +1346,9 @@ remoteListDomains (virConnectPtr conn, int *ids, int maxids)
return -1;
if (ret.ids.ids_len > maxids) {
- error (conn, VIR_ERR_RPC, _("ret.ids.ids_len > maxids"));
+ errorf (conn, VIR_ERR_RPC,
+ _("too many remote domain IDs: %d > %d"),
+ ret.ids.ids_len, maxids);
xdr_free ((xdrproc_t) xdr_remote_list_domains_ret, (char *) &ret);
return -1;
}
@@ -1714,7 +1720,9 @@ remoteDomainPinVcpu (virDomainPtr domain,
GET_PRIVATE (domain->conn, -1);
if (maplen > REMOTE_CPUMAP_MAX) {
- error (domain->conn, VIR_ERR_RPC, _("maplen > REMOTE_CPUMAP_MAX"));
+ errorf (domain->conn, VIR_ERR_RPC,
+ _("map length greater than maximum: %d > %d"),
+ maplen, REMOTE_CPUMAP_MAX);
return -1;
}
@@ -1744,12 +1752,15 @@ remoteDomainGetVcpus (virDomainPtr domain,
GET_PRIVATE (domain->conn, -1);
if (maxinfo > REMOTE_VCPUINFO_MAX) {
- error (domain->conn, VIR_ERR_RPC, _("maxinfo > REMOTE_VCPUINFO_MAX"));
+ errorf (domain->conn, VIR_ERR_RPC,
+ _("vCPU count exceeds maximum: %d > %d"),
+ maxinfo, REMOTE_VCPUINFO_MAX);
return -1;
}
if (maxinfo * maplen > REMOTE_CPUMAPS_MAX) {
- error (domain->conn, VIR_ERR_RPC,
- _("maxinfo * maplen > REMOTE_CPUMAPS_MAX"));
+ errorf (domain->conn, VIR_ERR_RPC,
+ _("vCPU map buffer length exceeds maximum: %d > %d"),
+ maxinfo * maplen, REMOTE_CPUMAPS_MAX);
return -1;
}
@@ -1764,13 +1775,16 @@ remoteDomainGetVcpus (virDomainPtr domain,
return -1;
if (ret.info.info_len > maxinfo) {
- error (domain->conn, VIR_ERR_RPC, _("ret.info.info_len > maxinfo"));
+ errorf (domain->conn, VIR_ERR_RPC,
+ _("host reports too many vCPUs: %d > %d"),
+ ret.info.info_len, maxinfo);
xdr_free ((xdrproc_t) xdr_remote_domain_get_vcpus_ret, (char *) &ret);
return -1;
}
if (ret.cpumaps.cpumaps_len > maxinfo * maplen) {
- error (domain->conn, VIR_ERR_RPC,
- _("ret.cpumaps.cpumaps_len > maxinfo * maplen"));
+ errorf (domain->conn, VIR_ERR_RPC,
+ _("host reports map buffer length exceeds maximum: %d > %d"),
+ ret.cpumaps.cpumaps_len, maxinfo * maplen);
xdr_free ((xdrproc_t) xdr_remote_domain_get_vcpus_ret, (char *) &ret);
return -1;
}
@@ -1930,7 +1944,9 @@ remoteListDefinedDomains (virConnectPtr conn, char **const names, int maxnames)
GET_PRIVATE (conn, -1);
if (maxnames > REMOTE_DOMAIN_NAME_LIST_MAX) {
- error (conn, VIR_ERR_RPC, _("maxnames > REMOTE_DOMAIN_NAME_LIST_MAX"));
+ errorf (conn, VIR_ERR_RPC,
+ _("too many remote domain names: %d > %d"),
+ maxnames, REMOTE_DOMAIN_NAME_LIST_MAX);
return -1;
}
args.maxnames = maxnames;
@@ -1942,7 +1958,9 @@ remoteListDefinedDomains (virConnectPtr conn, char **const names, int maxnames)
return -1;
if (ret.names.names_len > maxnames) {
- error (conn, VIR_ERR_RPC, _("ret.names.names_len > maxnames"));
+ errorf (conn, VIR_ERR_RPC,
+ _("too many remote domain names: %d > %d"),
+ ret.names.names_len, maxnames);
xdr_free ((xdrproc_t) xdr_remote_list_defined_domains_ret, (char *) &ret);
return -1;
}
@@ -2390,7 +2408,9 @@ remoteListNetworks (virConnectPtr conn, char **const names, int maxnames)
GET_NETWORK_PRIVATE (conn, -1);
if (maxnames > REMOTE_NETWORK_NAME_LIST_MAX) {
- error (conn, VIR_ERR_RPC, _("maxnames > REMOTE_NETWORK_NAME_LIST_MAX"));
+ errorf (conn, VIR_ERR_RPC,
+ _("too many remote networks: %d > %d"),
+ maxnames, REMOTE_NETWORK_NAME_LIST_MAX);
return -1;
}
args.maxnames = maxnames;
@@ -2402,7 +2422,9 @@ remoteListNetworks (virConnectPtr conn, char **const names, int maxnames)
return -1;
if (ret.names.names_len > maxnames) {
- error (conn, VIR_ERR_RPC, _("ret.names.names_len > maxnames"));
+ errorf (conn, VIR_ERR_RPC,
+ _("too many remote networks: %d > %d"),
+ ret.names.names_len, maxnames);
xdr_free ((xdrproc_t) xdr_remote_list_networks_ret, (char *) &ret);
return -1;
}
@@ -2445,7 +2467,9 @@ remoteListDefinedNetworks (virConnectPtr conn,
GET_NETWORK_PRIVATE (conn, -1);
if (maxnames > REMOTE_NETWORK_NAME_LIST_MAX) {
- error (conn, VIR_ERR_RPC, _("maxnames > REMOTE_NETWORK_NAME_LIST_MAX"));
+ errorf (conn, VIR_ERR_RPC,
+ _("too many remote networks: %d > %d"),
+ maxnames, REMOTE_NETWORK_NAME_LIST_MAX);
return -1;
}
args.maxnames = maxnames;
@@ -2457,7 +2481,9 @@ remoteListDefinedNetworks (virConnectPtr conn,
return -1;
if (ret.names.names_len > maxnames) {
- error (conn, VIR_ERR_RPC, _("ret.names.names_len > maxnames"));
+ errorf (conn, VIR_ERR_RPC,
+ _("too many remote networks: %d > %d"),
+ ret.names.names_len, maxnames);
xdr_free ((xdrproc_t) xdr_remote_list_defined_networks_ret, (char *) &ret);
return -1;
}
@@ -4518,6 +4544,29 @@ error (virConnectPtr conn, virErrorNumber code, const char *info)
errmsg, info);
}
+/* For errors internal to this library.
+ Identical to the above, but with a format string and optional params. */
+static void
+errorf (virConnectPtr conn, virErrorNumber code, const char *fmt, ...)
+{
+ const char *errmsg;
+ va_list args;
+ char errorMessage[256];
+
+ if (fmt) {
+ va_start(args, fmt);
+ vsnprintf(errorMessage, sizeof errorMessage - 1, fmt, args);
+ va_end(args);
+ } else {
+ errorMessage[0] = '\0';
+ }
+
+ errmsg = __virErrorMsg (code, errorMessage);
+ __virRaiseError (conn, NULL, NULL, VIR_FROM_REMOTE,
+ code, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
+ "%s", errmsg);
+}
+
/* For errors generated on the server side and sent back to us. */
static void
server_error (virConnectPtr conn, remote_error *err)
--
1.5.5.rc0.22.g467c
2
1
[Libvir] [PATCH 3/9] ReportError: mark for translation string args to this function
by Jim Meyering 28 Mar '08
by Jim Meyering 28 Mar '08
28 Mar '08
ReportError: mark for translation string args to this function
Signed-off-by: Jim Meyering <meyering(a)redhat.com>
---
Makefile.maint | 2 +-
src/util.c | 21 +++++++++++----------
2 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/Makefile.maint b/Makefile.maint
index ff09660..ccf6f5d 100644
--- a/Makefile.maint
+++ b/Makefile.maint
@@ -313,9 +313,9 @@ msg_gen_function += qemudLog
msg_gen_function += remoteDispatchError
msg_gen_function += virStorageLog
msg_gen_function += xenXMError
+msg_gen_function += ReportError
# msg_gen_function += virXenError
-# msg_gen_function += ReportError
# msg_gen_function += testError
# msg_gen_function += openvzLog
# msg_gen_function += qemudReportError
diff --git a/src/util.c b/src/util.c
index 188b7a8..0667780 100644
--- a/src/util.c
+++ b/src/util.c
@@ -106,21 +106,22 @@ _virExec(virConnectPtr conn,
int pipeerr[2] = {-1,-1};
if ((null = open(_PATH_DEVNULL, O_RDONLY)) < 0) {
- ReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "cannot open %s : %s",
- _PATH_DEVNULL, strerror(errno));
+ ReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ _("cannot open %s: %s"),
+ _PATH_DEVNULL, strerror(errno));
goto cleanup;
}
if ((outfd != NULL && pipe(pipeout) < 0) ||
(errfd != NULL && pipe(pipeerr) < 0)) {
- ReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "cannot create pipe : %s",
- strerror(errno));
+ ReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ _("cannot create pipe: %s"), strerror(errno));
goto cleanup;
}
if ((pid = fork()) < 0) {
- ReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "cannot fork child process : %s",
- strerror(errno));
+ ReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ _("cannot fork child process: %s"), strerror(errno));
goto cleanup;
}
@@ -131,11 +132,11 @@ _virExec(virConnectPtr conn,
if(non_block)
if(virSetNonBlock(pipeout[0]) == -1)
ReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- "Failed to set non-blocking file descriptor flag");
+ _("Failed to set non-blocking file descriptor flag"));
if(virSetCloseExec(pipeout[0]) == -1)
ReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- "Failed to set close-on-exec file descriptor flag");
+ _("Failed to set close-on-exec file descriptor flag"));
*outfd = pipeout[0];
}
if (errfd) {
@@ -143,11 +144,11 @@ _virExec(virConnectPtr conn,
if(non_block)
if(virSetNonBlock(pipeerr[0]) == -1)
ReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- "Failed to set non-blocking file descriptor flag");
+ _("Failed to set non-blocking file descriptor flag"));
if(virSetCloseExec(pipeerr[0]) == -1)
ReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- "Failed to set close-on-exec file descriptor flag");
+ _("Failed to set close-on-exec file descriptor flag"));
*errfd = pipeerr[0];
}
*retpid = pid;
--
1.5.5.rc0.22.g467c
2
1
[Libvir] [PATCH 2/9] xenXMError: mark for translation string args to this function
by Jim Meyering 28 Mar '08
by Jim Meyering 28 Mar '08
28 Mar '08
xenXMError: mark for translation string args to this function
Signed-off-by: Jim Meyering <meyering(a)redhat.com>
---
Makefile.maint | 2 +-
src/xm_internal.c | 81 +++++++++++++++++++++++++++++++++-------------------
2 files changed, 52 insertions(+), 31 deletions(-)
diff --git a/Makefile.maint b/Makefile.maint
index d870bfd..ff09660 100644
--- a/Makefile.maint
+++ b/Makefile.maint
@@ -312,8 +312,8 @@ msg_gen_function += virLog
msg_gen_function += qemudLog
msg_gen_function += remoteDispatchError
msg_gen_function += virStorageLog
+msg_gen_function += xenXMError
-# msg_gen_function += xenXMError
# msg_gen_function += virXenError
# msg_gen_function += ReportError
# msg_gen_function += testError
diff --git a/src/xm_internal.c b/src/xm_internal.c
index 55684e7..f609029 100644
--- a/src/xm_internal.c
+++ b/src/xm_internal.c
@@ -1904,26 +1904,30 @@ virConfPtr xenXMParseXMLToConfig(virConnectPtr conn, const char *xml) {
XML_PARSE_NOENT | XML_PARSE_NONET |
XML_PARSE_NOERROR | XML_PARSE_NOWARNING);
if (doc == NULL) {
- xenXMError(conn, VIR_ERR_XML_ERROR, "cannot read XML domain definition");
+ xenXMError(conn, VIR_ERR_XML_ERROR,
+ _("cannot read XML domain definition"));
return (NULL);
}
node = xmlDocGetRootElement(doc);
if ((node == NULL) || (!xmlStrEqual(node->name, BAD_CAST "domain"))) {
- xenXMError(conn, VIR_ERR_XML_ERROR, "missing top level domain element");
+ xenXMError(conn, VIR_ERR_XML_ERROR,
+ _("missing top level domain element"));
goto error;
}
prop = xmlGetProp(node, BAD_CAST "type");
if (prop != NULL) {
if (!xmlStrEqual(prop, BAD_CAST "xen")) {
- xenXMError(conn, VIR_ERR_XML_ERROR, "domain type is invalid");
+ xenXMError(conn, VIR_ERR_XML_ERROR,
+ _("domain type is invalid"));
goto error;
}
xmlFree(prop);
prop = NULL;
}
if (!(ctxt = xmlXPathNewContext(doc))) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR, "cannot create XPath context");
+ xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("cannot create XPath context"));
goto error;
}
if (!(conf = virConfNew()))
@@ -2117,7 +2121,7 @@ virConfPtr xenXMParseXMLToConfig(virConnectPtr conn, const char *xml) {
if ((obj != NULL) && (obj->type == XPATH_NODESET) &&
(obj->nodesetval != NULL) && (obj->nodesetval->nodeNr >= 0)) {
if (!(vfb = malloc(sizeof(*vfb)))) {
- xenXMError(conn, VIR_ERR_NO_MEMORY, "config");
+ xenXMError(conn, VIR_ERR_NO_MEMORY, _("config"));
goto error;
}
vfb->type = VIR_CONF_LIST;
@@ -2183,7 +2187,7 @@ virConfPtr xenXMParseXMLToConfig(virConnectPtr conn, const char *xml) {
virConfValuePtr disp;
if (!(disp = malloc(sizeof(*disp)))) {
free(val);
- xenXMError(conn, VIR_ERR_NO_MEMORY, "config");
+ xenXMError(conn, VIR_ERR_NO_MEMORY, _("config"));
goto error;
}
disp->type = VIR_CONF_STRING;
@@ -2204,7 +2208,7 @@ virConfPtr xenXMParseXMLToConfig(virConnectPtr conn, const char *xml) {
(obj->nodesetval != NULL) && (obj->nodesetval->nodeNr >= 0)) {
virConfValuePtr disks;
if (!(disks = malloc(sizeof(*disks)))) {
- xenXMError(conn, VIR_ERR_NO_MEMORY, "config");
+ xenXMError(conn, VIR_ERR_NO_MEMORY, _("config"));
goto error;
}
disks->type = VIR_CONF_LIST;
@@ -2217,7 +2221,7 @@ virConfPtr xenXMParseXMLToConfig(virConnectPtr conn, const char *xml) {
if (disk) {
if (!(thisDisk = malloc(sizeof(*thisDisk)))) {
free(disk);
- xenXMError(conn, VIR_ERR_NO_MEMORY, "config");
+ xenXMError(conn, VIR_ERR_NO_MEMORY, _("config"));
goto error;
}
thisDisk->type = VIR_CONF_STRING;
@@ -2236,7 +2240,7 @@ virConfPtr xenXMParseXMLToConfig(virConnectPtr conn, const char *xml) {
(obj->nodesetval != NULL) && (obj->nodesetval->nodeNr >= 0)) {
virConfValuePtr vifs;
if (!(vifs = malloc(sizeof(*vifs)))) {
- xenXMError(conn, VIR_ERR_NO_MEMORY, "config");
+ xenXMError(conn, VIR_ERR_NO_MEMORY, _("config"));
goto error;
}
vifs->type = VIR_CONF_LIST;
@@ -2248,7 +2252,7 @@ virConfPtr xenXMParseXMLToConfig(virConnectPtr conn, const char *xml) {
goto error;
if (!(thisVif = malloc(sizeof(*thisVif)))) {
free(vif);
- xenXMError(conn, VIR_ERR_NO_MEMORY, "config");
+ xenXMError(conn, VIR_ERR_NO_MEMORY, _("config"));
goto error;
}
thisVif->type = VIR_CONF_STRING;
@@ -2324,7 +2328,8 @@ virDomainPtr xenXMDomainDefineXML(virConnectPtr conn, const char *xml) {
if (!(value = virConfGetValue(conf, "name")) ||
value->type != VIR_CONF_STRING ||
value->str == NULL) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR, "name config parameter is missing");
+ xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("name config parameter is missing"));
goto error;
}
@@ -2332,17 +2337,20 @@ virDomainPtr xenXMDomainDefineXML(virConnectPtr conn, const char *xml) {
/* domain exists, we will overwrite it */
if (!(oldfilename = (char *)virHashLookup(nameConfigMap, value->str))) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR, "can't retrieve config filename for domain to overwrite");
+ xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("can't retrieve config filename for domain to overwrite"));
goto error;
}
if (!(entry = virHashLookup(configCache, oldfilename))) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR, "can't retrieve config entry for domain to overwrite");
+ xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("can't retrieve config entry for domain to overwrite"));
goto error;
}
if (xenXMConfigGetUUID(entry->conf, "uuid", uuid) < 0) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR, "uuid config parameter is missing");
+ xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("uuid config parameter is missing"));
goto error;
}
@@ -2351,13 +2359,15 @@ virDomainPtr xenXMDomainDefineXML(virConnectPtr conn, const char *xml) {
/* Remove the name -> filename mapping */
if (virHashRemoveEntry(nameConfigMap, value->str, NULL) < 0) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR, "failed to remove old domain from config map");
+ xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("failed to remove old domain from config map"));
goto error;
}
/* Remove the config record itself */
if (virHashRemoveEntry(configCache, oldfilename, xenXMConfigFree) < 0) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR, "failed to remove old domain from config map");
+ xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("failed to remove old domain from config map"));
goto error;
}
@@ -2365,7 +2375,8 @@ virDomainPtr xenXMDomainDefineXML(virConnectPtr conn, const char *xml) {
}
if ((strlen(configDir) + 1 + strlen(value->str) + 1) > PATH_MAX) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR, "config file name is too long");
+ xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("config file name is too long"));
goto error;
}
@@ -2374,17 +2385,19 @@ virDomainPtr xenXMDomainDefineXML(virConnectPtr conn, const char *xml) {
strcat(filename, value->str);
if (virConfWriteFile(filename, conf) < 0) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR, "unable to write config file");
+ xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("unable to write config file"));
goto error;
}
if (!(entry = calloc(1, sizeof(*entry)))) {
- xenXMError(conn, VIR_ERR_NO_MEMORY, "config");
+ xenXMError(conn, VIR_ERR_NO_MEMORY, _("config"));
goto error;
}
if ((entry->refreshedAt = time(NULL)) == ((time_t)-1)) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR, "unable to get current time");
+ xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("unable to get current time"));
goto error;
}
@@ -2392,18 +2405,21 @@ virDomainPtr xenXMDomainDefineXML(virConnectPtr conn, const char *xml) {
entry->conf = conf;
if (xenXMConfigGetUUID(conf, "uuid", uuid) < 0) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR, "uuid config parameter is missing");
+ xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("uuid config parameter is missing"));
goto error;
}
if (virHashAddEntry(configCache, filename, entry) < 0) {
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR, "unable to store config file handle");
+ xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("unable to store config file handle"));
goto error;
}
if (virHashAddEntry(nameConfigMap, value->str, entry->filename) < 0) {
virHashRemoveEntry(configCache, filename, NULL);
- xenXMError(conn, VIR_ERR_INTERNAL_ERROR, "unable to store config file handle");
+ xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("unable to store config file handle"));
goto error;
}
@@ -2570,11 +2586,13 @@ xenXMDomainAttachDevice(virDomainPtr domain, const char *xml) {
XML_PARSE_NOENT | XML_PARSE_NONET |
XML_PARSE_NOERROR | XML_PARSE_NOWARNING);
if (!doc) {
- xenXMError(domain->conn, VIR_ERR_XML_ERROR, "cannot read XML domain definition");
+ xenXMError(domain->conn, VIR_ERR_XML_ERROR,
+ _("cannot read XML domain definition"));
goto cleanup;
}
if (!(ctxt = xmlXPathNewContext(doc))) {
- xenXMError(domain->conn, VIR_ERR_INTERNAL_ERROR, "cannot create XPath context");
+ xenXMError(domain->conn, VIR_ERR_INTERNAL_ERROR,
+ _("cannot create XPath context"));
goto cleanup;
}
obj = xmlXPathEval(BAD_CAST "string(/domain/os/type)", ctxt);
@@ -2591,12 +2609,12 @@ xenXMDomainAttachDevice(virDomainPtr domain, const char *xml) {
XML_PARSE_NOERROR | XML_PARSE_NOWARNING);
if (!doc) {
xenXMError(domain->conn, VIR_ERR_XML_ERROR,
- "cannot read XML domain definition");
+ _("cannot read XML domain definition"));
goto cleanup;
}
if (!(ctxt = xmlXPathNewContext(doc))) {
xenXMError(domain->conn, VIR_ERR_INTERNAL_ERROR,
- "cannot create XPath context");
+ _("cannot create XPath context"));
goto cleanup;
}
@@ -2607,7 +2625,8 @@ xenXMDomainAttachDevice(virDomainPtr domain, const char *xml) {
if (xenXMAttachInterface(domain, ctxt, hvm, node, entry))
goto cleanup;
} else {
- xenXMError(domain->conn, VIR_ERR_XML_ERROR, "unknown device");
+ xenXMError(domain->conn, VIR_ERR_XML_ERROR,
+ _("unknown device"));
goto cleanup;
}
@@ -2989,11 +3008,13 @@ xenXMDomainDetachDevice(virDomainPtr domain, const char *xml) {
XML_PARSE_NOENT | XML_PARSE_NONET |
XML_PARSE_NOERROR | XML_PARSE_NOWARNING);
if (!doc) {
- xenXMError(domain->conn, VIR_ERR_XML_ERROR, "cannot read XML domain definition");
+ xenXMError(domain->conn, VIR_ERR_XML_ERROR,
+ _("cannot read XML domain definition"));
goto cleanup;
}
if (!(ctxt = xmlXPathNewContext(doc))) {
- xenXMError(domain->conn, VIR_ERR_INTERNAL_ERROR, "cannot create XPath context");
+ xenXMError(domain->conn, VIR_ERR_INTERNAL_ERROR,
+ _("cannot create XPath context"));
goto cleanup;
}
--
1.5.5.rc0.22.g467c
2
1
Mark many more strings for translation.
* Makefile.maint (err_func_re): Add to the list and make it readable.
* po/POTFILES.in: Add src/util.c and src/xm_internal.c, and sort.
Signed-off-by: Jim Meyering <meyering(a)redhat.com>
---
Makefile.maint | 33 +++++++-
po/POTFILES.in | 10 ++-
qemud/remote.c | 197 +++++++++++++++++++++++++------------------------
src/qemu_driver.c | 137 ++++++++++++++++++++--------------
src/storage_backend.c | 2 +-
src/util.c | 2 +-
src/virsh.c | 11 ++-
src/xm_internal.c | 16 +++--
8 files changed, 233 insertions(+), 175 deletions(-)
diff --git a/Makefile.maint b/Makefile.maint
index 879f211..d870bfd 100644
--- a/Makefile.maint
+++ b/Makefile.maint
@@ -298,8 +298,31 @@ sc_two_space_separator_in_usage:
echo "$(ME): an option and its description"; \
1>&2; exit 1; } || :
-err_func_re = \
-(DISABLE_fprintf|qemudLog|(xmlRpc|vir(Xend|XML|Hash|Conf|Test|LibConn|StorageReport|lxc))Error)
+msg_gen_function =
+msg_gen_function += DISABLE_fprintf
+msg_gen_function += virXendError
+msg_gen_function += virXMLError
+msg_gen_function += virHashError
+msg_gen_function += virConfError
+msg_gen_function += virTestError
+msg_gen_function += virLibConnError
+msg_gen_function += virStorageReportError
+msg_gen_function += virxmlRpcError
+msg_gen_function += virLog
+msg_gen_function += qemudLog
+msg_gen_function += remoteDispatchError
+msg_gen_function += virStorageLog
+
+# msg_gen_function += xenXMError
+# msg_gen_function += virXenError
+# msg_gen_function += ReportError
+# msg_gen_function += testError
+# msg_gen_function += openvzLog
+# msg_gen_function += qemudReportError
+# msg_gen_function += error
+
+func_or := $(shell printf '$(msg_gen_function)'|tr -s '[[:space:]]' '|')
+func_re := ($(func_or))
# Look for diagnostics that aren't marked for translation.
# This won't find any for which error's format string is on a separate line.
@@ -308,12 +331,12 @@ err_func_re = \
# "%s", _("no storage vol w..."
sc_unmarked_diagnostics:
@grep -nE \
- '\<(vshError|error) \([^"]*"[^"]*[a-z]{3}' $$($(VC_LIST_EXCEPT)) \
+ '\<$(func_re) \([^"]*"[^"]*[a-z]{3}' $$($(VC_LIST_EXCEPT)) \
| grep -v '_''(' && \
{ echo '$(ME): found unmarked diagnostic(s)' 1>&2; \
exit 1; } || :
- @{ grep -nE '\<$(err_func_re) *\(.*;$$' $$($(VC_LIST_EXCEPT)); \
- grep -A1 -nE '\<$(err_func_re) *\(.*,$$' $$($(VC_LIST_EXCEPT)); } \
+ @{ grep -nE '\<$(func_re) *\(.*;$$' $$($(VC_LIST_EXCEPT)); \
+ grep -A1 -nE '\<$(func_re) *\(.*,$$' $$($(VC_LIST_EXCEPT)); } \
| sed 's/_("[^"][^"]*"//;s/[ ]"%s"//' \
| grep '[ ]"' && \
{ echo '$(ME): found unmarked diagnostic(s)' 1>&2; \
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 25e38ea..54cb077 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,6 +1,6 @@
gnulib/lib/gai_strerror.c
-qemud/remote.c
qemud/qemud.c
+qemud/remote.c
src/conf.c
src/console.c
src/hash.c
@@ -12,20 +12,22 @@ src/proxy_internal.c
src/qemu_conf.c
src/qemu_driver.c
src/remote_internal.c
+src/sexpr.c
src/storage_backend.c
+src/storage_backend_disk.c
src/storage_backend_fs.c
-src/storage_backend_logical.c
src/storage_backend_iscsi.c
-src/storage_backend_disk.c
+src/storage_backend_logical.c
src/storage_conf.c
src/storage_driver.c
-src/sexpr.c
src/test.c
+src/util.c
src/uuid.c
src/virsh.c
src/virterror.c
src/xen_internal.c
src/xend_internal.c
+src/xm_internal.c
src/xml.c
src/xmlrpc.c
src/xs_internal.c
diff --git a/qemud/remote.c b/qemud/remote.c
index c7db5fa..82b8dce 100644
--- a/qemud/remote.c
+++ b/qemud/remote.c
@@ -101,32 +101,34 @@ remoteDispatchClientRequest (struct qemud_server *server,
xdrmem_create (&xdr, client->buffer, client->bufferLength, XDR_DECODE);
if (!xdr_remote_message_header (&xdr, &req)) {
- remoteDispatchError (client, NULL, "xdr_remote_message_header");
+ remoteDispatchError (client, NULL, "%s", _("xdr_remote_message_header"));
xdr_destroy (&xdr);
return;
}
/* Check version, etc. */
if (req.prog != REMOTE_PROGRAM) {
- remoteDispatchError (client, &req, "program mismatch (actual %x, expected %x)",
+ remoteDispatchError (client, &req,
+ _("program mismatch (actual %x, expected %x)"),
req.prog, REMOTE_PROGRAM);
xdr_destroy (&xdr);
return;
}
if (req.vers != REMOTE_PROTOCOL_VERSION) {
- remoteDispatchError (client, &req, "version mismatch (actual %x, expected %x)",
+ remoteDispatchError (client, &req,
+ _("version mismatch (actual %x, expected %x)"),
req.vers, REMOTE_PROTOCOL_VERSION);
xdr_destroy (&xdr);
return;
}
if (req.direction != REMOTE_CALL) {
- remoteDispatchError (client, &req, "direction (%d) != REMOTE_CALL",
+ remoteDispatchError (client, &req, _("direction (%d) != REMOTE_CALL"),
(int) req.direction);
xdr_destroy (&xdr);
return;
}
if (req.status != REMOTE_OK) {
- remoteDispatchError (client, &req, "status (%d) != REMOTE_OK",
+ remoteDispatchError (client, &req, _("status (%d) != REMOTE_OK"),
(int) req.status);
xdr_destroy (&xdr);
return;
@@ -142,7 +144,7 @@ remoteDispatchClientRequest (struct qemud_server *server,
req.proc != REMOTE_PROC_AUTH_SASL_STEP &&
req.proc != REMOTE_PROC_AUTH_POLKIT
) {
- remoteDispatchError (client, &req, "authentication required");
+ remoteDispatchError (client, &req, "%s", _("authentication required"));
xdr_destroy (&xdr);
return;
}
@@ -155,7 +157,7 @@ remoteDispatchClientRequest (struct qemud_server *server,
#include "remote_dispatch_proc_switch.h"
default:
- remoteDispatchError (client, &req, "unknown procedure: %d",
+ remoteDispatchError (client, &req, _("unknown procedure: %d"),
req.proc);
xdr_destroy (&xdr);
return;
@@ -163,7 +165,7 @@ remoteDispatchClientRequest (struct qemud_server *server,
/* Parse args. */
if (!(*args_filter) (&xdr, args)) {
- remoteDispatchError (client, &req, "parse args failed");
+ remoteDispatchError (client, &req, "%s", _("parse args failed"));
xdr_destroy (&xdr);
return;
}
@@ -178,7 +180,8 @@ remoteDispatchClientRequest (struct qemud_server *server,
* an internal error.
*/
if (rv < -2 || rv > 0) {
- remoteDispatchError (client, &req, "internal error - dispatch function returned invalid code %d", rv);
+ remoteDispatchError (client, &req,
+ _("internal error - dispatch function returned invalid code %d"), rv);
return;
}
@@ -200,14 +203,14 @@ remoteDispatchClientRequest (struct qemud_server *server,
len = 0; /* We'll come back and write this later. */
if (!xdr_int (&xdr, &len)) {
- remoteDispatchError (client, &req, "dummy length");
+ remoteDispatchError (client, &req, "%s", _("dummy length"));
xdr_destroy (&xdr);
if (rv == 0) xdr_free (ret_filter, ret);
return;
}
if (!xdr_remote_message_header (&xdr, &rep)) {
- remoteDispatchError (client, &req, "serialise reply header");
+ remoteDispatchError (client, &req, "%s", _("serialise reply header"));
xdr_destroy (&xdr);
if (rv == 0) xdr_free (ret_filter, ret);
return;
@@ -216,7 +219,7 @@ remoteDispatchClientRequest (struct qemud_server *server,
/* If OK, serialise return structure, if error serialise error. */
if (rv == 0) {
if (!(*ret_filter) (&xdr, ret)) {
- remoteDispatchError (client, &req, "serialise return struct");
+ remoteDispatchError (client, &req, "%s", _("serialise return struct"));
xdr_destroy (&xdr);
return;
}
@@ -271,7 +274,7 @@ remoteDispatchClientRequest (struct qemud_server *server,
}
if (!xdr_remote_error (&xdr, &error)) {
- remoteDispatchError (client, &req, "serialise return error");
+ remoteDispatchError (client, &req, "%s", _("serialise return error"));
xdr_destroy (&xdr);
return;
}
@@ -280,13 +283,13 @@ remoteDispatchClientRequest (struct qemud_server *server,
/* Write the length word. */
len = xdr_getpos (&xdr);
if (xdr_setpos (&xdr, 0) == 0) {
- remoteDispatchError (client, &req, "xdr_setpos");
+ remoteDispatchError (client, &req, "%s", _("xdr_setpos"));
xdr_destroy (&xdr);
return;
}
if (!xdr_int (&xdr, &len)) {
- remoteDispatchError (client, &req, "serialise return length");
+ remoteDispatchError (client, &req, "%s", _("serialise return length"));
xdr_destroy (&xdr);
return;
}
@@ -420,7 +423,7 @@ remoteDispatchOpen (struct qemud_server *server ATTRIBUTE_UNUSED,
/* Already opened? */
if (client->conn) {
- remoteDispatchError (client, req, "connection already open");
+ remoteDispatchError (client, req, "%s", _("connection already open"));
return -2;
}
@@ -446,7 +449,7 @@ remoteDispatchOpen (struct qemud_server *server ATTRIBUTE_UNUSED,
#define CHECK_CONN(client) \
if (!client->conn) { \
- remoteDispatchError (client, req, "connection not open"); \
+ remoteDispatchError (client, req, "%s", _("connection not open")); \
return -2; \
}
@@ -493,7 +496,7 @@ remoteDispatchGetType (struct qemud_server *server ATTRIBUTE_UNUSED,
*/
ret->type = strdup (type);
if (!ret->type) {
- remoteDispatchError (client, req, "out of memory in strdup");
+ remoteDispatchError (client, req, "%s", _("out of memory in strdup"));
return -2;
}
@@ -607,7 +610,7 @@ remoteDispatchDomainGetSchedulerType (struct qemud_server *server ATTRIBUTE_UNUS
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -638,19 +641,19 @@ remoteDispatchDomainGetSchedulerParameters (struct qemud_server *server ATTRIBUT
nparams = args->nparams;
if (nparams > REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX) {
- remoteDispatchError (client, req, "nparams too large");
+ remoteDispatchError (client, req, "%s", _("nparams too large"));
return -2;
}
params = malloc (sizeof (*params) * nparams);
if (params == NULL) {
- remoteDispatchError (client, req, "out of memory allocating array");
+ remoteDispatchError (client, req, "%s", _("out of memory allocating array"));
return -2;
}
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
free (params);
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -669,7 +672,7 @@ remoteDispatchDomainGetSchedulerParameters (struct qemud_server *server ATTRIBUT
virDomainFree(dom);
free (params);
remoteDispatchError (client, req,
- "out of memory allocating return array");
+ "%s", _("out of memory allocating return array"));
return -2;
}
@@ -680,7 +683,7 @@ remoteDispatchDomainGetSchedulerParameters (struct qemud_server *server ATTRIBUT
virDomainFree(dom);
free (params);
remoteDispatchError (client, req,
- "out of memory allocating return array");
+ "%s", _("out of memory allocating return array"));
return -2;
}
ret->params.params_val[i].value.type = params[i].type;
@@ -700,7 +703,7 @@ remoteDispatchDomainGetSchedulerParameters (struct qemud_server *server ATTRIBUT
default:
virDomainFree(dom);
free (params);
- remoteDispatchError (client, req, "unknown type");
+ remoteDispatchError (client, req, "%s", _("unknown type"));
return -2;
}
}
@@ -725,12 +728,12 @@ remoteDispatchDomainSetSchedulerParameters (struct qemud_server *server ATTRIBUT
nparams = args->params.params_len;
if (nparams > REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX) {
- remoteDispatchError (client, req, "nparams too large");
+ remoteDispatchError (client, req, "%s", _("nparams too large"));
return -2;
}
params = malloc (sizeof (*params) * nparams);
if (params == NULL) {
- remoteDispatchError (client, req, "out of memory allocating array");
+ remoteDispatchError (client, req, "%s", _("out of memory allocating array"));
return -2;
}
@@ -759,7 +762,7 @@ remoteDispatchDomainSetSchedulerParameters (struct qemud_server *server ATTRIBUT
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
free (params);
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -785,7 +788,7 @@ remoteDispatchDomainBlockStats (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
path = args->path;
@@ -816,7 +819,7 @@ remoteDispatchDomainInterfaceStats (struct qemud_server *server ATTRIBUTE_UNUSED
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
path = args->path;
@@ -848,7 +851,7 @@ remoteDispatchDomainAttachDevice (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -872,7 +875,7 @@ remoteDispatchDomainCreate (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -934,7 +937,7 @@ remoteDispatchDomainDestroy (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -956,7 +959,7 @@ remoteDispatchDomainDetachDevice (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -981,7 +984,7 @@ remoteDispatchDomainDumpXml (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -1007,7 +1010,7 @@ remoteDispatchDomainGetAutostart (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -1032,7 +1035,7 @@ remoteDispatchDomainGetInfo (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -1064,7 +1067,7 @@ remoteDispatchDomainGetMaxMemory (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -1089,7 +1092,7 @@ remoteDispatchDomainGetMaxVcpus (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -1114,7 +1117,7 @@ remoteDispatchDomainGetOsType (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -1143,19 +1146,19 @@ remoteDispatchDomainGetVcpus (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
if (args->maxinfo > REMOTE_VCPUINFO_MAX) {
virDomainFree(dom);
- remoteDispatchError (client, req, "maxinfo > REMOTE_VCPUINFO_MAX");
+ remoteDispatchError (client, req, "%s", _("maxinfo > REMOTE_VCPUINFO_MAX"));
return -2;
}
if (args->maxinfo * args->maplen > REMOTE_CPUMAPS_MAX) {
virDomainFree(dom);
- remoteDispatchError (client, req, "maxinfo * maplen > REMOTE_CPUMAPS_MAX");
+ remoteDispatchError (client, req, "%s", _("maxinfo * maplen > REMOTE_CPUMAPS_MAX"));
return -2;
}
@@ -1243,7 +1246,7 @@ remoteDispatchDomainMigratePerform (struct qemud_server *server ATTRIBUTE_UNUSED
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -1292,7 +1295,7 @@ remoteDispatchListDefinedDomains (struct qemud_server *server ATTRIBUTE_UNUSED,
if (args->maxnames > REMOTE_DOMAIN_NAME_LIST_MAX) {
remoteDispatchError (client, req,
- "maxnames > REMOTE_DOMAIN_NAME_LIST_MAX");
+ "%s", _("maxnames > REMOTE_DOMAIN_NAME_LIST_MAX"));
return -2;
}
@@ -1389,13 +1392,13 @@ remoteDispatchDomainPinVcpu (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
if (args->cpumap.cpumap_len > REMOTE_CPUMAP_MAX) {
virDomainFree(dom);
- remoteDispatchError (client, req, "cpumap_len > REMOTE_CPUMAP_MAX");
+ remoteDispatchError (client, req, "%s", _("cpumap_len > REMOTE_CPUMAP_MAX"));
return -2;
}
@@ -1422,7 +1425,7 @@ remoteDispatchDomainReboot (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -1461,7 +1464,7 @@ remoteDispatchDomainResume (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -1485,7 +1488,7 @@ remoteDispatchDomainSave (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -1509,7 +1512,7 @@ remoteDispatchDomainCoreDump (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -1533,7 +1536,7 @@ remoteDispatchDomainSetAutostart (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -1557,7 +1560,7 @@ remoteDispatchDomainSetMaxMemory (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -1581,7 +1584,7 @@ remoteDispatchDomainSetMemory (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -1605,7 +1608,7 @@ remoteDispatchDomainSetVcpus (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -1629,7 +1632,7 @@ remoteDispatchDomainShutdown (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -1653,7 +1656,7 @@ remoteDispatchDomainSuspend (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -1677,7 +1680,7 @@ remoteDispatchDomainUndefine (struct qemud_server *server ATTRIBUTE_UNUSED,
dom = get_nonnull_domain (client->conn, args->dom);
if (dom == NULL) {
- remoteDispatchError (client, req, "domain not found");
+ remoteDispatchError (client, req, "%s", _("domain not found"));
return -2;
}
@@ -1700,7 +1703,7 @@ remoteDispatchListDefinedNetworks (struct qemud_server *server ATTRIBUTE_UNUSED,
if (args->maxnames > REMOTE_NETWORK_NAME_LIST_MAX) {
remoteDispatchError (client, req,
- "maxnames > REMOTE_NETWORK_NAME_LIST_MAX");
+ "%s", _("maxnames > REMOTE_NETWORK_NAME_LIST_MAX"));
return -2;
}
@@ -1726,7 +1729,7 @@ remoteDispatchListDomains (struct qemud_server *server ATTRIBUTE_UNUSED,
if (args->maxids > REMOTE_DOMAIN_ID_LIST_MAX) {
remoteDispatchError (client, req,
- "maxids > REMOTE_DOMAIN_ID_LIST_MAX");
+ "%s", _("maxids > REMOTE_DOMAIN_ID_LIST_MAX"));
return -2;
}
@@ -1751,7 +1754,7 @@ remoteDispatchListNetworks (struct qemud_server *server ATTRIBUTE_UNUSED,
if (args->maxnames > REMOTE_NETWORK_NAME_LIST_MAX) {
remoteDispatchError (client, req,
- "maxnames > REMOTE_NETWORK_NAME_LIST_MAX");
+ "%s", _("maxnames > REMOTE_NETWORK_NAME_LIST_MAX"));
return -2;
}
@@ -1778,7 +1781,7 @@ remoteDispatchNetworkCreate (struct qemud_server *server ATTRIBUTE_UNUSED,
net = get_nonnull_network (client->conn, args->net);
if (net == NULL) {
- remoteDispatchError (client, req, "network not found");
+ remoteDispatchError (client, req, "%s", _("network not found"));
return -2;
}
@@ -1838,7 +1841,7 @@ remoteDispatchNetworkDestroy (struct qemud_server *server ATTRIBUTE_UNUSED,
net = get_nonnull_network (client->conn, args->net);
if (net == NULL) {
- remoteDispatchError (client, req, "network not found");
+ remoteDispatchError (client, req, "%s", _("network not found"));
return -2;
}
@@ -1862,7 +1865,7 @@ remoteDispatchNetworkDumpXml (struct qemud_server *server ATTRIBUTE_UNUSED,
net = get_nonnull_network (client->conn, args->net);
if (net == NULL) {
- remoteDispatchError (client, req, "network not found");
+ remoteDispatchError (client, req, "%s", _("network not found"));
return -2;
}
@@ -1888,7 +1891,7 @@ remoteDispatchNetworkGetAutostart (struct qemud_server *server ATTRIBUTE_UNUSED,
net = get_nonnull_network (client->conn, args->net);
if (net == NULL) {
- remoteDispatchError (client, req, "network not found");
+ remoteDispatchError (client, req, "%s", _("network not found"));
return -2;
}
@@ -1912,7 +1915,7 @@ remoteDispatchNetworkGetBridgeName (struct qemud_server *server ATTRIBUTE_UNUSED
net = get_nonnull_network (client->conn, args->net);
if (net == NULL) {
- remoteDispatchError (client, req, "network not found");
+ remoteDispatchError (client, req, "%s", _("network not found"));
return -2;
}
@@ -1974,7 +1977,7 @@ remoteDispatchNetworkSetAutostart (struct qemud_server *server ATTRIBUTE_UNUSED,
net = get_nonnull_network (client->conn, args->net);
if (net == NULL) {
- remoteDispatchError (client, req, "network not found");
+ remoteDispatchError (client, req, "%s", _("network not found"));
return -2;
}
@@ -1998,7 +2001,7 @@ remoteDispatchNetworkUndefine (struct qemud_server *server ATTRIBUTE_UNUSED,
net = get_nonnull_network (client->conn, args->net);
if (net == NULL) {
- remoteDispatchError (client, req, "network not found");
+ remoteDispatchError (client, req, "%s", _("network not found"));
return -2;
}
@@ -2089,13 +2092,14 @@ static char *addrToString(struct qemud_client *client,
port, sizeof(port),
NI_NUMERICHOST | NI_NUMERICSERV)) != 0) {
remoteDispatchError(client, req,
- "Cannot resolve address %d: %s", err, gai_strerror(err));
+ _("Cannot resolve address %d: %s"),
+ err, gai_strerror(err));
return NULL;
}
addr = malloc(strlen(host) + 1 + strlen(port) + 1);
if (!addr) {
- remoteDispatchError(client, req, "cannot allocate address");
+ remoteDispatchError(client, req, "%s", _("cannot allocate address"));
return NULL;
}
@@ -2137,7 +2141,8 @@ remoteDispatchAuthSaslInit (struct qemud_server *server ATTRIBUTE_UNUSED,
/* Get local address in form IPADDR:PORT */
salen = sizeof(sa);
if (getsockname(client->fd, (struct sockaddr*)&sa, &salen) < 0) {
- remoteDispatchError(client, req, "failed to get sock address %d (%s)",
+ remoteDispatchError(client, req,
+ _("failed to get sock address %d (%s)"),
errno, strerror(errno));
return -2;
}
@@ -2148,7 +2153,7 @@ remoteDispatchAuthSaslInit (struct qemud_server *server ATTRIBUTE_UNUSED,
/* Get remote address in form IPADDR:PORT */
salen = sizeof(sa);
if (getpeername(client->fd, (struct sockaddr*)&sa, &salen) < 0) {
- remoteDispatchError(client, req, "failed to get peer address %d (%s)",
+ remoteDispatchError(client, req, _("failed to get peer address %d (%s)"),
errno, strerror(errno));
free(localAddr);
return -2;
@@ -2413,7 +2418,8 @@ remoteDispatchAuthSaslStart (struct qemud_server *server,
if (serverout) {
ret->data.data_val = malloc(serveroutlen);
if (!ret->data.data_val) {
- remoteDispatchError (client, req, "out of memory allocating array");
+ remoteDispatchError (client, req,
+ "%s", _("out of memory allocating array"));
return -2;
}
memcpy(ret->data.data_val, serverout, serveroutlen);
@@ -2493,7 +2499,8 @@ remoteDispatchAuthSaslStep (struct qemud_server *server,
if (serverout) {
ret->data.data_val = malloc(serveroutlen);
if (!ret->data.data_val) {
- remoteDispatchError (client, req, "out of memory allocating array");
+ remoteDispatchError (client, req,
+ "%s", _("out of memory allocating array"));
return -2;
}
memcpy(ret->data.data_val, serverout, serveroutlen);
@@ -2737,7 +2744,7 @@ remoteDispatchListDefinedStoragePools (struct qemud_server *server ATTRIBUTE_UNU
if (args->maxnames > REMOTE_NETWORK_NAME_LIST_MAX) {
remoteDispatchError (client, req,
- "maxnames > REMOTE_NETWORK_NAME_LIST_MAX");
+ "%s", _("maxnames > REMOTE_NETWORK_NAME_LIST_MAX"));
return -2;
}
@@ -2763,7 +2770,7 @@ remoteDispatchListStoragePools (struct qemud_server *server ATTRIBUTE_UNUSED,
if (args->maxnames > REMOTE_STORAGE_POOL_NAME_LIST_MAX) {
remoteDispatchError (client, req,
- "maxnames > REMOTE_STORAGE_POOL_NAME_LIST_MAX");
+ "%s", _("maxnames > REMOTE_STORAGE_POOL_NAME_LIST_MAX"));
return -2;
}
@@ -2790,7 +2797,7 @@ remoteDispatchStoragePoolCreate (struct qemud_server *server ATTRIBUTE_UNUSED,
pool = get_nonnull_storage_pool (client->conn, args->pool);
if (pool == NULL) {
- remoteDispatchError (client, req, "storage_pool not found");
+ remoteDispatchError (client, req, "%s", _("storage_pool not found"));
return -2;
}
@@ -2850,7 +2857,7 @@ remoteDispatchStoragePoolBuild (struct qemud_server *server ATTRIBUTE_UNUSED,
pool = get_nonnull_storage_pool (client->conn, args->pool);
if (pool == NULL) {
- remoteDispatchError (client, req, "storage_pool not found");
+ remoteDispatchError (client, req, "%s", _("storage_pool not found"));
return -2;
}
@@ -2875,7 +2882,7 @@ remoteDispatchStoragePoolDestroy (struct qemud_server *server ATTRIBUTE_UNUSED,
pool = get_nonnull_storage_pool (client->conn, args->pool);
if (pool == NULL) {
- remoteDispatchError (client, req, "storage_pool not found");
+ remoteDispatchError (client, req, "%s", _("storage_pool not found"));
return -2;
}
@@ -2899,7 +2906,7 @@ remoteDispatchStoragePoolDelete (struct qemud_server *server ATTRIBUTE_UNUSED,
pool = get_nonnull_storage_pool (client->conn, args->pool);
if (pool == NULL) {
- remoteDispatchError (client, req, "storage_pool not found");
+ remoteDispatchError (client, req, "%s", _("storage_pool not found"));
return -2;
}
@@ -2923,7 +2930,7 @@ remoteDispatchStoragePoolRefresh (struct qemud_server *server ATTRIBUTE_UNUSED,
pool = get_nonnull_storage_pool (client->conn, args->pool);
if (pool == NULL) {
- remoteDispatchError (client, req, "storage_pool not found");
+ remoteDispatchError (client, req, "%s", _("storage_pool not found"));
return -2;
}
@@ -2948,7 +2955,7 @@ remoteDispatchStoragePoolGetInfo (struct qemud_server *server ATTRIBUTE_UNUSED,
pool = get_nonnull_storage_pool (client->conn, args->pool);
if (pool == NULL) {
- remoteDispatchError (client, req, "storage_pool not found");
+ remoteDispatchError (client, req, "%s", _("storage_pool not found"));
return -2;
}
@@ -2979,7 +2986,7 @@ remoteDispatchStoragePoolDumpXml (struct qemud_server *server ATTRIBUTE_UNUSED,
pool = get_nonnull_storage_pool (client->conn, args->pool);
if (pool == NULL) {
- remoteDispatchError (client, req, "storage_pool not found");
+ remoteDispatchError (client, req, "%s", _("storage_pool not found"));
return -2;
}
@@ -3005,7 +3012,7 @@ remoteDispatchStoragePoolGetAutostart (struct qemud_server *server ATTRIBUTE_UNU
pool = get_nonnull_storage_pool (client->conn, args->pool);
if (pool == NULL) {
- remoteDispatchError (client, req, "storage_pool not found");
+ remoteDispatchError (client, req, "%s", _("storage_pool not found"));
return -2;
}
@@ -3088,7 +3095,7 @@ remoteDispatchStoragePoolSetAutostart (struct qemud_server *server ATTRIBUTE_UNU
pool = get_nonnull_storage_pool (client->conn, args->pool);
if (pool == NULL) {
- remoteDispatchError (client, req, "storage_pool not found");
+ remoteDispatchError (client, req, "%s", _("storage_pool not found"));
return -2;
}
@@ -3112,7 +3119,7 @@ remoteDispatchStoragePoolUndefine (struct qemud_server *server ATTRIBUTE_UNUSED,
pool = get_nonnull_storage_pool (client->conn, args->pool);
if (pool == NULL) {
- remoteDispatchError (client, req, "storage_pool not found");
+ remoteDispatchError (client, req, "%s", _("storage_pool not found"));
return -2;
}
@@ -3166,13 +3173,13 @@ remoteDispatchStoragePoolListVolumes (struct qemud_server *server ATTRIBUTE_UNUS
if (args->maxnames > REMOTE_STORAGE_VOL_NAME_LIST_MAX) {
remoteDispatchError (client, req,
- "maxnames > REMOTE_STORAGE_VOL_NAME_LIST_MAX");
+ "%s", _("maxnames > REMOTE_STORAGE_VOL_NAME_LIST_MAX"));
return -2;
}
pool = get_nonnull_storage_pool (client->conn, args->pool);
if (pool == NULL) {
- remoteDispatchError (client, req, "storage_pool not found");
+ remoteDispatchError (client, req, "%s", _("storage_pool not found"));
return -2;
}
@@ -3201,7 +3208,7 @@ remoteDispatchStoragePoolNumOfVolumes (struct qemud_server *server ATTRIBUTE_UNU
pool = get_nonnull_storage_pool (client->conn, args->pool);
if (pool == NULL) {
- remoteDispatchError (client, req, "storage_pool not found");
+ remoteDispatchError (client, req, "%s", _("storage_pool not found"));
return -2;
}
@@ -3232,7 +3239,7 @@ remoteDispatchStorageVolCreateXml (struct qemud_server *server ATTRIBUTE_UNUSED,
pool = get_nonnull_storage_pool (client->conn, args->pool);
if (pool == NULL) {
- remoteDispatchError (client, req, "storage_pool not found");
+ remoteDispatchError (client, req, "%s", _("storage_pool not found"));
return -2;
}
@@ -3258,7 +3265,7 @@ remoteDispatchStorageVolDelete (struct qemud_server *server ATTRIBUTE_UNUSED,
vol = get_nonnull_storage_vol (client->conn, args->vol);
if (vol == NULL) {
- remoteDispatchError (client, req, "storage_vol not found");
+ remoteDispatchError (client, req, "%s", _("storage_vol not found"));
return -2;
}
@@ -3283,7 +3290,7 @@ remoteDispatchStorageVolGetInfo (struct qemud_server *server ATTRIBUTE_UNUSED,
vol = get_nonnull_storage_vol (client->conn, args->vol);
if (vol == NULL) {
- remoteDispatchError (client, req, "storage_vol not found");
+ remoteDispatchError (client, req, "%s", _("storage_vol not found"));
return -2;
}
@@ -3313,7 +3320,7 @@ remoteDispatchStorageVolDumpXml (struct qemud_server *server ATTRIBUTE_UNUSED,
vol = get_nonnull_storage_vol (client->conn, args->vol);
if (vol == NULL) {
- remoteDispatchError (client, req, "storage_vol not found");
+ remoteDispatchError (client, req, "%s", _("storage_vol not found"));
return -2;
}
@@ -3340,7 +3347,7 @@ remoteDispatchStorageVolGetPath (struct qemud_server *server ATTRIBUTE_UNUSED,
vol = get_nonnull_storage_vol (client->conn, args->vol);
if (vol == NULL) {
- remoteDispatchError (client, req, "storage_vol not found");
+ remoteDispatchError (client, req, "%s", _("storage_vol not found"));
return -2;
}
@@ -3368,7 +3375,7 @@ remoteDispatchStorageVolLookupByName (struct qemud_server *server ATTRIBUTE_UNUS
pool = get_nonnull_storage_pool (client->conn, args->pool);
if (pool == NULL) {
- remoteDispatchError (client, req, "storage_pool not found");
+ remoteDispatchError (client, req, "%s", _("storage_pool not found"));
return -2;
}
diff --git a/src/qemu_driver.c b/src/qemu_driver.c
index 4a65a08..34abe14 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -474,12 +474,12 @@ static int qemudOpenMonitor(virConnectPtr conn,
}
if (qemudSetCloseExec(monfd) < 0) {
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- _("Unable to set monitor close-on-exec flag"));
+ "%s", _("Unable to set monitor close-on-exec flag"));
goto error;
}
if (qemudSetNonBlock(monfd) < 0) {
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- _("Unable to put monitor into non-blocking mode"));
+ "%s", _("Unable to put monitor into non-blocking mode"));
goto error;
}
@@ -608,7 +608,7 @@ static int qemudStartVMDaemon(virConnectPtr conn,
if (qemudIsActiveVM(vm)) {
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- _("VM is already active"));
+ "%s", _("VM is already active"));
return -1;
}
@@ -616,7 +616,7 @@ static int qemudStartVMDaemon(virConnectPtr conn,
int port = qemudNextFreeVNCPort(driver);
if (port < 0) {
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- _("Unable to find an unused VNC port"));
+ "%s", _("Unable to find an unused VNC port"));
return -1;
}
vm->def->vncActivePort = port;
@@ -930,7 +930,7 @@ dhcpStartDhcpDaemon(virConnectPtr conn,
if (network->def->ipAddress[0] == '\0') {
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- _("cannot start dhcp daemon without IP address for server"));
+ "%s", _("cannot start dhcp daemon without IP address for server"));
return -1;
}
@@ -1142,7 +1142,7 @@ static int qemudStartNetworkDaemon(virConnectPtr conn,
if (qemudIsActiveNetwork(network)) {
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- _("network is already active"));
+ "%s", _("network is already active"));
return -1;
}
@@ -1666,14 +1666,16 @@ static int qemudDomainSuspend(virDomainPtr dom) {
return -1;
}
if (!qemudIsActiveVM(vm)) {
- qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED, _("domain is not running"));
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED,
+ "%s", _("domain is not running"));
return -1;
}
if (vm->state == VIR_DOMAIN_PAUSED)
return 0;
if (qemudMonitorCommand(driver, vm, "stop", &info) < 0) {
- qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED, _("suspend operation failed"));
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED,
+ "%s", _("suspend operation failed"));
return -1;
}
vm->state = VIR_DOMAIN_PAUSED;
@@ -1688,17 +1690,20 @@ static int qemudDomainResume(virDomainPtr dom) {
char *info;
struct qemud_vm *vm = qemudFindVMByID(driver, dom->id);
if (!vm) {
- qemudReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN, _("no domain with matching id %d"), dom->id);
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
+ _("no domain with matching id %d"), dom->id);
return -1;
}
if (!qemudIsActiveVM(vm)) {
- qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED, _("domain is not running"));
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED,
+ "%s", _("domain is not running"));
return -1;
}
if (vm->state == VIR_DOMAIN_RUNNING)
return 0;
if (qemudMonitorCommand(driver, vm, "cont", &info) < 0) {
- qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED, _("resume operation failed"));
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED,
+ "%s", _("resume operation failed"));
return -1;
}
vm->state = VIR_DOMAIN_RUNNING;
@@ -1721,7 +1726,7 @@ static int qemudDomainShutdown(virDomainPtr dom) {
if (qemudMonitorCommand(driver, vm, "system_powerdown", &info) < 0) {
qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED,
- _("shutdown operation failed"));
+ "%s", _("shutdown operation failed"));
return -1;
}
return 0;
@@ -1754,7 +1759,7 @@ static char *qemudDomainGetOSType(virDomainPtr dom) {
if (!vm) {
qemudReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
- _("no domain with matching uuid"));
+ "%s", _("no domain with matching uuid"));
return NULL;
}
@@ -1791,7 +1796,7 @@ static int qemudDomainSetMaxMemory(virDomainPtr dom, unsigned long newmax) {
if (newmax < vm->def->memory) {
qemudReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_ARG,
- _("cannot set max memory lower than current memory"));
+ "%s", _("cannot set max memory lower than current memory"));
return -1;
}
@@ -1811,13 +1816,13 @@ static int qemudDomainSetMemory(virDomainPtr dom, unsigned long newmem) {
if (qemudIsActiveVM(vm)) {
qemudReportError(dom->conn, dom, NULL, VIR_ERR_INTERNAL_ERROR,
- _("cannot set memory of an active domain"));
+ "%s", _("cannot set memory of an active domain"));
return -1;
}
if (newmem > vm->def->maxmem) {
qemudReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_ARG,
- _("cannot set memory higher than max memory"));
+ "%s", _("cannot set memory higher than max memory"));
return -1;
}
@@ -1830,7 +1835,8 @@ static int qemudDomainGetInfo(virDomainPtr dom,
struct qemud_driver *driver = (struct qemud_driver *)dom->conn->privateData;
struct qemud_vm *vm = qemudFindVMByUUID(driver, dom->uuid);
if (!vm) {
- qemudReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN, _("no domain with matching uuid"));
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
+ "%s", _("no domain with matching uuid"));
return -1;
}
@@ -1967,7 +1973,7 @@ static int qemudDomainSave(virDomainPtr dom,
if (!qemudIsActiveVM(vm)) {
qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED,
- _("domain is not running"));
+ "%s", _("domain is not running"));
return -1;
}
@@ -1976,7 +1982,7 @@ static int qemudDomainSave(virDomainPtr dom,
header.was_running = 1;
if (qemudDomainSuspend(dom) != 0) {
qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED,
- _("failed to pause domain"));
+ "%s", _("failed to pause domain"));
return -1;
}
}
@@ -1985,7 +1991,7 @@ static int qemudDomainSave(virDomainPtr dom,
xml = qemudGenerateXML(dom->conn, driver, vm, vm->def, 0);
if (!xml) {
qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED,
- _("failed to get domain xml"));
+ "%s", _("failed to get domain xml"));
return -1;
}
header.xml_len = strlen(xml) + 1;
@@ -2000,7 +2006,7 @@ static int qemudDomainSave(virDomainPtr dom,
if (safewrite(fd, &header, sizeof(header)) != sizeof(header)) {
qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED,
- _("failed to write save header"));
+ "%s", _("failed to write save header"));
close(fd);
free(xml);
return -1;
@@ -2008,7 +2014,7 @@ static int qemudDomainSave(virDomainPtr dom,
if (safewrite(fd, xml, header.xml_len) != header.xml_len) {
qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED,
- _("failed to write xml"));
+ "%s", _("failed to write xml"));
close(fd);
free(xml);
return -1;
@@ -2021,14 +2027,14 @@ static int qemudDomainSave(virDomainPtr dom,
safe_path = qemudEscapeShellArg(path);
if (!safe_path) {
qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED,
- _("out of memory"));
+ "%s", _("out of memory"));
return -1;
}
if (asprintf (&command, "migrate \"exec:"
"dd of='%s' oflag=append conv=notrunc 2>/dev/null"
"\"", safe_path) == -1) {
qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED,
- _("out of memory"));
+ "%s", _("out of memory"));
free(safe_path);
return -1;
}
@@ -2036,7 +2042,7 @@ static int qemudDomainSave(virDomainPtr dom,
if (qemudMonitorCommand(driver, vm, command, &info) < 0) {
qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED,
- _("migrate operation failed"));
+ "%s", _("migrate operation failed"));
free(command);
return -1;
}
@@ -2066,20 +2072,20 @@ static int qemudDomainRestore(virConnectPtr conn,
/* Verify the header and read the XML */
if ((fd = open(path, O_RDONLY)) < 0) {
qemudReportError(conn, NULL, NULL, VIR_ERR_OPERATION_FAILED,
- _("cannot read domain image"));
+ "%s", _("cannot read domain image"));
return -1;
}
if (saferead(fd, &header, sizeof(header)) != sizeof(header)) {
qemudReportError(conn, NULL, NULL, VIR_ERR_OPERATION_FAILED,
- _("failed to read qemu header"));
+ "%s", _("failed to read qemu header"));
close(fd);
return -1;
}
if (memcmp(header.magic, QEMUD_SAVE_MAGIC, sizeof(header.magic)) != 0) {
qemudReportError(conn, NULL, NULL, VIR_ERR_OPERATION_FAILED,
- _("image magic is incorrect"));
+ "%s", _("image magic is incorrect"));
close(fd);
return -1;
}
@@ -2094,14 +2100,14 @@ static int qemudDomainRestore(virConnectPtr conn,
if ((xml = (char *)malloc(header.xml_len)) == NULL) {
qemudReportError(conn, NULL, NULL, VIR_ERR_OPERATION_FAILED,
- _("out of memory"));
+ "%s", _("out of memory"));
close(fd);
return -1;
}
if (saferead(fd, xml, header.xml_len) != header.xml_len) {
qemudReportError(conn, NULL, NULL, VIR_ERR_OPERATION_FAILED,
- _("failed to read XML"));
+ "%s", _("failed to read XML"));
close(fd);
free(xml);
return -1;
@@ -2110,7 +2116,7 @@ static int qemudDomainRestore(virConnectPtr conn,
/* Create a domain from this XML */
if (!(def = qemudParseVMDef(conn, driver, xml, NULL))) {
qemudReportError(conn, NULL, NULL, VIR_ERR_OPERATION_FAILED,
- _("failed to parse XML"));
+ "%s", _("failed to parse XML"));
close(fd);
free(xml);
return -1;
@@ -2129,7 +2135,7 @@ static int qemudDomainRestore(virConnectPtr conn,
if (!(vm = qemudAssignVMDef(conn, driver, def))) {
qemudReportError(conn, NULL, NULL, VIR_ERR_OPERATION_FAILED,
- _("failed to assign new VM"));
+ "%s", _("failed to assign new VM"));
qemudFreeVMDef(def);
close(fd);
return -1;
@@ -2144,7 +2150,7 @@ static int qemudDomainRestore(virConnectPtr conn,
vm->stdin = -1;
if (ret < 0) {
qemudReportError(conn, NULL, NULL, VIR_ERR_OPERATION_FAILED,
- _("failed to start VM"));
+ "%s", _("failed to start VM"));
if (!vm->configFile[0])
qemudRemoveInactiveVM(driver, vm);
return -1;
@@ -2155,7 +2161,7 @@ static int qemudDomainRestore(virConnectPtr conn,
char *info;
if (qemudMonitorCommand(driver, vm, "cont", &info) < 0) {
qemudReportError(conn, NULL, NULL, VIR_ERR_OPERATION_FAILED,
- _("failed to resume domain"));
+ "%s", _("failed to resume domain"));
return -1;
}
free(info);
@@ -2171,7 +2177,8 @@ static char *qemudDomainDumpXML(virDomainPtr dom,
struct qemud_driver *driver = (struct qemud_driver *)dom->conn->privateData;
struct qemud_vm *vm = qemudFindVMByUUID(driver, dom->uuid);
if (!vm) {
- qemudReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN, _("no domain with matching uuid"));
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
+ "%s", _("no domain with matching uuid"));
return NULL;
}
@@ -2215,7 +2222,7 @@ static int qemudDomainStart(virDomainPtr dom) {
if (!vm) {
qemudReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
- _("no domain with matching uuid"));
+ "%s", _("no domain with matching uuid"));
return -1;
}
@@ -2252,12 +2259,14 @@ static int qemudDomainUndefine(virDomainPtr dom) {
struct qemud_vm *vm = qemudFindVMByUUID(driver, dom->uuid);
if (!vm) {
- qemudReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN, _("no domain with matching uuid"));
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
+ "%s", _("no domain with matching uuid"));
return -1;
}
if (qemudIsActiveVM(vm)) {
- qemudReportError(dom->conn, dom, NULL, VIR_ERR_INTERNAL_ERROR, _("cannot delete active domain"));
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("cannot delete active domain"));
return -1;
}
@@ -2287,7 +2296,7 @@ static int qemudDomainChangeCDROM(virDomainPtr dom,
safe_path = qemudEscapeMonitorArg(newdisk->src);
if (!safe_path) {
qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED,
- _("out of memory"));
+ "%s", _("out of memory"));
return -1;
}
if (asprintf (&cmd, "change %s \"%s\"",
@@ -2295,7 +2304,7 @@ static int qemudDomainChangeCDROM(virDomainPtr dom,
/* olddisk->dst */ "cdrom",
safe_path) == -1) {
qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED,
- _("out of memory"));
+ "%s", _("out of memory"));
free(safe_path);
return -1;
}
@@ -2303,12 +2312,13 @@ static int qemudDomainChangeCDROM(virDomainPtr dom,
} else if (asprintf(&cmd, "eject cdrom") == -1) {
qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED,
- _("out of memory"));
+ "%s", _("out of memory"));
return -1;
}
if (qemudMonitorCommand(driver, vm, cmd, &reply) < 0) {
- qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED, _("cannot change cdrom media"));
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED,
+ "%s", _("cannot change cdrom media"));
free(cmd);
return -1;
}
@@ -2327,12 +2337,14 @@ static int qemudDomainAttachDevice(virDomainPtr dom,
struct qemud_vm_disk_def *disk;
if (!vm) {
- qemudReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN, _("no domain with matching uuid"));
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
+ "%s", _("no domain with matching uuid"));
return -1;
}
if (!qemudIsActiveVM(vm)) {
- qemudReportError(dom->conn, dom, NULL, VIR_ERR_INTERNAL_ERROR, _("cannot attach device on inactive domain"));
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("cannot attach device on inactive domain"));
return -1;
}
@@ -2342,7 +2354,8 @@ static int qemudDomainAttachDevice(virDomainPtr dom,
}
if (dev->type != QEMUD_DEVICE_DISK || dev->data.disk.device != QEMUD_DISK_CDROM) {
- qemudReportError(dom->conn, dom, NULL, VIR_ERR_NO_SUPPORT, _("only CDROM disk devices can be attached"));
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_NO_SUPPORT,
+ "%s", _("only CDROM disk devices can be attached"));
free(dev);
return -1;
}
@@ -2356,7 +2369,8 @@ static int qemudDomainAttachDevice(virDomainPtr dom,
}
if (!disk) {
- qemudReportError(dom->conn, dom, NULL, VIR_ERR_NO_SUPPORT, _("CDROM not attached, cannot change media"));
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_NO_SUPPORT,
+ "%s", _("CDROM not attached, cannot change media"));
free(dev);
return -1;
}
@@ -2376,7 +2390,8 @@ static int qemudDomainGetAutostart(virDomainPtr dom,
struct qemud_vm *vm = qemudFindVMByUUID(driver, dom->uuid);
if (!vm) {
- qemudReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN, _("no domain with matching uuid"));
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
+ "%s", _("no domain with matching uuid"));
return -1;
}
@@ -2391,7 +2406,8 @@ static int qemudDomainSetAutostart(virDomainPtr dom,
struct qemud_vm *vm = qemudFindVMByUUID(driver, dom->uuid);
if (!vm) {
- qemudReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN, _("no domain with matching uuid"));
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
+ "%s", _("no domain with matching uuid"));
return -1;
}
@@ -2590,13 +2606,13 @@ qemudDomainInterfaceStats (virDomainPtr dom,
if (!qemudIsActiveVM(vm)) {
qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED,
- _("domain is not running"));
+ "%s", _("domain is not running"));
return -1;
}
if (!path || path[0] == '\0') {
qemudReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_ARG,
- _("NULL or empty path"));
+ "%s", _("NULL or empty path"));
return -1;
}
@@ -2638,7 +2654,8 @@ static virNetworkPtr qemudNetworkLookupByUUID(virConnectPtr conn ATTRIBUTE_UNUSE
virNetworkPtr net;
if (!network) {
- qemudReportError(conn, NULL, NULL, VIR_ERR_NO_NETWORK, _("no network with matching uuid"));
+ qemudReportError(conn, NULL, NULL, VIR_ERR_NO_NETWORK,
+ "%s", _("no network with matching uuid"));
return NULL;
}
@@ -2652,7 +2669,8 @@ static virNetworkPtr qemudNetworkLookupByName(virConnectPtr conn ATTRIBUTE_UNUSE
virNetworkPtr net;
if (!network) {
- qemudReportError(conn, NULL, NULL, VIR_ERR_NO_NETWORK, _("no network with matching name"));
+ qemudReportError(conn, NULL, NULL, VIR_ERR_NO_NETWORK,
+ "%s", _("no network with matching name"));
return NULL;
}
@@ -2781,7 +2799,8 @@ static int qemudNetworkUndefine(virNetworkPtr net) {
struct qemud_network *network = qemudFindNetworkByUUID(driver, net->uuid);
if (!network) {
- qemudReportError(net->conn, NULL, net, VIR_ERR_INVALID_DOMAIN, _("no network with matching uuid"));
+ qemudReportError(net->conn, NULL, net, VIR_ERR_INVALID_DOMAIN,
+ "%s", _("no network with matching uuid"));
return -1;
}
@@ -2806,7 +2825,7 @@ static int qemudNetworkStart(virNetworkPtr net) {
if (!network) {
qemudReportError(net->conn, NULL, net, VIR_ERR_INVALID_NETWORK,
- _("no network with matching uuid"));
+ "%s", _("no network with matching uuid"));
return -1;
}
@@ -2820,7 +2839,7 @@ static int qemudNetworkDestroy(virNetworkPtr net) {
if (!network) {
qemudReportError(net->conn, NULL, net, VIR_ERR_INVALID_NETWORK,
- _("no network with matching uuid"));
+ "%s", _("no network with matching uuid"));
return -1;
}
@@ -2835,7 +2854,7 @@ static char *qemudNetworkDumpXML(virNetworkPtr net, int flags ATTRIBUTE_UNUSED)
if (!network) {
qemudReportError(net->conn, NULL, net, VIR_ERR_INVALID_NETWORK,
- _("no network with matching uuid"));
+ "%s", _("no network with matching uuid"));
return NULL;
}
@@ -2865,7 +2884,8 @@ static int qemudNetworkGetAutostart(virNetworkPtr net,
struct qemud_network *network = qemudFindNetworkByUUID(driver, net->uuid);
if (!network) {
- qemudReportError(net->conn, NULL, net, VIR_ERR_INVALID_NETWORK, _("no network with matching uuid"));
+ qemudReportError(net->conn, NULL, net, VIR_ERR_INVALID_NETWORK,
+ "%s", _("no network with matching uuid"));
return -1;
}
@@ -2880,7 +2900,8 @@ static int qemudNetworkSetAutostart(virNetworkPtr net,
struct qemud_network *network = qemudFindNetworkByUUID(driver, net->uuid);
if (!network) {
- qemudReportError(net->conn, NULL, net, VIR_ERR_INVALID_NETWORK, _("no network with matching uuid"));
+ qemudReportError(net->conn, NULL, net, VIR_ERR_INVALID_NETWORK,
+ "%s", _("no network with matching uuid"));
return -1;
}
diff --git a/src/storage_backend.c b/src/storage_backend.c
index 4a58cb6..92aecfd 100644
--- a/src/storage_backend.c
+++ b/src/storage_backend.c
@@ -1,5 +1,5 @@
/*
- * storage_backend.h: internal storage driver backend contract
+ * storage_backend.c: internal storage driver backend contract
*
* Copyright (C) 2007-2008 Red Hat, Inc.
* Copyright (C) 2007-2008 Daniel P. Berrange
diff --git a/src/util.c b/src/util.c
index 69e899f..188b7a8 100644
--- a/src/util.c
+++ b/src/util.c
@@ -461,7 +461,7 @@ int
virFileLinkPointsTo (const char *checkLink ATTRIBUTE_UNUSED,
const char *checkDest ATTRIBUTE_UNUSED)
{
- virLog ("%s: not implemented", __FUNCTION__);
+ virLog (_("%s: not implemented"), __FUNCTION__);
return 0;
}
diff --git a/src/virsh.c b/src/virsh.c
index c541f88..e7189e2 100644
--- a/src/virsh.c
+++ b/src/virsh.c
@@ -1723,13 +1723,14 @@ cmdVcpupin(vshControl * ctl, vshCmd * cmd)
vcpu = vshCommandOptInt(cmd, "vcpu", &vcpufound);
if (!vcpufound) {
- vshError(ctl, FALSE, _("vcpupin: Invalid or missing vCPU number."));
+ vshError(ctl, FALSE, "%s",
+ _("vcpupin: Invalid or missing vCPU number."));
virDomainFree(dom);
return FALSE;
}
if (!(cpulist = vshCommandOptString(cmd, "cpulist", NULL))) {
- vshError(ctl, FALSE, _("vcpupin: Missing cpulist"));
+ vshError(ctl, FALSE, "%s", _("vcpupin: Missing cpulist"));
virDomainFree(dom);
return FALSE;
}
@@ -1740,7 +1741,7 @@ cmdVcpupin(vshControl * ctl, vshCmd * cmd)
}
if (virDomainGetInfo(dom, &info) != 0) {
- vshError(ctl, FALSE, _("vcpupin: Invalid vCPU number."));
+ vshError(ctl, FALSE, "%s", _("vcpupin: Invalid vCPU number."));
virDomainFree(dom);
return FALSE;
}
@@ -4475,7 +4476,7 @@ cmdAttachDevice(vshControl * ctl, vshCmd * cmd)
from = vshCommandOptString(cmd, "file", &found);
if (!found) {
- vshError(ctl, FALSE, _("attach-device: Missing <file> option"));
+ vshError(ctl, FALSE, "%s", _("attach-device: Missing <file> option"));
virDomainFree(dom);
return FALSE;
}
@@ -4532,7 +4533,7 @@ cmdDetachDevice(vshControl * ctl, vshCmd * cmd)
from = vshCommandOptString(cmd, "file", &found);
if (!found) {
- vshError(ctl, FALSE, _("detach-device: Missing <file> option"));
+ vshError(ctl, FALSE, "%s", _("detach-device: Missing <file> option"));
virDomainFree(dom);
return FALSE;
}
diff --git a/src/xm_internal.c b/src/xm_internal.c
index 6b4b4d7..55684e7 100644
--- a/src/xm_internal.c
+++ b/src/xm_internal.c
@@ -434,7 +434,8 @@ static int xenXMConfigCacheRefresh (virConnectPtr conn) {
virHashRemoveEntry(configCache, path, NULL);
}
free(entry);
- xenXMError (conn, VIR_ERR_INTERNAL_ERROR, "xenXMConfigCacheRefresh: name");
+ xenXMError (conn, VIR_ERR_INTERNAL_ERROR,
+ _("xenXMConfigCacheRefresh: name"));
goto cleanup;
}
@@ -444,7 +445,8 @@ static int xenXMConfigCacheRefresh (virConnectPtr conn) {
if (virHashAddEntry(configCache, entry->filename, entry) < 0) {
virConfFree(entry->conf);
free(entry);
- xenXMError (conn, VIR_ERR_INTERNAL_ERROR, "xenXMConfigCacheRefresh: virHashAddEntry");
+ xenXMError (conn, VIR_ERR_INTERNAL_ERROR,
+ _("xenXMConfigCacheRefresh: virHashAddEntry"));
goto cleanup;
}
}
@@ -1254,21 +1256,23 @@ int xenXMDomainPinVcpu(virDomainPtr domain,
return -1;
}
if (domain->conn->flags & VIR_CONNECT_RO) {
- xenXMError (domain->conn, VIR_ERR_INVALID_ARG, "read only connection");
+ xenXMError (domain->conn, VIR_ERR_INVALID_ARG,
+ _("read only connection"));
return -1;
}
if (domain->id != -1) {
- xenXMError (domain->conn, VIR_ERR_INVALID_ARG, "not inactive domain");
+ xenXMError (domain->conn, VIR_ERR_INVALID_ARG,
+ _("not inactive domain"));
return -1;
}
if (!(filename = virHashLookup(nameConfigMap, domain->name))) {
- xenXMError (domain->conn, VIR_ERR_INTERNAL_ERROR, "virHashLookup");
+ xenXMError (domain->conn, VIR_ERR_INTERNAL_ERROR, _("virHashLookup"));
return -1;
}
if (!(entry = virHashLookup(configCache, filename))) {
xenXMError (domain->conn, VIR_ERR_INTERNAL_ERROR,
- "can't retrieve config file for domain");
+ _("can't retrieve config file for domain"));
return -1;
}
--
1.5.5.rc0.22.g467c
2
1
On my system, libvirt-0.4.0-2ubuntu6 added the following rule to allow
my virtual hosts NATted access to the outside world:
> Chain POSTROUTING (policy ACCEPT 33904 packets, 2146K bytes)
> pkts bytes target prot opt in out source destination
> 779 102K MASQUERADE all -- * * 192.168.65.0/24 0.0.0.0/0
This resulted in *all* traffic being masqueraded, even between two
different VMs -- preventing hostbased authentication between these VMs.
To temporarily resolve this, I added an additional rule, as follows:
> Chain POSTROUTING (policy ACCEPT 34049 packets, 2160K bytes)
> pkts bytes target prot opt in out source destination
> 156 9752 ACCEPT all -- * * 192.168.65.0/24 192.168.65.0/24
> 865 109K MASQUERADE all -- * * 192.168.65.0/24 0.0.0.0/0
The network definition being used was as follows:
> <network>
> <name>default</name>
> <uuid>a7c5b18c-9d38-40ed-9b12-8b1a27013b85</uuid>
> <bridge name="virbr%d" />
> <forward/>
> <ip address="192.168.65.253" netmask="255.255.255.0"/>
> </network>
I'm frankly unclear on why the packets attempted to forward through .253
in any event -- the routing tables on both VMs refer to 192.168.65.0/24
as part of the local network, so my expectation is that no attempt to
route through the default gateway should have occurred.
In any event, having libvirt extend the MASQUERADE rule to avoid
impacting traffic between hosts on the virtual network -- or adding a
paired ACCEPT, as I did above -- would probably be a Good Thing.
2
4
This patch contains the shutdown and destroy domain support for Linux Containers.
A shutdown of the container is requested by sending a SIGINT to the container
root process.
A container is destroyed by sending a SIGKILL to the container root process.
When this process exits, it takes all container child processes with it.
Thanks!
--
Best Regards,
Dave Leskovec
IBM Linux Technology Center
Open Virtualization
2
2