tons of format string warnings on rawhide

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Avoid warnings like this:

  file:nnn:format not a string literal and no format arguments

Easy to fix: prepend an "%s" argument.

Signed-off-by: Jim Meyering <meyering@xxxxxxxxxx>
---
 qemud/qemud.c                 |   68 +++++++++++++++-----------
 qemud/remote.c                |   28 ++++++-----
 src/iptables.c                |    4 +-
 src/qemu_driver.c             |   23 ++++++---
 src/storage_backend.c         |   22 ++++----
 src/storage_backend_fs.c      |   29 ++++++------
 src/storage_backend_iscsi.c   |   18 ++++----
 src/storage_backend_logical.c |   20 ++++----
 src/storage_conf.c            |   77 +++++++++++++++---------------
 src/storage_driver.c          |  103 +++++++++++++++++++++--------------------
 10 files changed, 207 insertions(+), 185 deletions(-)

diff --git a/qemud/qemud.c b/qemud/qemud.c
index a40dfcb..e01b6dc 100644
--- a/qemud/qemud.c
+++ b/qemud/qemud.c
@@ -245,9 +245,9 @@ static void qemudDispatchSignalEvent(int fd ATTRIBUTE_UNUSED,

     switch (sigc) {
     case SIGHUP:
-        qemudLog(QEMUD_INFO, _("Reloading configuration on SIGHUP"));
+        qemudLog(QEMUD_INFO, "%s", _("Reloading configuration on SIGHUP"));
         if (virStateReload() < 0)
-            qemudLog(QEMUD_WARN, _("Error while reloading drivers"));
+            qemudLog(QEMUD_WARN, "%s", _("Error while reloading drivers"));
         break;

     case SIGINT:
@@ -274,7 +274,8 @@ static int qemudSetCloseExec(int fd) {
         goto error;
     return 0;
  error:
-    qemudLog(QEMUD_ERR, _("Failed to set close-on-exec file descriptor flag"));
+    qemudLog(QEMUD_ERR,
+             "%s", _("Failed to set close-on-exec file descriptor flag"));
     return -1;
 }

@@ -288,7 +289,8 @@ static int qemudSetNonBlock(int fd) {
         goto error;
     return 0;
  error:
-    qemudLog(QEMUD_ERR, _("Failed to set non-blocking file descriptor flag"));
+    qemudLog(QEMUD_ERR,
+             "%s", _("Failed to set non-blocking file descriptor flag"));
     return -1;
 }

@@ -467,7 +469,7 @@ static int qemudListenUnix(struct qemud_server *server,

     if (!sock) {
         qemudLog(QEMUD_ERR,
-                 _("Failed to allocate memory for struct qemud_socket"));
+                 "%s", _("Failed to allocate memory for struct qemud_socket"));
         return -1;
     }

@@ -517,7 +519,7 @@ static int qemudListenUnix(struct qemud_server *server,
                               POLLIN| POLLERR | POLLHUP,
                               qemudDispatchServerEvent,
                               server) < 0) {
-        qemudLog(QEMUD_ERR, _("Failed to add server event callback"));
+        qemudLog(QEMUD_ERR, "%s", _("Failed to add server event callback"));
         goto cleanup;
     }

@@ -647,7 +649,7 @@ remoteListenTCP (struct qemud_server *server,
                                   POLLIN| POLLERR | POLLHUP,
                                   qemudDispatchServerEvent,
                                   server) < 0) {
-            qemudLog(QEMUD_ERR, _("Failed to add server event callback"));
+            qemudLog(QEMUD_ERR, "%s", _("Failed to add server event callback"));
             return -1;
         }

@@ -698,7 +700,7 @@ static int qemudInitPaths(struct qemud_server *server,

  snprintf_error:
     qemudLog(QEMUD_ERR,
-             _("Resulting path to long for buffer in qemudInitPaths()"));
+             "%s", _("Resulting path to long for buffer in qemudInitPaths()"));
     return -1;
 }

@@ -706,7 +708,7 @@ static struct qemud_server *qemudInitialize(int sigread) {
     struct qemud_server *server;

     if (!(server = calloc(1, sizeof(*server)))) {
-        qemudLog(QEMUD_ERR, _("Failed to allocate struct qemud_server"));
+        qemudLog(QEMUD_ERR, "%s", _("Failed to allocate struct qemud_server"));
         return NULL;
     }

@@ -935,20 +937,23 @@ remoteCheckCertificate (gnutls_session_t session)

     if (status != 0) {
         if (status & GNUTLS_CERT_INVALID)
-            qemudLog (QEMUD_ERR, _("remoteCheckCertificate: "
-                                   "the client certificate is not trusted."));
+            qemudLog (QEMUD_ERR, "%s",
+                      _("remoteCheckCertificate: "
+                        "the client certificate is not trusted."));

         if (status & GNUTLS_CERT_SIGNER_NOT_FOUND)
-            qemudLog (QEMUD_ERR, _("remoteCheckCertificate: the client "
-                                   "certificate has unknown issuer."));
+            qemudLog (QEMUD_ERR, "%s",
+                      _("remoteCheckCertificate: the client "
+                        "certificate has unknown issuer."));

         if (status & GNUTLS_CERT_REVOKED)
-            qemudLog (QEMUD_ERR, _("remoteCheckCertificate: "
-                                   "the client certificate has been revoked."));
+            qemudLog (QEMUD_ERR, "%s",
+                      _("remoteCheckCertificate: "
+                        "the client certificate has been revoked."));

 #ifndef GNUTLS_1_0_COMPAT
         if (status & GNUTLS_CERT_INSECURE_ALGORITHM)
-            qemudLog (QEMUD_ERR,
+            qemudLog (QEMUD_ERR, "%s",
                       _("remoteCheckCertificate: the client certificate"
                         " uses an insecure algorithm."));
 #endif
@@ -957,13 +962,13 @@ remoteCheckCertificate (gnutls_session_t session)
     }

     if (gnutls_certificate_type_get (session) != GNUTLS_CRT_X509) {
-        qemudLog (QEMUD_ERR, _("remoteCheckCertificate: "
-                               "certificate is not X.509"));
+        qemudLog (QEMUD_ERR,
+                  "%s", _("remoteCheckCertificate: certificate is not X.509"));
         return -1;
     }

     if (!(certs = gnutls_certificate_get_peers(session, &nCerts))) {
-        qemudLog (QEMUD_ERR, _("remoteCheckCertificate: no peers"));
+        qemudLog (QEMUD_ERR, "%s", _("remoteCheckCertificate: no peers"));
         return -1;
     }

@@ -973,7 +978,7 @@ remoteCheckCertificate (gnutls_session_t session)
         gnutls_x509_crt_t cert;

         if (gnutls_x509_crt_init (&cert) < 0) {
-            qemudLog (QEMUD_ERR,
+            qemudLog (QEMUD_ERR, "%s",
                       _("remoteCheckCertificate: gnutls_x509_crt_init failed"));
             return -1;
         }
@@ -984,15 +989,15 @@ remoteCheckCertificate (gnutls_session_t session)
         }

         if (gnutls_x509_crt_get_expiration_time (cert) < now) {
-            qemudLog (QEMUD_ERR, _("remoteCheckCertificate: "
-                                   "the client certificate has expired"));
+            qemudLog (QEMUD_ERR, "%s", _("remoteCheckCertificate: "
+                                         "the client certificate has expired"));
             gnutls_x509_crt_deinit (cert);
             return -1;
         }

         if (gnutls_x509_crt_get_activation_time (cert) > now) {
-            qemudLog (QEMUD_ERR, _("remoteCheckCertificate: the client "
-                                   "certificate is not yet activated"));
+            qemudLog (QEMUD_ERR, "%s", _("remoteCheckCertificate: the client "
+                                         "certificate is not yet activated"));
             gnutls_x509_crt_deinit (cert);
             return -1;
         }
@@ -1000,7 +1005,7 @@ remoteCheckCertificate (gnutls_session_t session)
         if (i == 0) {
             if (!remoteCheckDN (cert)) {
                 /* This is the most common error: make it informative. */
-                qemudLog (QEMUD_ERR, _("remoteCheckCertificate: client's Distinguished Name is not on the list of allowed clients (tls_allowed_dn_list).  Use 'openssl x509 -in clientcert.pem -text' to view the Distinguished Name field in the client certificate, or run this daemon with --verbose option."));
+                qemudLog (QEMUD_ERR, "%s", _("remoteCheckCertificate: client's Distinguished Name is not on the list of allowed clients (tls_allowed_dn_list).  Use 'openssl x509 -in clientcert.pem -text' to view the Distinguished Name field in the client certificate, or run this daemon with --verbose option."));
                 gnutls_x509_crt_deinit (cert);
                 return -1;
             }
@@ -1016,9 +1021,13 @@ remoteCheckAccess (struct qemud_client *client)
 {
     /* Verify client certificate. */
     if (remoteCheckCertificate (client->tlssession) == -1) {
-        qemudLog (QEMUD_ERR, _("remoteCheckCertificate: failed to verify client's certificate"));
+        qemudLog (QEMUD_ERR, "%s",
+                  _("remoteCheckCertificate: "
+                    "failed to verify client's certificate"));
         if (!tls_no_verify_certificate) return -1;
-        else qemudLog (QEMUD_INFO, _("remoteCheckCertificate: tls_no_verify_certificate is set so the bad certificate is ignored"));
+        else qemudLog (QEMUD_INFO, "%s",
+                       _("remoteCheckCertificate: tls_no_verify_certificate "
+                         "is set so the bad certificate is ignored"));
     }

     /* Checks have succeeded.  Write a '\1' byte back to the client to
@@ -1889,7 +1898,7 @@ remoteReadConfigFile (struct qemud_server *server, const char *filename)
     if (unix_sock_group) {
         if (getuid() != 0) {
             qemudLog (QEMUD_WARN,
-                      _("Cannot set group when not running as root"));
+                      "%s", _("Cannot set group when not running as root"));
         } else {
             struct group *grp = getgrnam(unix_sock_group);
             if (!grp) {
@@ -2146,7 +2155,8 @@ int main(int argc, char **argv) {
                               POLLIN,
                               qemudDispatchSignalEvent,
                               server) < 0) {
-        qemudLog(QEMUD_ERR, _("Failed to register callback for signal pipe"));
+        qemudLog(QEMUD_ERR,
+                 "%s", _("Failed to register callback for signal pipe"));
         ret = 3;
         goto error2;
     }
diff --git a/qemud/remote.c b/qemud/remote.c
index f7c9b24..014fe65 100644
--- a/qemud/remote.c
+++ b/qemud/remote.c
@@ -2130,7 +2130,7 @@ remoteDispatchAuthSaslInit (struct qemud_server *server ATTRIBUTE_UNUSED,
     REMOTE_DEBUG("Initialize SASL auth %d", client->fd);
     if (client->auth != REMOTE_AUTH_SASL ||
         client->saslconn != NULL) {
-        qemudLog(QEMUD_ERR, _("client tried invalid SASL init request"));
+        qemudLog(QEMUD_ERR, "%s", _("client tried invalid SASL init request"));
         remoteDispatchFailAuth(client, req);
         return -2;
     }
@@ -2184,7 +2184,7 @@ remoteDispatchAuthSaslInit (struct qemud_server *server ATTRIBUTE_UNUSED,

         cipher = gnutls_cipher_get(client->tlssession);
         if (!(ssf = (sasl_ssf_t)gnutls_cipher_get_key_size(cipher))) {
-            qemudLog(QEMUD_ERR, _("cannot TLS get cipher size"));
+            qemudLog(QEMUD_ERR, "%s", _("cannot TLS get cipher size"));
             remoteDispatchFailAuth(client, req);
             sasl_dispose(&client->saslconn);
             client->saslconn = NULL;
@@ -2250,7 +2250,7 @@ remoteDispatchAuthSaslInit (struct qemud_server *server ATTRIBUTE_UNUSED,
     REMOTE_DEBUG("Available mechanisms for client: '%s'", mechlist);
     ret->mechlist = strdup(mechlist);
     if (!ret->mechlist) {
-        qemudLog(QEMUD_ERR, _("cannot allocate mechlist"));
+        qemudLog(QEMUD_ERR, "%s", _("cannot allocate mechlist"));
         remoteDispatchFailAuth(client, req);
         sasl_dispose(&client->saslconn);
         client->saslconn = NULL;
@@ -2323,7 +2323,7 @@ remoteSASLCheckAccess (struct qemud_server *server,
         return -1;
     }
     if (val == NULL) {
-        qemudLog(QEMUD_ERR, _("no client username was found"));
+        qemudLog(QEMUD_ERR, "%s", _("no client username was found"));
         remoteDispatchFailAuth(client, req);
         sasl_dispose(&client->saslconn);
         client->saslconn = NULL;
@@ -2333,7 +2333,7 @@ remoteSASLCheckAccess (struct qemud_server *server,

     client->saslUsername = strdup((const char*)val);
     if (client->saslUsername == NULL) {
-        qemudLog(QEMUD_ERR, _("out of memory copying username"));
+        qemudLog(QEMUD_ERR, "%s", _("out of memory copying username"));
         remoteDispatchFailAuth(client, req);
         sasl_dispose(&client->saslconn);
         client->saslconn = NULL;
@@ -2378,7 +2378,7 @@ remoteDispatchAuthSaslStart (struct qemud_server *server,
     REMOTE_DEBUG("Start SASL auth %d", client->fd);
     if (client->auth != REMOTE_AUTH_SASL ||
         client->saslconn == NULL) {
-        qemudLog(QEMUD_ERR, _("client tried invalid SASL start request"));
+        qemudLog(QEMUD_ERR, "%s", _("client tried invalid SASL start request"));
         remoteDispatchFailAuth(client, req);
         return -2;
     }
@@ -2458,7 +2458,7 @@ remoteDispatchAuthSaslStep (struct qemud_server *server,
     REMOTE_DEBUG("Step SASL auth %d", client->fd);
     if (client->auth != REMOTE_AUTH_SASL ||
         client->saslconn == NULL) {
-        qemudLog(QEMUD_ERR, _("client tried invalid SASL start request"));
+        qemudLog(QEMUD_ERR, "%s", _("client tried invalid SASL start request"));
         remoteDispatchFailAuth(client, req);
         return -2;
     }
@@ -2532,7 +2532,7 @@ remoteDispatchAuthSaslInit (struct qemud_server *server ATTRIBUTE_UNUSED,
                             void *args ATTRIBUTE_UNUSED,
                             remote_auth_sasl_init_ret *ret ATTRIBUTE_UNUSED)
 {
-    qemudLog(QEMUD_ERR, _("client tried unsupported SASL init request"));
+    qemudLog(QEMUD_ERR, "%s", _("client tried unsupported SASL init request"));
     remoteDispatchFailAuth(client, req);
     return -1;
 }
@@ -2544,7 +2544,7 @@ remoteDispatchAuthSaslStart (struct qemud_server *server ATTRIBUTE_UNUSED,
                              remote_auth_sasl_start_args *args ATTRIBUTE_UNUSED,
                              remote_auth_sasl_start_ret *ret ATTRIBUTE_UNUSED)
 {
-    qemudLog(QEMUD_ERR, _("client tried unsupported SASL start request"));
+    qemudLog(QEMUD_ERR, "%s", _("client tried unsupported SASL start request"));
     remoteDispatchFailAuth(client, req);
     return -1;
 }
@@ -2556,7 +2556,7 @@ remoteDispatchAuthSaslStep (struct qemud_server *server ATTRIBUTE_UNUSED,
                             remote_auth_sasl_step_args *args ATTRIBUTE_UNUSED,
                             remote_auth_sasl_step_ret *ret ATTRIBUTE_UNUSED)
 {
-    qemudLog(QEMUD_ERR, _("client tried unsupported SASL step request"));
+    qemudLog(QEMUD_ERR, "%s", _("client tried unsupported SASL step request"));
     remoteDispatchFailAuth(client, req);
     return -1;
 }
@@ -2597,13 +2597,14 @@ remoteDispatchAuthPolkit (struct qemud_server *server ATTRIBUTE_UNUSED,

     REMOTE_DEBUG("Start PolicyKit auth %d", client->fd);
     if (client->auth != REMOTE_AUTH_POLKIT) {
-        qemudLog(QEMUD_ERR, _("client tried invalid PolicyKit init request"));
+        qemudLog(QEMUD_ERR,
+                 "%s", _("client tried invalid PolicyKit init request"));
         remoteDispatchFailAuth(client, req);
         return -2;
     }

     if (qemudGetSocketIdentity(client->fd, &callerUid, &callerPid) < 0) {
-        qemudLog(QEMUD_ERR, _("cannot get peer socket identity"));
+        qemudLog(QEMUD_ERR, "%s", _("cannot get peer socket identity"));
         remoteDispatchFailAuth(client, req);
         return -2;
     }
@@ -2713,7 +2714,8 @@ remoteDispatchAuthPolkit (struct qemud_server *server ATTRIBUTE_UNUSED,
                               void *args ATTRIBUTE_UNUSED,
                               remote_auth_polkit_ret *ret ATTRIBUTE_UNUSED)
 {
-    qemudLog(QEMUD_ERR, _("client tried unsupported PolicyKit init request"));
+    qemudLog(QEMUD_ERR,
+             "%s", _("client tried unsupported PolicyKit init request"));
     remoteDispatchFailAuth(client, req);
     return -1;
 }
diff --git a/src/iptables.c b/src/iptables.c
index f970701..dda1c24 100644
--- a/src/iptables.c
+++ b/src/iptables.c
@@ -148,8 +148,8 @@ notifyRulesRemoved(const char *table,
     len = virFileReadAll(SYSCONF_DIR "/sysconfig/system-config-firewall",
                          MAX_FILE_LEN, &content);
     if (len < 0) {
-        qemudLog(QEMUD_WARN, _("Failed to read " SYSCONF_DIR
-                               "/sysconfig/system-config-firewall"));
+        qemudLog(QEMUD_WARN, "%s", _("Failed to read " SYSCONF_DIR
+                                     "/sysconfig/system-config-firewall"));
         return;
     }

diff --git a/src/qemu_driver.c b/src/qemu_driver.c
index 15cd52c..f5fe504 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -71,7 +71,8 @@ static int qemudSetCloseExec(int fd) {
         goto error;
     return 0;
  error:
-    qemudLog(QEMUD_ERR, _("Failed to set close-on-exec file descriptor flag"));
+    qemudLog(QEMUD_ERR,
+             "%s", _("Failed to set close-on-exec file descriptor flag"));
     return -1;
 }

@@ -85,7 +86,8 @@ static int qemudSetNonBlock(int fd) {
         goto error;
     return 0;
  error:
-    qemudLog(QEMUD_ERR, _("Failed to set non-blocking file descriptor flag"));
+    qemudLog(QEMUD_ERR,
+             "%s", _("Failed to set non-blocking file descriptor flag"));
     return -1;
 }

@@ -182,7 +184,8 @@ qemudStartup(void) {
             goto snprintf_error;

         if (asprintf (&base, "%s/.libvirt", pw->pw_dir) == -1) {
-            qemudLog (QEMUD_ERR, _("out of memory in asprintf"));
+            qemudLog (QEMUD_ERR,
+                      "%s", _("out of memory in asprintf"));
             goto out_of_memory;
         }
     }
@@ -224,11 +227,12 @@ qemudStartup(void) {

  snprintf_error:
     qemudLog(QEMUD_ERR,
-             _("Resulting path to long for buffer in qemudInitPaths()"));
+             "%s", _("Resulting path to long for buffer in qemudInitPaths()"));
     return -1;

  out_of_memory:
-    qemudLog (QEMUD_ERR, _("qemudStartup: out of memory"));
+    qemudLog (QEMUD_ERR,
+              "%s", _("qemudStartup: out of memory"));
     free (base);
     free(qemu_driver);
     qemu_driver = NULL;
@@ -246,7 +250,8 @@ qemudReload(void) {
     qemudScanConfigs(qemu_driver);

      if (qemu_driver->iptables) {
-        qemudLog(QEMUD_INFO, _("Reloading iptables rules"));
+        qemudLog(QEMUD_INFO,
+                 "%s", _("Reloading iptables rules"));
         iptablesReloadRules(qemu_driver->iptables);
     }

@@ -777,7 +782,8 @@ static void qemudShutdownVMDaemon(virConnectPtr conn ATTRIBUTE_UNUSED,
     if (waitpid(vm->pid, NULL, WNOHANG) != vm->pid) {
         kill(vm->pid, SIGKILL);
         if (waitpid(vm->pid, NULL, 0) != vm->pid) {
-            qemudLog(QEMUD_WARN, _("Got unexpected pid, damn"));
+            qemudLog(QEMUD_WARN,
+                     "%s", _("Got unexpected pid, damn"));
         }
     }

@@ -1265,7 +1271,8 @@ static int qemudShutdownNetworkDaemon(virConnectPtr conn ATTRIBUTE_UNUSED,
         waitpid(network->dnsmasqPid, NULL, WNOHANG) != network->dnsmasqPid) {
         kill(network->dnsmasqPid, SIGKILL);
         if (waitpid(network->dnsmasqPid, NULL, 0) != network->dnsmasqPid)
-            qemudLog(QEMUD_WARN, _("Got unexpected pid for dnsmasq\n"));
+            qemudLog(QEMUD_WARN,
+                     "%s", _("Got unexpected pid for dnsmasq\n"));
     }

     network->bridge[0] = '\0';
diff --git a/src/storage_backend.c b/src/storage_backend.c
index 6f8940f..a13d9a4 100644
--- a/src/storage_backend.c
+++ b/src/storage_backend.c
@@ -247,7 +247,7 @@ virStorageBackendUpdateVolInfoFD(virConnectPtr conn,
     }
     vol->target.perms.label = strdup(filecon);
     if (vol->target.perms.label == NULL) {
-        virStorageReportError(conn, VIR_ERR_NO_MEMORY, _("context"));
+        virStorageReportError(conn, VIR_ERR_NO_MEMORY, "%s", _("context"));
         return -1;
     }
     freecon(filecon);
@@ -306,7 +306,7 @@ virStorageBackendStablePath(virConnectPtr conn,
         stablepath = malloc(strlen(pool->def->target.path) +
                             1 + strlen(dent->d_name) + 1);
         if (stablepath == NULL) {
-            virStorageReportError(conn, VIR_ERR_NO_MEMORY, _("path"));
+            virStorageReportError(conn, VIR_ERR_NO_MEMORY, "%s", _("path"));
             closedir(dh);
             return NULL;
         }
@@ -359,7 +359,7 @@ virStorageBackendRunProgRegex(virConnectPtr conn,

     /* Compile all regular expressions */
     if ((reg = calloc(nregex, sizeof(*reg))) == NULL) {
-        virStorageReportError(conn, VIR_ERR_NO_MEMORY, _("regex"));
+        virStorageReportError(conn, VIR_ERR_NO_MEMORY, "%s", _("regex"));
         return -1;
     }

@@ -385,12 +385,12 @@ virStorageBackendRunProgRegex(virConnectPtr conn,
     /* Storage for matched variables */
     if ((groups = calloc(totgroups, sizeof(*groups))) == NULL) {
         virStorageReportError(conn, VIR_ERR_NO_MEMORY,
-                              _("regex groups"));
+                              "%s", _("regex groups"));
         goto cleanup;
     }
     if ((vars = calloc(maxvars+1, sizeof(*vars))) == NULL) {
         virStorageReportError(conn, VIR_ERR_NO_MEMORY,
-                              _("regex groups"));
+                              "%s", _("regex groups"));
         goto cleanup;
     }

@@ -402,7 +402,7 @@ virStorageBackendRunProgRegex(virConnectPtr conn,

     if ((list = fdopen(fd, "r")) == NULL) {
         virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
-                              _("cannot read fd"));
+                              "%s", _("cannot read fd"));
         goto cleanup;
     }

@@ -426,7 +426,7 @@ virStorageBackendRunProgRegex(virConnectPtr conn,
                     if ((groups[ngroup++] =
                          strdup(line + vars[j+1].rm_so)) == NULL) {
                         virStorageReportError(conn, VIR_ERR_NO_MEMORY,
-                                              _("regex groups"));
+                                              "%s", _("regex groups"));
                         goto cleanup;
                     }
                 }
@@ -489,7 +489,7 @@ virStorageBackendRunProgRegex(virConnectPtr conn,
             }
         } else {
             virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
-                                  _("command did not exit cleanly"));
+                                  "%s", _("command did not exit cleanly"));
             return -1;
         }
     }
@@ -530,7 +530,7 @@ virStorageBackendRunProgNul(virConnectPtr conn,
     if (n_columns > SIZE_MAX / sizeof *v
         || (v = malloc (n_columns * sizeof *v)) == NULL) {
         virStorageReportError(conn, VIR_ERR_NO_MEMORY,
-                              _("n_columns too large"));
+                              "%s", _("n_columns too large"));
         return -1;
     }
     for (i = 0; i < n_columns; i++)
@@ -543,7 +543,7 @@ virStorageBackendRunProgNul(virConnectPtr conn,

     if ((fp = fdopen(fd, "r")) == NULL) {
         virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
-                              _("cannot read fd"));
+                              "%s", _("cannot read fd"));
         goto cleanup;
     }

@@ -611,7 +611,7 @@ virStorageBackendRunProgNul(virConnectPtr conn,
             }
         } else {
             virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
-                                  _("command did not exit cleanly"));
+                                  "%s", _("command did not exit cleanly"));
             return -1;
         }
     }
diff --git a/src/storage_backend_fs.c b/src/storage_backend_fs.c
index ffb4010..9425cbc 100644
--- a/src/storage_backend_fs.c
+++ b/src/storage_backend_fs.c
@@ -503,18 +503,18 @@ virStorageBackendFileSystemMount(virConnectPtr conn,
     if (pool->def->type == VIR_STORAGE_POOL_NETFS) {
         if (pool->def->source.host.name == NULL) {
             virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
-                                  _("missing source host"));
+                                  "%s", _("missing source host"));
             return -1;
         }
         if (pool->def->source.dir == NULL) {
             virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
-                                  _("missing source path"));
+                                  "%s", _("missing source path"));
             return -1;
         }
     } else {
         if (pool->def->source.ndevice != 1) {
             virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
-                                  _("missing source device"));
+                                  "%s", _("missing source device"));
             return -1;
         }
     }
@@ -537,7 +537,7 @@ virStorageBackendFileSystemMount(virConnectPtr conn,
         src = strdup(pool->def->source.devices[0].path);
     }
     if (src == NULL) {
-        virStorageReportError(conn, VIR_ERR_NO_MEMORY, _("source"));
+        virStorageReportError(conn, VIR_ERR_NO_MEMORY, "%s", _("source"));
         return -1;
     }
     mntargv[3] = src;
@@ -568,18 +568,18 @@ virStorageBackendFileSystemUnmount(virConnectPtr conn,
     if (pool->def->type == VIR_STORAGE_POOL_NETFS) {
         if (pool->def->source.host.name == NULL) {
             virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
-                                  _("missing source host"));
+                                  "%s", _("missing source host"));
             return -1;
         }
         if (pool->def->source.dir == NULL) {
             virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
-                                  _("missing source dir"));
+                                  "%s", _("missing source dir"));
             return -1;
         }
     } else {
         if (pool->def->source.ndevice != 1) {
             virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
-                                  _("missing source device"));
+                                  "%s", _("missing source device"));
             return -1;
         }
     }
@@ -680,7 +680,7 @@ virStorageBackendFileSystemRefresh(virConnectPtr conn,
         vol = calloc(1, sizeof(virStorageVolDef));
         if (vol == NULL) {
             virStorageReportError(conn, VIR_ERR_NO_MEMORY,
-                                  _("volume"));
+                                  "%s", _("volume"));
             goto cleanup;
         }

@@ -688,7 +688,7 @@ virStorageBackendFileSystemRefresh(virConnectPtr conn,
         if (vol->name == NULL) {
             free(vol);
             virStorageReportError(conn, VIR_ERR_NO_MEMORY,
-                                  _("volume name"));
+                                  "%s", _("volume name"));
             goto cleanup;
         }

@@ -699,7 +699,7 @@ virStorageBackendFileSystemRefresh(virConnectPtr conn,
             free(vol->target.path);
             free(vol);
             virStorageReportError(conn, VIR_ERR_NO_MEMORY,
-                                  _("volume name"));
+                                  "%s", _("volume name"));
             goto cleanup;
         }
         strcpy(vol->target.path, pool->def->target.path);
@@ -710,7 +710,7 @@ virStorageBackendFileSystemRefresh(virConnectPtr conn,
             free(vol->target.path);
             free(vol);
             virStorageReportError(conn, VIR_ERR_NO_MEMORY,
-                                  _("volume key"));
+                                  "%s", _("volume key"));
             goto cleanup;
         }

@@ -822,7 +822,7 @@ virStorageBackendFileSystemVolCreate(virConnectPtr conn,
     vol->target.path = malloc(strlen(pool->def->target.path) +
                               1 + strlen(vol->name) + 1);
     if (vol->target.path == NULL) {
-        virStorageReportError(conn, VIR_ERR_NO_MEMORY, _("target"));
+        virStorageReportError(conn, VIR_ERR_NO_MEMORY, "%s", _("target"));
         return -1;
     }
     strcpy(vol->target.path, pool->def->target.path);
@@ -831,7 +831,7 @@ virStorageBackendFileSystemVolCreate(virConnectPtr conn,
     vol->key = strdup(vol->target.path);
     if (vol->key == NULL) {
         virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
-                              _("storage vol key"));
+                              "%s", _("storage vol key"));
         return -1;
     }

@@ -963,7 +963,8 @@ virStorageBackendFileSystemVolCreate(virConnectPtr conn,
         }
 #else
         virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
-                              _("creation of non-raw images is not supported without qemu-img"));
+                              "%s", _("creation of non-raw images "
+                                      "is not supported without qemu-img"));
         return -1;
 #endif
     }
diff --git a/src/storage_backend_iscsi.c b/src/storage_backend_iscsi.c
index 2f7d746..fc79b46 100644
--- a/src/storage_backend_iscsi.c
+++ b/src/storage_backend_iscsi.c
@@ -92,7 +92,7 @@ virStorageBackendISCSIExtractSession(virConnectPtr conn,

     if (STREQ(groups[1], pool->def->source.devices[0].path)) {
         if ((*session = strdup(groups[0])) == NULL) {
-            virStorageReportError(conn, VIR_ERR_NO_MEMORY, _("session"));
+            virStorageReportError(conn, VIR_ERR_NO_MEMORY, "%s", _("session"));
             return -1;
         }
     }
@@ -133,7 +133,7 @@ virStorageBackendISCSISession(virConnectPtr conn,

     if (session == NULL) {
         virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
-                              _("cannot find session"));
+                              "%s", _("cannot find session"));
         return NULL;
     }

@@ -174,17 +174,17 @@ virStorageBackendISCSIMakeLUN(virConnectPtr conn,
     snprintf(lunid, sizeof(lunid)-1, "lun-%s", groups[3]);

     if ((vol = calloc(1, sizeof(virStorageVolDef))) == NULL) {
-        virStorageReportError(conn, VIR_ERR_NO_MEMORY, _("volume"));
+        virStorageReportError(conn, VIR_ERR_NO_MEMORY, "%s", _("volume"));
         return -1;
     }

     if ((vol->name = strdup(lunid)) == NULL) {
-        virStorageReportError(conn, VIR_ERR_NO_MEMORY, _("name"));
+        virStorageReportError(conn, VIR_ERR_NO_MEMORY, "%s", _("name"));
         goto cleanup;
     }

     if ((devpath = malloc(5 + strlen(dev) + 1)) == NULL) {
-        virStorageReportError(conn, VIR_ERR_NO_MEMORY, _("devpath"));
+        virStorageReportError(conn, VIR_ERR_NO_MEMORY, "%s", _("devpath"));
         goto cleanup;
     }
     strcpy(devpath, "/dev/");
@@ -230,7 +230,7 @@ virStorageBackendISCSIMakeLUN(virConnectPtr conn,
     /* XXX use unique iSCSI id instead */
     vol->key = strdup(vol->target.path);
     if (vol->key == NULL) {
-        virStorageReportError(conn, VIR_ERR_NO_MEMORY, _("key"));
+        virStorageReportError(conn, VIR_ERR_NO_MEMORY, "%s", _("key"));
         goto cleanup;
     }

@@ -342,7 +342,7 @@ virStorageBackendISCSIPortal(virConnectPtr conn,

     portal = malloc(strlen(ipaddr) + 1 + 4 + 2 + 1);
     if (portal == NULL) {
-        virStorageReportError(conn, VIR_ERR_NO_MEMORY, _("portal"));
+        virStorageReportError(conn, VIR_ERR_NO_MEMORY, "%s", _("portal"));
         return NULL;
     }

@@ -361,14 +361,14 @@ virStorageBackendISCSIStartPool(virConnectPtr conn,

     if (pool->def->source.host.name == NULL) {
         virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
-                              _("missing source host"));
+                              "%s", _("missing source host"));
         return -1;
     }

     if (pool->def->source.ndevice != 1 ||
         pool->def->source.devices[0].path == NULL) {
         virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
-                              _("missing source device"));
+                              "%s", _("missing source device"));
         return -1;
     }

diff --git a/src/storage_backend_logical.c b/src/storage_backend_logical.c
index c14e788..a70c087 100644
--- a/src/storage_backend_logical.c
+++ b/src/storage_backend_logical.c
@@ -113,12 +113,12 @@ virStorageBackendLogicalMakeVol(virConnectPtr conn,
     /* Or a completely new volume */
     if (vol == NULL) {
         if ((vol = calloc(1, sizeof(*vol))) == NULL) {
-            virStorageReportError(conn, VIR_ERR_NO_MEMORY, _("volume"));
+            virStorageReportError(conn, VIR_ERR_NO_MEMORY, "%s", _("volume"));
             return -1;
         }

         if ((vol->name = strdup(groups[0])) == NULL) {
-            virStorageReportError(conn, VIR_ERR_NO_MEMORY, _("volume"));
+            virStorageReportError(conn, VIR_ERR_NO_MEMORY, "%s", _("volume"));
             return -1;
         }

@@ -130,7 +130,7 @@ virStorageBackendLogicalMakeVol(virConnectPtr conn,
     if (vol->target.path == NULL) {
         if ((vol->target.path = malloc(strlen(pool->def->target.path) +
                                        1 + strlen(vol->name) + 1)) == NULL) {
-            virStorageReportError(conn, VIR_ERR_NO_MEMORY, _("volume"));
+            virStorageReportError(conn, VIR_ERR_NO_MEMORY, "%s", _("volume"));
             return -1;
         }
         strcpy(vol->target.path, pool->def->target.path);
@@ -140,7 +140,7 @@ virStorageBackendLogicalMakeVol(virConnectPtr conn,

     if (vol->key == NULL &&
         (vol->key = strdup(groups[1])) == NULL) {
-        virStorageReportError(conn, VIR_ERR_NO_MEMORY, _("volume"));
+        virStorageReportError(conn, VIR_ERR_NO_MEMORY, "%s", _("volume"));
         return -1;
     }

@@ -151,30 +151,30 @@ virStorageBackendLogicalMakeVol(virConnectPtr conn,
     /* Finally fill in extents information */
     if ((tmp = realloc(vol->source.extents, sizeof(*tmp)
                        * (vol->source.nextent + 1))) == NULL) {
-        virStorageReportError(conn, VIR_ERR_NO_MEMORY, _("extents"));
+        virStorageReportError(conn, VIR_ERR_NO_MEMORY, "%s", _("extents"));
         return -1;
     }
     vol->source.extents = tmp;

     if ((vol->source.extents[vol->source.nextent].path =
          strdup(groups[2])) == NULL) {
-        virStorageReportError(conn, VIR_ERR_NO_MEMORY, _("extents"));
+        virStorageReportError(conn, VIR_ERR_NO_MEMORY, "%s", _("extents"));
         return -1;
     }

     if (virStrToLong_ull(groups[3], NULL, 10, &offset) < 0) {
         virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
-                              _("malformed volume extent offset value"));
+                              "%s", _("malformed volume extent offset value"));
         return -1;
     }
     if (virStrToLong_ull(groups[4], NULL, 10, &length) < 0) {
         virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
-                              _("malformed volume extent length value"));
+                              "%s", _("malformed volume extent length value"));
         return -1;
     }
     if (virStrToLong_ull(groups[5], NULL, 10, &size) < 0) {
         virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
-                              _("malformed volume extent size value"));
+                              "%s", _("malformed volume extent size value"));
         return -1;
     }

@@ -266,7 +266,7 @@ virStorageBackendLogicalBuildPool(virConnectPtr conn,

     /* XXX multiple pvs */
     if ((vgargv = malloc(sizeof(char*) * (1))) == NULL) {
-        virStorageReportError(conn, VIR_ERR_NO_MEMORY, _("command line"));
+        virStorageReportError(conn, VIR_ERR_NO_MEMORY, "%s", _("command line"));
         return -1;
     }

diff --git a/src/storage_conf.c b/src/storage_conf.c
index 8dfcde7..76e141e 100644
--- a/src/storage_conf.c
+++ b/src/storage_conf.c
@@ -153,14 +153,14 @@ virStoragePoolDefParseAuthChap(virConnectPtr conn,
     auth->login = virXPathString("string(/pool/source/auth/@login)", ctxt);
     if (auth->login == NULL) {
         virStorageReportError(conn, VIR_ERR_XML_ERROR,
-                              _("missing auth host attribute"));
+                              "%s", _("missing auth host attribute"));
         return -1;
     }

     auth->passwd = virXPathString("string(/pool/source/auth/@passwd)", ctxt);
     if (auth->passwd == NULL) {
         virStorageReportError(conn, VIR_ERR_XML_ERROR,
-                              _("missing auth passwd attribute"));
+                              "%s", _("missing auth passwd attribute"));
         return -1;
     }

@@ -183,7 +183,7 @@ virStoragePoolDefParsePerms(virConnectPtr conn,
         perms->mode = strtol(mode, &end, 8);
         if (*end || perms->mode < 0 || perms->mode > 0777) {
             virStorageReportError(conn, VIR_ERR_XML_ERROR,
-                                  _("malformed octal mode"));
+                                  "%s", _("malformed octal mode"));
             return -1;
         }
     }
@@ -193,7 +193,7 @@ virStoragePoolDefParsePerms(virConnectPtr conn,
     } else {
         if (virXPathLong("number(/pool/permissions/owner)", ctxt, &v) < 0) {
             virStorageReportError(conn, VIR_ERR_XML_ERROR,
-                                  _("malformed owner element"));
+                                  "%s", _("malformed owner element"));
             return -1;
         }
         perms->uid = (int)v;
@@ -204,7 +204,7 @@ virStoragePoolDefParsePerms(virConnectPtr conn,
     } else {
         if (virXPathLong("number(/pool/permissions/group)", ctxt, &v) < 0) {
             virStorageReportError(conn, VIR_ERR_XML_ERROR,
-                                  _("malformed group element"));
+                                  "%s", _("malformed group element"));
             return -1;
         }
         perms->gid = (int)v;
@@ -232,7 +232,7 @@ virStoragePoolDefParseDoc(virConnectPtr conn,

     if (STRNEQ((const char *)root->name, "pool")) {
         virStorageReportError(conn, VIR_ERR_XML_ERROR,
-                              _("unknown root element"));
+                              "%s", _("unknown root element"));
         goto cleanup;
     }

@@ -248,7 +248,7 @@ virStoragePoolDefParseDoc(virConnectPtr conn,

     if ((ret->name = virXPathString("string(/pool/name)", ctxt)) == NULL) {
         virStorageReportError(conn, VIR_ERR_XML_ERROR,
-                              _("missing name element"));
+                              "%s", _("missing name element"));
         goto cleanup;
     }

@@ -256,13 +256,13 @@ virStoragePoolDefParseDoc(virConnectPtr conn,
     if (uuid == NULL) {
         if (virUUIDGenerate(ret->uuid) < 0) {
             virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
-                                  _("unable to generate uuid"));
+                                  "%s", _("unable to generate uuid"));
             goto cleanup;
         }
     } else {
         if (virUUIDParse(uuid, ret->uuid) < 0) {
             virStorageReportError(conn, VIR_ERR_XML_ERROR,
-                                  _("malformed uuid element"));
+                                  "%s", _("malformed uuid element"));
             goto cleanup;
         }
         free(uuid);
@@ -281,7 +281,7 @@ virStoragePoolDefParseDoc(virConnectPtr conn,
     if (options->flags & VIR_STORAGE_BACKEND_POOL_SOURCE_HOST) {
         if ((ret->source.host.name = virXPathString("string(/pool/source/host/@name)", ctxt)) == NULL) {
             virStorageReportError(conn, VIR_ERR_XML_ERROR,
-                                  _("missing source host name"));
+                                  "%s", _("missing source host name"));
             goto cleanup;
         }
     }
@@ -291,12 +291,12 @@ virStoragePoolDefParseDoc(virConnectPtr conn,

         if ((nsource = virXPathNodeSet("/pool/source/device", ctxt, &nodeset)) <= 0) {
             virStorageReportError(conn, VIR_ERR_XML_ERROR,
-                                  _("cannot extract source devices"));
+                                  "%s", _("cannot extract source devices"));
             goto cleanup;
         }
         if ((ret->source.devices = calloc(nsource, sizeof(*ret->source.devices))) == NULL) {
             free(nodeset);
-            virStorageReportError(conn, VIR_ERR_NO_MEMORY, _("device"));
+            virStorageReportError(conn, VIR_ERR_NO_MEMORY, "%s", _("device"));
             goto cleanup;
         }
         for (i = 0 ; i < nsource ; i++) {
@@ -304,7 +304,7 @@ virStoragePoolDefParseDoc(virConnectPtr conn,
             if (path == NULL) {
                 free(nodeset);
                 virStorageReportError(conn, VIR_ERR_XML_ERROR,
-                                      _("missing source device path"));
+                                      "%s", _("missing source device path"));
                 goto cleanup;
             }
             ret->source.devices[i].path = (char *)path;
@@ -315,7 +315,7 @@ virStoragePoolDefParseDoc(virConnectPtr conn,
     if (options->flags & VIR_STORAGE_BACKEND_POOL_SOURCE_DIR) {
         if ((ret->source.dir = virXPathString("string(/pool/source/dir/@path)", ctxt)) == NULL) {
             virStorageReportError(conn, VIR_ERR_XML_ERROR,
-                                  _("missing source path"));
+                                  "%s", _("missing source path"));
             goto cleanup;
         }
     }
@@ -346,7 +346,7 @@ virStoragePoolDefParseDoc(virConnectPtr conn,

     if ((ret->target.path = virXPathString("string(/pool/target/path)", ctxt)) == NULL) {
         virStorageReportError(conn, VIR_ERR_XML_ERROR,
-                              _("missing target path"));
+                              "%s", _("missing target path"));
         goto cleanup;
     }

@@ -378,21 +378,21 @@ virStoragePoolDefParse(virConnectPtr conn,
                            XML_PARSE_NOENT | XML_PARSE_NONET |
                            XML_PARSE_NOERROR | XML_PARSE_NOWARNING))) {
         virStorageReportError(conn, VIR_ERR_XML_ERROR,
-                              _("malformed xml document"));
+                              "%s", _("malformed xml document"));
         goto cleanup;
     }

     ctxt = xmlXPathNewContext(xml);
     if (ctxt == NULL) {
         virStorageReportError(conn, VIR_ERR_NO_MEMORY,
-                              _("xmlXPathContext"));
+                              "%s", _("xmlXPathContext"));
         goto cleanup;
     }

     node = xmlDocGetRootElement(xml);
     if (node == NULL) {
         virStorageReportError(conn, VIR_ERR_XML_ERROR,
-                              _("missing root element"));
+                              "%s", _("missing root element"));
         goto cleanup;
     }

@@ -429,7 +429,7 @@ virStoragePoolDefFormat(virConnectPtr conn,
     type = virStorageBackendToString(def->type);
     if (!type) {
         virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
-                              _("unexpected pool type"));
+                              "%s", _("unexpected pool type"));
         goto cleanup;
     }
     if (virBufferVSprintf(buf, "<pool type='%s'>\n", type) < 0)
@@ -540,7 +540,7 @@ virStoragePoolDefFormat(virConnectPtr conn,
     return virBufferContentAndFree(buf);

  no_memory:
-    virStorageReportError(conn, VIR_ERR_NO_MEMORY, _("xml"));
+    virStorageReportError(conn, VIR_ERR_NO_MEMORY, "%s", _("xml"));
  cleanup:
     virBufferFree(buf);
     return NULL;
@@ -562,7 +562,7 @@ virStorageVolDefParsePerms(virConnectPtr conn,
         perms->mode = strtol(mode, &end, 8);
         if (*end || perms->mode < 0 || perms->mode > 0777) {
             virStorageReportError(conn, VIR_ERR_XML_ERROR,
-                                  _("malformed octal mode"));
+                                  "%s", _("malformed octal mode"));
             return -1;
         }
     }
@@ -572,7 +572,7 @@ virStorageVolDefParsePerms(virConnectPtr conn,
     } else {
         if (virXPathLong("number(/volume/permissions/owner)", ctxt, &v) < 0) {
             virStorageReportError(conn, VIR_ERR_XML_ERROR,
-                                  _("missing owner element"));
+                                  "%s", _("missing owner element"));
             return -1;
         }
         perms->uid = (int)v;
@@ -582,7 +582,7 @@ virStorageVolDefParsePerms(virConnectPtr conn,
     } else {
         if (virXPathLong("number(/volume/permissions/group)", ctxt, &v) < 0) {
             virStorageReportError(conn, VIR_ERR_XML_ERROR,
-                                  _("missing owner element"));
+                                  "%s", _("missing owner element"));
             return -1;
         }
         perms->gid = (int)v;
@@ -653,12 +653,12 @@ virStorageSize(virConnectPtr conn,

     if (virStrToLong_ull (val, &end, 10, ret) < 0) {
         virStorageReportError(conn, VIR_ERR_XML_ERROR,
-                              _("malformed capacity element"));
+                              "%s", _("malformed capacity element"));
         return -1;
     }
     if (*ret > (ULLONG_MAX / mult)) {
         virStorageReportError(conn, VIR_ERR_XML_ERROR,
-                              _("capacity element value too large"));
+                              "%s", _("capacity element value too large"));
             return -1;
     }

@@ -687,14 +687,14 @@ virStorageVolDefParseDoc(virConnectPtr conn,

     if (STRNEQ((const char *)root->name, "volume")) {
         virStorageReportError(conn, VIR_ERR_XML_ERROR,
-                              _("unknown root element"));
+                              "%s", _("unknown root element"));
         goto cleanup;
     }

     ret->name = virXPathString("string(/volume/name)", ctxt);
     if (ret->name == NULL) {
         virStorageReportError(conn, VIR_ERR_XML_ERROR,
-                              _("missing name element"));
+                              "%s", _("missing name element"));
         goto cleanup;
     }

@@ -705,7 +705,7 @@ virStorageVolDefParseDoc(virConnectPtr conn,
     unit = virXPathString("string(/volume/capacity/@unit)", ctxt);
     if (capacity == NULL) {
         virStorageReportError(conn, VIR_ERR_XML_ERROR,
-                              _("missing capacity element"));
+                              "%s", _("missing capacity element"));
         goto cleanup;
     }
     if (virStorageSize(conn, unit, capacity, &ret->capacity) < 0)
@@ -766,21 +766,21 @@ virStorageVolDefParse(virConnectPtr conn,
                            XML_PARSE_NOENT | XML_PARSE_NONET |
                            XML_PARSE_NOERROR | XML_PARSE_NOWARNING))) {
         virStorageReportError(conn, VIR_ERR_XML_ERROR,
-                              _("malformed xml document"));
+                              "%s", _("malformed xml document"));
         goto cleanup;
     }

     ctxt = xmlXPathNewContext(xml);
     if (ctxt == NULL) {
         virStorageReportError(conn, VIR_ERR_NO_MEMORY,
-                              _("xmlXPathContext"));
+                              "%s", _("xmlXPathContext"));
         goto cleanup;
     }

     node = xmlDocGetRootElement(xml);
     if (node == NULL) {
         virStorageReportError(conn, VIR_ERR_XML_ERROR,
-                              _("missing root element"));
+                              "%s", _("missing root element"));
         goto cleanup;
     }

@@ -903,7 +903,7 @@ virStorageVolDefFormat(virConnectPtr conn,
     return virBufferContentAndFree(buf);

  no_memory:
-    virStorageReportError(conn, VIR_ERR_NO_MEMORY, _("xml"));
+    virStorageReportError(conn, VIR_ERR_NO_MEMORY, "%s", _("xml"));
  cleanup:
     virBufferFree(buf);
     return NULL;
@@ -1013,7 +1013,7 @@ virStoragePoolObjAssignDef(virConnectPtr conn,

     if (!(pool = calloc(1, sizeof(virStoragePoolObj)))) {
         virStorageReportError(conn, VIR_ERR_NO_MEMORY,
-                              _("pool"));
+                              "%s", _("pool"));
         return NULL;
     }

@@ -1150,26 +1150,27 @@ virStoragePoolObjSaveDef(virConnectPtr conn,
         if (virFileBuildPath(driver->configDir, def->name, ".xml",
                              path, sizeof(path)) < 0) {
             virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
-                                  _("cannot construct config file path"));
+                                  "%s", _("cannot construct config file path"));
             return -1;
         }
         if (!(pool->configFile = strdup(path))) {
             virStorageReportError(conn, VIR_ERR_NO_MEMORY,
-                                  _("configFile"));
+                                  "%s", _("configFile"));
             return -1;
         }

         if (virFileBuildPath(driver->autostartDir, def->name, ".xml",
                              path, sizeof(path)) < 0) {
             virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
-                                  _("cannot construct autostart link path"));
+                                  "%s", _("cannot construct "
+                                          "autostart link path"));
             free(pool->configFile);
             pool->configFile = NULL;
             return -1;
         }
         if (!(pool->autostartLink = strdup(path))) {
             virStorageReportError(conn, VIR_ERR_NO_MEMORY,
-                                  _("config file"));
+                                  "%s", _("config file"));
             free(pool->configFile);
             pool->configFile = NULL;
             return -1;
@@ -1178,7 +1179,7 @@ virStoragePoolObjSaveDef(virConnectPtr conn,

     if (!(xml = virStoragePoolDefFormat(conn, def))) {
         virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
-                              _("failed to generate XML"));
+                              "%s", _("failed to generate XML"));
         return -1;
     }

diff --git a/src/storage_driver.c b/src/storage_driver.c
index f97f706..2fa06af 100644
--- a/src/storage_driver.c
+++ b/src/storage_driver.c
@@ -261,7 +261,7 @@ storagePoolLookupByUUID(virConnectPtr conn,

     if (!pool) {
         virStorageReportError(conn, VIR_ERR_NO_STORAGE_POOL,
-                              _("no pool with matching uuid"));
+                              "%s", _("no pool with matching uuid"));
         return NULL;
     }

@@ -279,7 +279,7 @@ storagePoolLookupByName(virConnectPtr conn,

     if (!pool) {
         virStorageReportError(conn, VIR_ERR_NO_STORAGE_POOL,
-                              _("no pool with matching name"));
+                              "%s", _("no pool with matching name"));
         return NULL;
     }

@@ -329,7 +329,7 @@ storageListPools(virConnectPtr conn,
         if (virStoragePoolObjIsActive(pool)) {
             if (!(names[got] = strdup(pool->def->name))) {
                 virStorageReportError(conn, VIR_ERR_NO_MEMORY,
-                                      _("names"));
+                                      "%s", _("names"));
                 goto cleanup;
             }
             got++;
@@ -366,7 +366,7 @@ storageListDefinedPools(virConnectPtr conn,
         if (!virStoragePoolObjIsActive(pool)) {
             if (!(names[got] = strdup(pool->def->name))) {
                 virStorageReportError(conn, VIR_ERR_NO_MEMORY,
-                                      _("names"));
+                                      "%s", _("names"));
                 goto cleanup;
             }
             got++;
@@ -401,7 +401,7 @@ storagePoolCreate(virConnectPtr conn,
     if (virStoragePoolObjFindByUUID(driver, def->uuid) ||
         virStoragePoolObjFindByName(driver, def->name)) {
         virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
-                              _("storage pool already exists"));
+                              "%s", _("storage pool already exists"));
         virStoragePoolDefFree(def);
         return NULL;
     }
@@ -470,13 +470,13 @@ storagePoolUndefine(virStoragePoolPtr obj) {

     if (!pool) {
         virStorageReportError(obj->conn, VIR_ERR_INVALID_STORAGE_POOL,
-                              _("no storage pool with matching uuid"));
+                              "%s", _("no storage pool with matching uuid"));
         return -1;
     }

     if (virStoragePoolObjIsActive(pool)) {
         virStorageReportError(obj->conn, VIR_ERR_INTERNAL_ERROR,
-                              _("pool is still active"));
+                              "%s", _("pool is still active"));
         return -1;
     }

@@ -507,7 +507,7 @@ storagePoolStart(virStoragePoolPtr obj,

     if (!pool) {
         virStorageReportError(obj->conn, VIR_ERR_INVALID_STORAGE_POOL,
-                              _("no storage pool with matching uuid"));
+                              "%s", _("no storage pool with matching uuid"));
         return -1;
     }

@@ -517,7 +517,7 @@ storagePoolStart(virStoragePoolPtr obj,

     if (virStoragePoolObjIsActive(pool)) {
         virStorageReportError(obj->conn, VIR_ERR_INTERNAL_ERROR,
-                              _("pool already active"));
+                              "%s", _("pool already active"));
         return -1;
     }
     if (backend->startPool &&
@@ -546,7 +546,7 @@ storagePoolBuild(virStoragePoolPtr obj,

     if (!pool) {
         virStorageReportError(obj->conn, VIR_ERR_INVALID_STORAGE_POOL,
-                              _("no storage pool with matching uuid"));
+                              "%s", _("no storage pool with matching uuid"));
         return -1;
     }

@@ -556,7 +556,7 @@ storagePoolBuild(virStoragePoolPtr obj,

     if (virStoragePoolObjIsActive(pool)) {
         virStorageReportError(obj->conn, VIR_ERR_INTERNAL_ERROR,
-                              _("storage pool is already active"));
+                              "%s", _("storage pool is already active"));
         return -1;
     }

@@ -577,7 +577,7 @@ storagePoolDestroy(virStoragePoolPtr obj) {

     if (!pool) {
         virStorageReportError(obj->conn, VIR_ERR_INVALID_STORAGE_POOL,
-                              _("no storage pool with matching uuid"));
+                              "%s", _("no storage pool with matching uuid"));
         return -1;
     }

@@ -587,7 +587,7 @@ storagePoolDestroy(virStoragePoolPtr obj) {

     if (!virStoragePoolObjIsActive(pool)) {
         virStorageReportError(obj->conn, VIR_ERR_INTERNAL_ERROR,
-                              _("storage pool is not active"));
+                              "%s", _("storage pool is not active"));
         return -1;
     }

@@ -618,7 +618,7 @@ storagePoolDelete(virStoragePoolPtr obj,

     if (!pool) {
         virStorageReportError(obj->conn, VIR_ERR_INVALID_STORAGE_POOL,
-                              _("no storage pool with matching uuid"));
+                              "%s", _("no storage pool with matching uuid"));
         return -1;
     }

@@ -628,13 +628,13 @@ storagePoolDelete(virStoragePoolPtr obj,

     if (virStoragePoolObjIsActive(pool)) {
         virStorageReportError(obj->conn, VIR_ERR_INTERNAL_ERROR,
-                              _("storage pool is still active"));
+                              "%s", _("storage pool is still active"));
         return -1;
     }

     if (!backend->deletePool) {
         virStorageReportError(obj->conn, VIR_ERR_NO_SUPPORT,
-                              _("pool does not support volume delete"));
+                              "%s", _("pool does not support volume delete"));
         return -1;
     }
     if (backend->deletePool(obj->conn, pool, flags) < 0)
@@ -655,7 +655,7 @@ storagePoolRefresh(virStoragePoolPtr obj,

     if (!pool) {
         virStorageReportError(obj->conn, VIR_ERR_INVALID_STORAGE_POOL,
-                              _("no storage pool with matching uuid"));
+                              "%s", _("no storage pool with matching uuid"));
         return -1;
     }

@@ -665,7 +665,7 @@ storagePoolRefresh(virStoragePoolPtr obj,

     if (!virStoragePoolObjIsActive(pool)) {
         virStorageReportError(obj->conn, VIR_ERR_INTERNAL_ERROR,
-                              _("storage pool is not active"));
+                              "%s", _("storage pool is not active"));
         return -1;
     }

@@ -696,7 +696,7 @@ storagePoolGetInfo(virStoragePoolPtr obj,

     if (!pool) {
         virStorageReportError(obj->conn, VIR_ERR_INVALID_STORAGE_POOL,
-                              _("no storage pool with matching uuid"));
+                              "%s", _("no storage pool with matching uuid"));
         return -1;
     }

@@ -725,7 +725,7 @@ storagePoolDumpXML(virStoragePoolPtr obj,

     if (!pool) {
         virStorageReportError(obj->conn, VIR_ERR_INVALID_STORAGE_POOL,
-                              _("no storage pool with matching uuid"));
+                              "%s", _("no storage pool with matching uuid"));
         return NULL;
     }

@@ -741,7 +741,7 @@ storagePoolGetAutostart(virStoragePoolPtr obj,

     if (!pool) {
         virStorageReportError(obj->conn, VIR_ERR_INVALID_STORAGE_POOL,
-                              _("no pool with matching uuid"));
+                              "%s", _("no pool with matching uuid"));
         return -1;
     }

@@ -763,13 +763,13 @@ storagePoolSetAutostart(virStoragePoolPtr obj,

     if (!pool) {
         virStorageReportError(obj->conn, VIR_ERR_INVALID_STORAGE_POOL,
-                              _("no pool with matching uuid"));
+                              "%s", _("no pool with matching uuid"));
         return -1;
     }

     if (!pool->configFile) {
         virStorageReportError(obj->conn, VIR_ERR_INVALID_ARG,
-                              _("pool has no config file"));
+                              "%s", _("pool has no config file"));
         return -1;
     }

@@ -819,13 +819,13 @@ storagePoolNumVolumes(virStoragePoolPtr obj) {

     if (!pool) {
         virStorageReportError(obj->conn, VIR_ERR_INVALID_STORAGE_POOL,
-                              _("no storage pool with matching uuid"));
+                              "%s", _("no storage pool with matching uuid"));
         return -1;
     }

     if (!virStoragePoolObjIsActive(pool)) {
         virStorageReportError(obj->conn, VIR_ERR_INTERNAL_ERROR,
-                              _("storage pool is not active"));
+                              "%s", _("storage pool is not active"));
         return -1;
     }

@@ -844,13 +844,13 @@ storagePoolListVolumes(virStoragePoolPtr obj,

     if (!pool) {
         virStorageReportError(obj->conn, VIR_ERR_INVALID_STORAGE_POOL,
-                              _("no storage pool with matching uuid"));
+                              "%s", _("no storage pool with matching uuid"));
         return -1;
     }

     if (!virStoragePoolObjIsActive(pool)) {
         virStorageReportError(obj->conn, VIR_ERR_INTERNAL_ERROR,
-                              _("storage pool is not active"));
+                              "%s", _("storage pool is not active"));
         return -1;
     }

@@ -859,7 +859,8 @@ storagePoolListVolumes(virStoragePoolPtr obj,
     while (vol && i < maxnames) {
         names[i] = strdup(vol->name);
         if (names[i] == NULL) {
-            virStorageReportError(obj->conn, VIR_ERR_NO_MEMORY, _("name"));
+            virStorageReportError(obj->conn, VIR_ERR_NO_MEMORY,
+                                  "%s", _("name"));
             goto cleanup;
         }
         vol = vol->next;
@@ -888,13 +889,13 @@ storageVolumeLookupByName(virStoragePoolPtr obj,

     if (!pool) {
         virStorageReportError(obj->conn, VIR_ERR_INVALID_STORAGE_POOL,
-                              _("no storage pool with matching uuid"));
+                              "%s", _("no storage pool with matching uuid"));
         return NULL;
     }

     if (!virStoragePoolObjIsActive(pool)) {
         virStorageReportError(obj->conn, VIR_ERR_INTERNAL_ERROR,
-                              _("storage pool is not active"));
+                              "%s", _("storage pool is not active"));
         return NULL;
     }

@@ -902,7 +903,7 @@ storageVolumeLookupByName(virStoragePoolPtr obj,

     if (!vol) {
         virStorageReportError(obj->conn, VIR_ERR_INVALID_STORAGE_POOL,
-                              _("no storage vol with matching name"));
+                              "%s", _("no storage vol with matching name"));
         return NULL;
     }

@@ -931,7 +932,7 @@ storageVolumeLookupByKey(virConnectPtr conn,
     }

     virStorageReportError(conn, VIR_ERR_INVALID_STORAGE_VOL,
-                          _("no storage vol with matching key"));
+                          "%s", _("no storage vol with matching key"));
     return NULL;
 }

@@ -956,7 +957,7 @@ storageVolumeLookupByPath(virConnectPtr conn,
     }

     virStorageReportError(conn, VIR_ERR_INVALID_STORAGE_VOL,
-                          _("no storage vol with matching path"));
+                          "%s", _("no storage vol with matching path"));
     return NULL;
 }

@@ -972,13 +973,13 @@ storageVolumeCreateXML(virStoragePoolPtr obj,

     if (!pool) {
         virStorageReportError(obj->conn, VIR_ERR_INVALID_STORAGE_POOL,
-                              _("no storage pool with matching uuid"));
+                              "%s", _("no storage pool with matching uuid"));
         return NULL;
     }

     if (!virStoragePoolObjIsActive(pool)) {
         virStorageReportError(obj->conn, VIR_ERR_INTERNAL_ERROR,
-                              _("storage pool is not active"));
+                              "%s", _("storage pool is not active"));
         return NULL;
     }

@@ -991,14 +992,14 @@ storageVolumeCreateXML(virStoragePoolPtr obj,

     if (virStorageVolDefFindByName(pool, vol->name)) {
         virStorageReportError(obj->conn, VIR_ERR_INVALID_STORAGE_POOL,
-                              _("storage vol already exists"));
+                              "%s", _("storage vol already exists"));
         virStorageVolDefFree(vol);
         return NULL;
     }

     if (!backend->createVol) {
         virStorageReportError(obj->conn, VIR_ERR_NO_SUPPORT,
-                              _("storage pool does not support volume creation"));
+                              "%s", _("storage pool does not support volume creation"));
         virStorageVolDefFree(vol);
         return NULL;
     }
@@ -1026,13 +1027,13 @@ storageVolumeDelete(virStorageVolPtr obj,

     if (!pool) {
         virStorageReportError(obj->conn, VIR_ERR_INVALID_STORAGE_POOL,
-                              _("no storage pool with matching uuid"));
+                              "%s", _("no storage pool with matching uuid"));
         return -1;
     }

     if (!virStoragePoolObjIsActive(pool)) {
         virStorageReportError(obj->conn, VIR_ERR_INTERNAL_ERROR,
-                              _("storage pool is not active"));
+                              "%s", _("storage pool is not active"));
         return -1;
     }

@@ -1043,13 +1044,13 @@ storageVolumeDelete(virStorageVolPtr obj,

     if (!vol) {
         virStorageReportError(obj->conn, VIR_ERR_INVALID_STORAGE_POOL,
-                              _("no storage vol with matching name"));
+                              "%s", _("no storage vol with matching name"));
         return -1;
     }

     if (!backend->deleteVol) {
         virStorageReportError(obj->conn, VIR_ERR_NO_SUPPORT,
-                              _("storage pool does not support vol deletion"));
+                              "%s", _("storage pool does not support vol deletion"));
         virStorageVolDefFree(vol);
         return -1;
     }
@@ -1089,13 +1090,13 @@ storageVolumeGetInfo(virStorageVolPtr obj,

     if (!pool) {
         virStorageReportError(obj->conn, VIR_ERR_INVALID_STORAGE_POOL,
-                              _("no storage pool with matching uuid"));
+                              "%s", _("no storage pool with matching uuid"));
         return -1;
     }

     if (!virStoragePoolObjIsActive(pool)) {
         virStorageReportError(obj->conn, VIR_ERR_INTERNAL_ERROR,
-                              _("storage pool is not active"));
+                              "%s", _("storage pool is not active"));
         return -1;
     }

@@ -1103,7 +1104,7 @@ storageVolumeGetInfo(virStorageVolPtr obj,

     if (!vol) {
         virStorageReportError(obj->conn, VIR_ERR_INVALID_STORAGE_POOL,
-                              _("no storage vol with matching name"));
+                              "%s", _("no storage vol with matching name"));
         return -1;
     }

@@ -1133,13 +1134,13 @@ storageVolumeGetXMLDesc(virStorageVolPtr obj,

     if (!pool) {
         virStorageReportError(obj->conn, VIR_ERR_INVALID_STORAGE_POOL,
-                              _("no storage pool with matching uuid"));
+                              "%s", _("no storage pool with matching uuid"));
         return NULL;
     }

     if (!virStoragePoolObjIsActive(pool)) {
         virStorageReportError(obj->conn, VIR_ERR_INTERNAL_ERROR,
-                              _("storage pool is not active"));
+                              "%s", _("storage pool is not active"));
         return NULL;
     }

@@ -1147,7 +1148,7 @@ storageVolumeGetXMLDesc(virStorageVolPtr obj,

     if (!vol) {
         virStorageReportError(obj->conn, VIR_ERR_INVALID_STORAGE_POOL,
-                              _("no storage vol with matching name"));
+                              "%s", _("no storage vol with matching name"));
         return NULL;
     }

@@ -1167,13 +1168,13 @@ storageVolumeGetPath(virStorageVolPtr obj) {

     if (!pool) {
         virStorageReportError(obj->conn, VIR_ERR_INVALID_STORAGE_POOL,
-                              _("no storage pool with matching uuid"));
+                              "%s", _("no storage pool with matching uuid"));
         return NULL;
     }

     if (!virStoragePoolObjIsActive(pool)) {
         virStorageReportError(obj->conn, VIR_ERR_INTERNAL_ERROR,
-                              _("storage pool is not active"));
+                              "%s", _("storage pool is not active"));
         return NULL;
     }

@@ -1181,13 +1182,13 @@ storageVolumeGetPath(virStorageVolPtr obj) {

     if (!vol) {
         virStorageReportError(obj->conn, VIR_ERR_INVALID_STORAGE_POOL,
-                              _("no storage vol with matching name"));
+                              "%s", _("no storage vol with matching name"));
         return NULL;
     }

     ret = strdup(vol->target.path);
     if (ret == NULL) {
-        virStorageReportError(obj->conn, VIR_ERR_NO_MEMORY, _("path"));
+        virStorageReportError(obj->conn, VIR_ERR_NO_MEMORY, "%s", _("path"));
         return NULL;
     }
     return ret;
--
1.5.4.1.144.gc2249

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]