Fri Feb 22 13:32:11 CET 2008 Jim Meyering <meyering@redhat.com>
+ avoid format string warnings
+ Avoid warnings like this:
+ file:nnn:format not a string literal and no format arguments
+ * qemud/qemud.c: Insert a "%s" format argument.
+ * qemud/remote.c: Likewise.
+ * src/iptables.c: Likewise.
+ * src/qemu_driver.c: Likewise.
+ * src/storage_backend.c: Likewise.
+ * src/storage_backend_fs.c: Likewise.
+ * src/storage_backend_iscsi.c Likewise.
+ * src/storage_backend_logical.c: Likewise.
+ * src/storage_conf.c: Likewise.
+ * src/storage_driver.c: Likewise.
+
Use safewrite in place of write, in many cases.
Also add "make syntax-check" rules to ensure no new uses sneak in.
* Makefile.maint (sc_avoid_write): New rule, to avoid recurrence.
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:
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;
}
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;
}
if (!sock) {
qemudLog(QEMUD_ERR,
- _("Failed to allocate memory for struct qemud_socket"));
+ "%s", _("Failed to allocate memory for struct qemud_socket"));
return -1;
}
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;
}
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;
}
snprintf_error:
qemudLog(QEMUD_ERR,
- _("Resulting path to long for buffer in qemudInitPaths()"));
+ "%s", _("Resulting path to long for buffer in qemudInitPaths()"));
return -1;
}
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;
}
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
}
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;
}
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;
}
}
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;
}
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;
}
{
/* 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
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) {
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;
}
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;
}
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;
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;
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;
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;
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
}
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;
qemudScanConfigs(qemu_driver);
if (qemu_driver->iptables) {
- qemudLog(QEMUD_INFO, _("Reloading iptables rules"));
+ qemudLog(QEMUD_INFO,
+ "%s", _("Reloading iptables rules"));
iptablesReloadRules(qemu_driver->iptables);
}
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"));
}
}
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';
}
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);
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;
}
/* 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;
}
/* 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;
}
if ((list = fdopen(fd, "r")) == NULL) {
virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
- _("cannot read fd"));
+ "%s", _("cannot read fd"));
goto cleanup;
}
if ((groups[ngroup++] =
strdup(line + vars[j+1].rm_so)) == NULL) {
virStorageReportError(conn, VIR_ERR_NO_MEMORY,
- _("regex groups"));
+ "%s", _("regex groups"));
goto cleanup;
}
}
}
} else {
virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
- _("command did not exit cleanly"));
+ "%s", _("command did not exit cleanly"));
return -1;
}
}
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++)
if ((fp = fdopen(fd, "r")) == NULL) {
virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
- _("cannot read fd"));
+ "%s", _("cannot read fd"));
goto cleanup;
}
}
} else {
virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
- _("command did not exit cleanly"));
+ "%s", _("command did not exit cleanly"));
return -1;
}
}
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;
}
}
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;
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;
}
}
vol = calloc(1, sizeof(virStorageVolDef));
if (vol == NULL) {
virStorageReportError(conn, VIR_ERR_NO_MEMORY,
- _("volume"));
+ "%s", _("volume"));
goto cleanup;
}
if (vol->name == NULL) {
free(vol);
virStorageReportError(conn, VIR_ERR_NO_MEMORY,
- _("volume name"));
+ "%s", _("volume name"));
goto cleanup;
}
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);
free(vol->target.path);
free(vol);
virStorageReportError(conn, VIR_ERR_NO_MEMORY,
- _("volume key"));
+ "%s", _("volume key"));
goto cleanup;
}
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);
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;
}
}
#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
}
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;
}
}
if (session == NULL) {
virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
- _("cannot find session"));
+ "%s", _("cannot find session"));
return NULL;
}
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/");
/* 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;
}
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;
}
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;
}
/* 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;
}
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);
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;
}
/* 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;
}
/* 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;
}
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;
}
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;
}
}
} 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;
} 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;
if (STRNEQ((const char *)root->name, "pool")) {
virStorageReportError(conn, VIR_ERR_XML_ERROR,
- _("unknown root element"));
+ "%s", _("unknown root element"));
goto cleanup;
}
if ((ret->name = virXPathString("string(/pool/name)", ctxt)) == NULL) {
virStorageReportError(conn, VIR_ERR_XML_ERROR,
- _("missing name element"));
+ "%s", _("missing name element"));
goto cleanup;
}
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);
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;
}
}
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++) {
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;
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;
}
}
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;
}
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;
}
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)
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;
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;
}
}
} 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;
} 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;
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;
}
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;
}
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)
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;
}
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;
if (!(pool = calloc(1, sizeof(virStoragePoolObj)))) {
virStorageReportError(conn, VIR_ERR_NO_MEMORY,
- _("pool"));
+ "%s", _("pool"));
return NULL;
}
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;
if (!(xml = virStoragePoolDefFormat(conn, def))) {
virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
- _("failed to generate XML"));
+ "%s", _("failed to generate XML"));
return -1;
}
if (!pool) {
virStorageReportError(conn, VIR_ERR_NO_STORAGE_POOL,
- _("no pool with matching uuid"));
+ "%s", _("no pool with matching uuid"));
return NULL;
}
if (!pool) {
virStorageReportError(conn, VIR_ERR_NO_STORAGE_POOL,
- _("no pool with matching name"));
+ "%s", _("no pool with matching name"));
return NULL;
}
if (virStoragePoolObjIsActive(pool)) {
if (!(names[got] = strdup(pool->def->name))) {
virStorageReportError(conn, VIR_ERR_NO_MEMORY,
- _("names"));
+ "%s", _("names"));
goto cleanup;
}
got++;
if (!virStoragePoolObjIsActive(pool)) {
if (!(names[got] = strdup(pool->def->name))) {
virStorageReportError(conn, VIR_ERR_NO_MEMORY,
- _("names"));
+ "%s", _("names"));
goto cleanup;
}
got++;
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;
}
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;
}
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 already active"));
+ "%s", _("pool already active"));
return -1;
}
if (backend->startPool &&
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 already active"));
+ "%s", _("storage pool is already active"));
return -1;
}
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;
}
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 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)
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;
}
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 (!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 (!pool) {
virStorageReportError(obj->conn, VIR_ERR_INVALID_STORAGE_POOL,
- _("no pool with matching uuid"));
+ "%s", _("no pool with matching uuid"));
return -1;
}
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;
}
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;
}
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;
}
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;
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;
}
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;
}
}
virStorageReportError(conn, VIR_ERR_INVALID_STORAGE_VOL,
- _("no storage vol with matching key"));
+ "%s", _("no storage vol with matching key"));
return NULL;
}
}
virStorageReportError(conn, VIR_ERR_INVALID_STORAGE_VOL,
- _("no storage vol with matching path"));
+ "%s", _("no storage vol with matching path"));
return NULL;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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 (!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;
}
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;
}
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;
}
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;