Also remove manually added function names from log messages, the logging macros already record them and the logging framework outputs them. Cleanup the msg_gen_function list in cfg.mk. Also don't restrict one of the grep lines in the libvirt_unmarked_diagnostics rule to match exactly one space between function name and opening parenthesis. Update POTFILES.in accordingly. --- cfg.mk | 15 +-- daemon/libvirtd.c | 223 +++++++++---------- daemon/libvirtd.h | 2 - daemon/remote.c | 78 ++++---- ...-Step-7-of-8-Implement-the-driver-methods.patch | 4 +- po/POTFILES.in | 7 - src/conf/secret_conf.c | 2 +- src/lxc/lxc_container.c | 2 +- src/lxc/lxc_controller.c | 2 +- src/lxc/lxc_driver.c | 2 +- src/network/bridge_driver.c | 12 +- src/node_device/node_device_driver.c | 8 +- src/node_device/node_device_linux_sysfs.c | 12 +- src/node_device/node_device_udev.c | 4 +- src/nwfilter/nwfilter_ebiptables_driver.c | 2 +- src/phyp/phyp_driver.c | 28 ++-- src/qemu/qemu_conf.c | 24 +- src/qemu/qemu_driver.c | 48 ++-- src/qemu/qemu_monitor.c | 2 +- src/qemu/qemu_monitor_text.c | 22 +- src/secret/secret_driver.c | 4 +- src/security/security_apparmor.c | 2 +- src/storage/storage_backend_mpath.c | 2 - src/storage/storage_backend_scsi.c | 38 ++-- src/uml/uml_conf.c | 3 - src/uml/uml_driver.c | 23 +- src/util/bridge.c | 16 +- src/util/logging.c | 8 +- src/util/pci.c | 8 +- src/util/uuid.c | 4 +- src/xen/proxy_internal.c | 6 +- tools/console.c | 12 +- 32 files changed, 292 insertions(+), 333 deletions(-) diff --git a/cfg.mk b/cfg.mk index 74fe5ed..619a8e2 100644 --- a/cfg.mk +++ b/cfg.mk @@ -168,28 +168,16 @@ sc_prohibit_gethostby: # |grep -vE '^(qsort|if|close|assert|fputc|free|N_|vir.*GetName|.*Unlock|virNodeListDevices|virHashRemoveEntry|freeaddrinfo|.*[fF]ree|xdrmem_create|xmlXPathFreeObject|virUUIDFormat|openvzSetProgramSentinal|polkit_action_unref)$' msg_gen_function = -msg_gen_function += DEBUG0 -msg_gen_function += DISABLE_fprintf -msg_gen_function += ERROR -msg_gen_function += ERROR0 -msg_gen_function += REMOTE_DEBUG msg_gen_function += ReportError -msg_gen_function += VIR_FREE -msg_gen_function += VIR_INFO -msg_gen_function += VIR_USE_CPU msg_gen_function += errorf msg_gen_function += lxcError -msg_gen_function += networkLog msg_gen_function += networkReportError msg_gen_function += oneError msg_gen_function += openvzError -msg_gen_function += openvzLog msg_gen_function += qemudDispatchClientFailure -msg_gen_function += qemudLog msg_gen_function += qemudReportError msg_gen_function += regerror msg_gen_function += remoteDispatchFormatError -msg_gen_function += umlLog msg_gen_function += umlReportError msg_gen_function += virConfError msg_gen_function += virDomainReportError @@ -197,7 +185,6 @@ msg_gen_function += virSecurityReportError msg_gen_function += virHashError msg_gen_function += virLibConnError msg_gen_function += virLibDomainError -msg_gen_function += virLog msg_gen_function += virNetworkReportError msg_gen_function += virNodeDeviceReportError msg_gen_function += virProxyError @@ -236,7 +223,7 @@ func_re := ($(func_or)) # "%s", _("no storage vol w..." sc_libvirt_unmarked_diagnostics: @grep -nE \ - '\<$(func_re) \([^"]*"[^"]*[a-z]{3}' $$($(VC_LIST_EXCEPT)) \ + '\<$(func_re) *\([^"]*"[^"]*[a-z]{3}' $$($(VC_LIST_EXCEPT)) \ | grep -v '_''(' && \ { echo '$(ME): found unmarked diagnostic(s)' 1>&2; \ exit 1; } || : diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index 208ffca..68fe95a 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -272,7 +272,7 @@ remoteCheckCertFile(const char *type, const char *file) struct stat sb; if (stat(file, &sb) < 0) { char ebuf[1024]; - VIR_ERROR(_("Cannot access %s '%s': %s"), + VIR_ERROR("Cannot access %s '%s': %s", type, file, virStrerror(errno, ebuf, sizeof ebuf)); return -1; } @@ -289,7 +289,7 @@ remoteInitializeGnuTLS (void) err = gnutls_certificate_allocate_credentials (&x509_cred); if (err) { - VIR_ERROR(_("gnutls_certificate_allocate_credentials: %s"), + VIR_ERROR("gnutls_certificate_allocate_credentials failed: %s", gnutls_strerror (err)); return -1; } @@ -298,11 +298,11 @@ remoteInitializeGnuTLS (void) if (remoteCheckCertFile("CA certificate", ca_file) < 0) return -1; - qemudDebug ("loading CA cert from %s", ca_file); + VIR_DEBUG("loading CA cert from %s", ca_file); err = gnutls_certificate_set_x509_trust_file (x509_cred, ca_file, GNUTLS_X509_FMT_PEM); if (err < 0) { - VIR_ERROR(_("gnutls_certificate_set_x509_trust_file: %s"), + VIR_ERROR("gnutls_certificate_set_x509_trust_file failed: %s", gnutls_strerror (err)); return -1; } @@ -316,7 +316,7 @@ remoteInitializeGnuTLS (void) err = gnutls_certificate_set_x509_crl_file (x509_cred, crl_file, GNUTLS_X509_FMT_PEM); if (err < 0) { - VIR_ERROR(_("gnutls_certificate_set_x509_crl_file: %s"), + VIR_ERROR("gnutls_certificate_set_x509_crl_file failed: %s", gnutls_strerror (err)); return -1; } @@ -327,13 +327,13 @@ remoteInitializeGnuTLS (void) return -1; if (remoteCheckCertFile("server key", key_file) < 0) return -1; - DEBUG("loading cert and key from %s and %s", cert_file, key_file); + DEBUG("loading cert and key from '%s' and '%s'", cert_file, key_file); err = gnutls_certificate_set_x509_key_file (x509_cred, cert_file, key_file, GNUTLS_X509_FMT_PEM); if (err < 0) { - VIR_ERROR(_("gnutls_certificate_set_x509_key_file: %s"), + VIR_ERROR("gnutls_certificate_set_x509_key_file failed: %s", gnutls_strerror (err)); return -1; } @@ -346,12 +346,12 @@ remoteInitializeGnuTLS (void) */ err = gnutls_dh_params_init (&dh_params); if (err < 0) { - VIR_ERROR(_("gnutls_dh_params_init: %s"), gnutls_strerror (err)); + VIR_ERROR("gnutls_dh_params_init failed: %s", gnutls_strerror (err)); return -1; } err = gnutls_dh_params_generate2 (dh_params, DH_BITS); if (err < 0) { - VIR_ERROR(_("gnutls_dh_params_generate2: %s"), gnutls_strerror (err)); + VIR_ERROR("gnutls_dh_params_generate2 failed: %s", gnutls_strerror (err)); return -1; } @@ -372,7 +372,7 @@ qemudDispatchSignalEvent(int watch ATTRIBUTE_UNUSED, if (saferead(server->sigread, &siginfo, sizeof(siginfo)) != sizeof(siginfo)) { char ebuf[1024]; - VIR_ERROR(_("Failed to read from signal pipe: %s"), + VIR_ERROR("Failed to read from signal pipe: %s", virStrerror(errno, ebuf, sizeof ebuf)); virMutexUnlock(&server->lock); return; @@ -380,23 +380,23 @@ qemudDispatchSignalEvent(int watch ATTRIBUTE_UNUSED, switch (siginfo.si_signo) { case SIGHUP: - VIR_INFO0(_("Reloading configuration on SIGHUP")); + VIR_INFO0("Reloading configuration on SIGHUP"); virHookCall(VIR_HOOK_DRIVER_DAEMON, "-", VIR_HOOK_DAEMON_OP_RELOAD, SIGHUP, "SIGHUP", NULL); if (virStateReload() < 0) - VIR_WARN0(_("Error while reloading drivers")); + VIR_WARN0("Error while reloading drivers"); break; case SIGINT: case SIGQUIT: case SIGTERM: - VIR_WARN(_("Shutting down on signal %d"), siginfo.si_signo); + VIR_WARN("Shutting down on signal %d", siginfo.si_signo); server->quitEventThread = 1; break; default: - VIR_INFO(_("Received unexpected signal %d"), siginfo.si_signo); + VIR_INFO("Received unexpected signal %d", siginfo.si_signo); break; } @@ -502,27 +502,27 @@ static int qemudWritePidFile(const char *pidFile) { return 0; if ((fd = open(pidFile, O_WRONLY|O_CREAT|O_EXCL, 0644)) < 0) { - VIR_ERROR(_("Failed to open pid file '%s' : %s"), + VIR_ERROR("Failed to open pid file '%s' : %s", pidFile, virStrerror(errno, ebuf, sizeof ebuf)); return -1; } if (!(fh = fdopen(fd, "w"))) { - VIR_ERROR(_("Failed to fdopen pid file '%s' : %s"), + VIR_ERROR("Failed to fdopen pid file '%s' : %s", pidFile, virStrerror(errno, ebuf, sizeof ebuf)); close(fd); return -1; } if (fprintf(fh, "%lu\n", (unsigned long)getpid()) < 0) { - VIR_ERROR(_("Failed to write to pid file '%s' : %s"), + VIR_ERROR("Failed to write to pid file '%s' : %s", pidFile, virStrerror(errno, ebuf, sizeof ebuf)); fclose(fh); return -1; } if (fclose(fh) == EOF) { - VIR_ERROR(_("Failed to close pid file '%s' : %s"), + VIR_ERROR("Failed to close pid file '%s' : %s", pidFile, virStrerror(errno, ebuf, sizeof ebuf)); return -1; } @@ -539,7 +539,7 @@ static int qemudListenUnix(struct qemud_server *server, char ebuf[1024]; if (VIR_ALLOC(sock) < 0) { - VIR_ERROR("%s", _("Failed to allocate memory for struct qemud_socket")); + VIR_ERROR0("Failed to allocate memory for struct qemud_socket"); return -1; } @@ -549,7 +549,7 @@ static int qemudListenUnix(struct qemud_server *server, sock->auth = auth; if ((sock->fd = socket(PF_UNIX, SOCK_STREAM, 0)) < 0) { - VIR_ERROR(_("Failed to create socket: %s"), + VIR_ERROR("Failed to create socket: %s", virStrerror(errno, ebuf, sizeof ebuf)); goto cleanup; } @@ -561,7 +561,7 @@ static int qemudListenUnix(struct qemud_server *server, memset(&addr, 0, sizeof(addr)); addr.sun_family = AF_UNIX; if (virStrcpyStatic(addr.sun_path, path) == NULL) { - VIR_ERROR(_("Path %s too long for unix socket"), path); + VIR_ERROR("Path %s too long for unix socket", path); goto cleanup; } if (addr.sun_path[0] == '@') @@ -570,23 +570,23 @@ static int qemudListenUnix(struct qemud_server *server, oldgrp = getgid(); oldmask = umask(readonly ? ~unix_sock_ro_mask : ~unix_sock_rw_mask); if (server->privileged && setgid(unix_sock_gid)) { - VIR_ERROR(_("Failed to set group ID to %d"), unix_sock_gid); + VIR_ERROR("Failed to set group ID to %d", unix_sock_gid); goto cleanup; } if (bind(sock->fd, (struct sockaddr *)&addr, sizeof(addr)) < 0) { - VIR_ERROR(_("Failed to bind socket to '%s': %s"), + VIR_ERROR("Failed to bind socket to '%s': %s", path, virStrerror(errno, ebuf, sizeof ebuf)); goto cleanup; } umask(oldmask); if (server->privileged && setgid(oldgrp)) { - VIR_ERROR(_("Failed to restore group ID to %d"), oldgrp); + VIR_ERROR("Failed to restore group ID to %d", oldgrp); goto cleanup; } if (listen(sock->fd, 30) < 0) { - VIR_ERROR(_("Failed to listen for connections on '%s': %s"), + VIR_ERROR("Failed to listen for connections on '%s': %s", path, virStrerror(errno, ebuf, sizeof ebuf)); goto cleanup; } @@ -616,7 +616,7 @@ remoteMakeSockets (int *fds, int max_fds, int *nfds_r, const char *node, const c int e = getaddrinfo (node, service, &hints, &ai); if (e != 0) { - VIR_ERROR(_("getaddrinfo: %s"), gai_strerror (e)); + VIR_ERROR("getaddrinfo failed: %s", gai_strerror (e)); return -1; } @@ -626,7 +626,8 @@ remoteMakeSockets (int *fds, int max_fds, int *nfds_r, const char *node, const c fds[*nfds_r] = socket (runp->ai_family, runp->ai_socktype, runp->ai_protocol); if (fds[*nfds_r] == -1) { - VIR_ERROR(_("socket: %s"), virStrerror (errno, ebuf, sizeof ebuf)); + VIR_ERROR("socket failed: %s", + virStrerror (errno, ebuf, sizeof ebuf)); return -1; } @@ -650,7 +651,8 @@ remoteMakeSockets (int *fds, int max_fds, int *nfds_r, const char *node, const c if (bind (fds[*nfds_r], runp->ai_addr, runp->ai_addrlen) == -1) { if (errno != EADDRINUSE) { - VIR_ERROR(_("bind: %s"), virStrerror (errno, ebuf, sizeof ebuf)); + VIR_ERROR("bind failed: %s", + virStrerror (errno, ebuf, sizeof ebuf)); return -1; } close (fds[*nfds_r]); @@ -695,7 +697,7 @@ remoteListenTCP (struct qemud_server *server, socklen_t salen = sizeof(s); if (VIR_ALLOC(sock) < 0) { - VIR_ERROR(_("remoteListenTCP: calloc: %s"), + VIR_ERROR("calloc failed: %s", virStrerror (errno, ebuf, sizeof ebuf)); goto cleanup; } @@ -726,7 +728,7 @@ remoteListenTCP (struct qemud_server *server, goto cleanup; if (listen (sock->fd, 30) < 0) { - VIR_ERROR(_("remoteListenTCP: listen: %s"), + VIR_ERROR("listen failed: %s", virStrerror (errno, ebuf, sizeof ebuf)); goto cleanup; } @@ -755,7 +757,7 @@ static int qemudInitPaths(struct qemud_server *server, /* Change the group ownership of /var/run/libvirt to unix_sock_gid */ if (server->privileged) { if (chown(unix_sock_dir, -1, unix_sock_gid) < 0) - VIR_ERROR(_("Failed to change group ownership of %s"), + VIR_ERROR("Failed to change group ownership of %s", unix_sock_dir); } } else { @@ -817,8 +819,7 @@ static int qemudInitPaths(struct qemud_server *server, snprintf_error: if (ret) - VIR_ERROR("%s", - _("Resulting path too long for buffer in qemudInitPaths()")); + VIR_ERROR0("Resulting path too long for buffer in qemudInitPaths()"); cleanup: VIR_FREE(dir_prefix); @@ -836,7 +837,7 @@ static struct qemud_server *qemudInitialize(void) { struct qemud_server *server; if (VIR_ALLOC(server) < 0) { - VIR_ERROR0(_("Failed to allocate struct qemud_server")); + VIR_ERROR0("Failed to allocate struct qemud_server"); return NULL; } @@ -844,19 +845,19 @@ static struct qemud_server *qemudInitialize(void) { server->sigread = server->sigwrite = -1; if (virMutexInit(&server->lock) < 0) { - VIR_ERROR("%s", _("cannot initialize mutex")); + VIR_ERROR0("cannot initialize mutex"); VIR_FREE(server); return NULL; } if (virCondInit(&server->job) < 0) { - VIR_ERROR("%s", _("cannot initialize condition variable")); + VIR_ERROR0("cannot initialize condition variable"); virMutexDestroy(&server->lock); VIR_FREE(server); return NULL; } if (virEventInit() < 0) { - VIR_ERROR0(_("Failed to initialize event system")); + VIR_ERROR0("Failed to initialize event system"); virMutexDestroy(&server->lock); if (virCondDestroy(&server->job) < 0) {} @@ -953,7 +954,7 @@ static int qemudNetworkInit(struct qemud_server *server) { auth_tcp == REMOTE_AUTH_SASL || auth_tls == REMOTE_AUTH_SASL) { if ((err = sasl_server_init(NULL, "libvirt")) != SASL_OK) { - VIR_ERROR(_("Failed to initialize SASL authentication %s"), + VIR_ERROR("Failed to initialize SASL authentication %s", sasl_errstring(err, NULL, NULL)); goto cleanup; } @@ -971,7 +972,7 @@ static int qemudNetworkInit(struct qemud_server *server) { dbus_error_init(&derr); server->sysbus = dbus_bus_get(DBUS_BUS_SYSTEM, &derr); if (!(server->sysbus)) { - VIR_ERROR(_("Failed to connect to system bus for PolicyKit auth: %s"), + VIR_ERROR("Failed to connect to system bus for PolicyKit auth: %s", derr.message); dbus_error_free(&derr); goto cleanup; @@ -1058,7 +1059,7 @@ static int qemudNetworkEnable(struct qemud_server *server) { VIR_EVENT_HANDLE_HANGUP, qemudDispatchServerEvent, server, NULL)) < 0) { - VIR_ERROR0(_("Failed to add server event callback")); + VIR_ERROR0("Failed to add server event callback"); return -1; } @@ -1094,8 +1095,7 @@ remoteInitializeTLSSession (void) return session; failed: - VIR_ERROR(_("remoteInitializeTLSSession: %s"), - gnutls_strerror (err)); + VIR_ERROR("gnutls error occured: %s", gnutls_strerror (err)); return NULL; } @@ -1110,7 +1110,7 @@ remoteCheckDN (gnutls_x509_crt_t cert) err = gnutls_x509_crt_get_dn (cert, name, &namesize); if (err != 0) { - VIR_ERROR(_("remoteCheckDN: gnutls_x509_cert_get_dn: %s"), + VIR_ERROR("gnutls_x509_cert_get_dn failed: %s", gnutls_strerror (err)); return 0; } @@ -1127,7 +1127,7 @@ remoteCheckDN (gnutls_x509_crt_t cert) } /* Print the client's DN. */ - DEBUG(_("remoteCheckDN: failed: client DN is %s"), name); + VIR_DEBUG("remoteCheckDN failed, client DN is %s", name); return 0; // Not found. } @@ -1142,40 +1142,35 @@ remoteCheckCertificate (gnutls_session_t session) time_t now; if ((ret = gnutls_certificate_verify_peers2 (session, &status)) < 0){ - VIR_ERROR(_("remoteCheckCertificate: verify failed: %s"), - gnutls_strerror (ret)); + VIR_ERROR("verify failed: %s", gnutls_strerror (ret)); return -1; } if (status != 0) { if (status & GNUTLS_CERT_INVALID) - VIR_ERROR0(_("remoteCheckCertificate: " - "the client certificate is not trusted.")); + VIR_ERROR0("the client certificate is not trusted."); if (status & GNUTLS_CERT_SIGNER_NOT_FOUND) - VIR_ERROR0(_("remoteCheckCertificate: the client " - "certificate has unknown issuer.")); + VIR_ERROR0("the client certificate has unknown issuer."); if (status & GNUTLS_CERT_REVOKED) - VIR_ERROR0(_("remoteCheckCertificate: " - "the client certificate has been revoked.")); + VIR_ERROR0("the client certificate has been revoked."); #ifndef GNUTLS_1_0_COMPAT if (status & GNUTLS_CERT_INSECURE_ALGORITHM) - VIR_ERROR0(_("remoteCheckCertificate: the client certificate" - " uses an insecure algorithm.")); + VIR_ERROR0("the client certificate uses an insecure algorithm."); #endif return -1; } if (gnutls_certificate_type_get (session) != GNUTLS_CRT_X509) { - VIR_ERROR0(_("remoteCheckCertificate: certificate is not X.509")); + VIR_ERROR0("certificate is not X.509"); return -1; } if (!(certs = gnutls_certificate_get_peers(session, &nCerts))) { - VIR_ERROR0(_("remoteCheckCertificate: no peers")); + VIR_ERROR0("no peers"); return -1; } @@ -1185,7 +1180,7 @@ remoteCheckCertificate (gnutls_session_t session) gnutls_x509_crt_t cert; if (gnutls_x509_crt_init (&cert) < 0) { - VIR_ERROR0(_("remoteCheckCertificate: gnutls_x509_crt_init failed")); + VIR_ERROR0("gnutls_x509_crt_init failed"); return -1; } @@ -1195,15 +1190,13 @@ remoteCheckCertificate (gnutls_session_t session) } if (gnutls_x509_crt_get_expiration_time (cert) < now) { - VIR_ERROR0(_("remoteCheckCertificate: " - "the client certificate has expired")); + VIR_ERROR0("the client certificate has expired"); gnutls_x509_crt_deinit (cert); return -1; } if (gnutls_x509_crt_get_activation_time (cert) > now) { - VIR_ERROR0(_("remoteCheckCertificate: the client " - "certificate is not yet activated")); + VIR_ERROR0("the client certificate is not yet activated"); gnutls_x509_crt_deinit (cert); return -1; } @@ -1211,7 +1204,12 @@ remoteCheckCertificate (gnutls_session_t session) if (i == 0) { if (!remoteCheckDN (cert)) { /* This is the most common error: make it informative. */ - VIR_ERROR0(_("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.")); + VIR_ERROR0("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; } @@ -1229,16 +1227,14 @@ remoteCheckAccess (struct qemud_client *client) /* Verify client certificate. */ if (remoteCheckCertificate (client->tlssession) == -1) { - VIR_ERROR0(_("remoteCheckCertificate: " - "failed to verify client's certificate")); + VIR_ERROR0("failed to verify client's certificate"); if (!tls_no_verify_certificate) return -1; - else VIR_INFO0(_("remoteCheckCertificate: tls_no_verify_certificate " - "is set so the bad certificate is ignored")); + else VIR_INFO0("tls_no_verify_certificate " + "is set so the bad certificate is ignored"); } if (client->tx) { - VIR_INFO("%s", - _("client had unexpected data pending tx after access check")); + VIR_INFO0("client had unexpected data pending tx after access check"); return -1; } @@ -1266,7 +1262,7 @@ int qemudGetSocketIdentity(int fd, uid_t *uid, pid_t *pid) { if (getsockopt (fd, SOL_SOCKET, SO_PEERCRED, &cr, &cr_len) < 0) { char ebuf[1024]; - VIR_ERROR(_("Failed to verify client credentials: %s"), + VIR_ERROR("Failed to verify client credentials: %s", virStrerror(errno, ebuf, sizeof ebuf)); return -1; } @@ -1294,19 +1290,19 @@ static int qemudDispatchServer(struct qemud_server *server, struct qemud_socket char ebuf[1024]; if (errno == EAGAIN) return 0; - VIR_ERROR(_("Failed to accept connection: %s"), + VIR_ERROR("Failed to accept connection: %s", virStrerror(errno, ebuf, sizeof ebuf)); return -1; } if (server->nclients >= max_clients) { - VIR_ERROR(_("Too many active clients (%d), dropping connection"), max_clients); + VIR_ERROR("Too many active clients (%d), dropping connection", max_clients); close(fd); return -1; } if (VIR_REALLOC_N(server->clients, server->nclients+1) < 0) { - VIR_ERROR0(_("Out of memory allocating clients")); + VIR_ERROR0("Out of memory allocating clients"); close(fd); return -1; } @@ -1347,7 +1343,7 @@ static int qemudDispatchServer(struct qemud_server *server, struct qemud_socket if (VIR_ALLOC(client) < 0) goto cleanup; if (virMutexInit(&client->lock) < 0) { - VIR_ERROR("%s", _("cannot initialize mutex")); + VIR_ERROR0("cannot initialize mutex"); VIR_FREE(client); goto cleanup; } @@ -1384,7 +1380,7 @@ static int qemudDispatchServer(struct qemud_server *server, struct qemud_socket /* Client is running as root, so disable auth */ if (uid == 0) { - VIR_INFO(_("Turn off polkit auth for privileged client %d"), pid); + VIR_INFO("Turn off polkit auth for privileged client %d", pid); client->auth = REMOTE_AUTH_NONE; } } @@ -1423,8 +1419,7 @@ static int qemudDispatchServer(struct qemud_server *server, struct qemud_socket if (qemudRegisterClientEvent (server, client) < 0) goto cleanup; } else { - VIR_ERROR(_("TLS handshake failed: %s"), - gnutls_strerror (ret)); + VIR_ERROR("TLS handshake failed: %s", gnutls_strerror(ret)); goto cleanup; } } @@ -1608,13 +1603,13 @@ static ssize_t qemudClientReadBuf(struct qemud_client *client, ssize_t ret; if (len < 0) { - VIR_ERROR(_("unexpected negative length request %lld"), + VIR_ERROR("unexpected negative length request %lld", (long long int) len); qemudDispatchClientFailure(client); return -1; } - /*qemudDebug ("qemudClientRead: len = %d", len);*/ + /*VIR_DEBUG("qemudClientRead: len = %d", len);*/ if (!client->tlssession) { char ebuf[1024]; @@ -1624,7 +1619,7 @@ static ssize_t qemudClientReadBuf(struct qemud_client *client, return 0; if (ret <= 0) { if (ret != 0) - VIR_ERROR(_("read: %s"), + VIR_ERROR("read: %s", virStrerror (errno, ebuf, sizeof ebuf)); qemudDispatchClientFailure(client); return -1; @@ -1637,7 +1632,7 @@ static ssize_t qemudClientReadBuf(struct qemud_client *client, return 0; if (ret <= 0) { if (ret != 0) - VIR_ERROR(_("gnutls_record_recv: %s"), + VIR_ERROR("gnutls_record_recv: %s", gnutls_strerror (ret)); qemudDispatchClientFailure(client); return -1; @@ -1699,7 +1694,7 @@ static ssize_t qemudClientReadSASL(struct qemud_client *client) { ret = sasl_decode(client->saslconn, encoded, encodedLen, &client->saslDecoded, &client->saslDecodedLength); if (ret != SASL_OK) { - VIR_ERROR(_("failed to decode SASL data %s"), + VIR_ERROR("failed to decode SASL data %s", sasl_errstring(ret, NULL, NULL)); qemudDispatchClientFailure(client); return -1; @@ -1748,7 +1743,7 @@ static ssize_t qemudClientRead(struct qemud_client *client) { */ static void qemudDispatchClientRead(struct qemud_server *server, struct qemud_client *client) { - /*qemudDebug ("qemudDispatchClientRead: mode = %d", client->mode);*/ + /*VIR_DEBUG("qemudDispatchClientRead: mode = %d", client->mode);*/ readmore: if (qemudClientRead(client) < 0) @@ -1858,7 +1853,7 @@ static ssize_t qemudClientWriteBuf(struct qemud_client *client, ssize_t ret; if (len < 0) { - VIR_ERROR(_("unexpected negative length request %lld"), + VIR_ERROR("unexpected negative length request %lld", (long long int) len); qemudDispatchClientFailure(client); return -1; @@ -1869,7 +1864,7 @@ static ssize_t qemudClientWriteBuf(struct qemud_client *client, if ((ret = write(client->fd, data, len)) == -1) { if (errno == EAGAIN || errno == EINTR) return 0; - VIR_ERROR(_("write: %s"), virStrerror (errno, ebuf, sizeof ebuf)); + VIR_ERROR("write: %s", virStrerror (errno, ebuf, sizeof ebuf)); qemudDispatchClientFailure(client); return -1; } @@ -1880,7 +1875,7 @@ static ssize_t qemudClientWriteBuf(struct qemud_client *client, ret == GNUTLS_E_AGAIN) return 0; - VIR_ERROR(_("gnutls_record_send: %s"), gnutls_strerror (ret)); + VIR_ERROR("gnutls_record_send: %s", gnutls_strerror (ret)); qemudDispatchClientFailure(client); return -1; } @@ -1929,7 +1924,7 @@ static int qemudClientWriteSASL(struct qemud_client *client) { &client->saslEncodedLength); if (ret != SASL_OK) { - VIR_ERROR(_("failed to encode SASL data %s"), + VIR_ERROR("failed to encode SASL data %s", sasl_errstring(ret, NULL, NULL)); qemudDispatchClientFailure(client); return -1; @@ -2057,8 +2052,7 @@ qemudDispatchClientHandshake(struct qemud_client *client) { qemudUpdateClientEvent (client); } else { /* Fatal error in handshake */ - VIR_ERROR(_("TLS handshake failed: %s"), - gnutls_strerror (ret)); + VIR_ERROR("TLS handshake failed: %s", gnutls_strerror(ret)); qemudDispatchClientFailure(client); } } @@ -2205,7 +2199,7 @@ static int qemudOneLoop(void) { if (errors) { char ebuf[1024]; sig_errors -= errors; - VIR_ERROR(_("Signal handler reported %d errors: last error: %s"), + VIR_ERROR("Signal handler reported %d errors: last error: %s", errors, virStrerror (sig_lasterrno, ebuf, sizeof ebuf)); return -1; } @@ -2264,7 +2258,7 @@ static void *qemudRunLoop(void *opaque) { (timerid = virEventAddTimeoutImpl(-1, qemudInactiveTimer, server, NULL)) < 0) { - VIR_ERROR0(_("Failed to register shutdown timeout")); + VIR_ERROR0("Failed to register shutdown timeout"); return NULL; } @@ -2273,7 +2267,7 @@ static void *qemudRunLoop(void *opaque) { server->nworkers = max_workers; if (VIR_ALLOC_N(server->workers, server->nworkers) < 0) { - VIR_ERROR0(_("Failed to allocate workers")); + VIR_ERROR0("Failed to allocate workers"); return NULL; } @@ -2457,13 +2451,13 @@ remoteConfigGetStringList(virConfPtr conf, const char *key, char ***list_arg, switch (p->type) { case VIR_CONF_STRING: if (VIR_ALLOC_N(list, 2) < 0) { - VIR_ERROR(_("failed to allocate memory for %s config list"), key); + VIR_ERROR("failed to allocate memory for %s config list", key); return -1; } list[0] = strdup (p->str); list[1] = NULL; if (list[0] == NULL) { - VIR_ERROR(_("failed to allocate memory for %s config list value"), + VIR_ERROR("failed to allocate memory for %s config list value", key); VIR_FREE(list); return -1; @@ -2476,13 +2470,12 @@ remoteConfigGetStringList(virConfPtr conf, const char *key, char ***list_arg, for (pp = p->list; pp; pp = pp->next) len++; if (VIR_ALLOC_N(list, 1+len) < 0) { - VIR_ERROR(_("failed to allocate memory for %s config list"), key); + VIR_ERROR("failed to allocate memory for %s config list", key); return -1; } for (i = 0, pp = p->list; pp; ++i, pp = pp->next) { if (pp->type != VIR_CONF_STRING) { - VIR_ERROR(_("remoteReadConfigFile: %s: %s:" - " must be a string or list of strings\n"), + VIR_ERROR("%s: %s: must be a string or list of strings\n", filename, key); VIR_FREE(list); return -1; @@ -2493,7 +2486,7 @@ remoteConfigGetStringList(virConfPtr conf, const char *key, char ***list_arg, for (j = 0 ; j < i ; j++) VIR_FREE(list[j]); VIR_FREE(list); - VIR_ERROR(_("failed to allocate memory for %s config list value"), + VIR_ERROR("failed to allocate memory for %s config list value", key); return -1; } @@ -2504,8 +2497,7 @@ remoteConfigGetStringList(virConfPtr conf, const char *key, char ***list_arg, } default: - VIR_ERROR(_("remoteReadConfigFile: %s: %s:" - " must be a string or list of strings\n"), + VIR_ERROR("%s: %s: must be a string or list of strings\n", filename, key); return -1; } @@ -2520,8 +2512,7 @@ checkType (virConfValuePtr p, const char *filename, const char *key, virConfType required_type) { if (p->type != required_type) { - VIR_ERROR(_("remoteReadConfigFile: %s: %s: invalid type:" - " got %s; expected %s\n"), filename, key, + VIR_ERROR("%s: %s: invalid type: got %s; expected %s\n", filename, key, virConfTypeName (p->type), virConfTypeName (required_type)); return -1; @@ -2542,8 +2533,7 @@ checkType (virConfValuePtr p, const char *filename, (var_name) = strdup (p->str); \ if ((var_name) == NULL) { \ char ebuf[1024]; \ - VIR_ERROR(_("remoteReadConfigFile: %s"), \ - virStrerror(errno, ebuf, sizeof ebuf)); \ + VIR_ERROR("%s", virStrerror(errno, ebuf, sizeof ebuf)); \ goto free_and_fail; \ } \ } \ @@ -2585,8 +2575,7 @@ static int remoteConfigGetAuth(virConfPtr conf, const char *key, int *auth, cons *auth = REMOTE_AUTH_POLKIT; #endif } else { - VIR_ERROR(_("remoteReadConfigFile: %s: %s: unsupported auth %s"), - filename, key, p->str); + VIR_ERROR("%s: %s: unsupported auth %s", filename, key, p->str); return -1; } @@ -2749,7 +2738,7 @@ remoteReadConfigFile (struct qemud_server *server, const char *filename) GET_CONF_STR (conf, filename, unix_sock_group); if (unix_sock_group) { if (!server->privileged) { - VIR_WARN0(_("Cannot set group when not running as root")); + VIR_WARN0("Cannot set group when not running as root"); } else { int ret; struct group grpdata, *grp; @@ -2759,7 +2748,7 @@ remoteReadConfigFile (struct qemud_server *server, const char *filename) maxbuf = 1024; if (VIR_ALLOC_N(buf, maxbuf) < 0) { - VIR_ERROR("%s", _("Failed to allocate memory for buffer")); + VIR_ERROR0("Failed to allocate memory for buffer"); goto free_and_fail; } @@ -2768,13 +2757,13 @@ remoteReadConfigFile (struct qemud_server *server, const char *filename) &grp)) == ERANGE) { maxbuf *= 2; if (maxbuf > 65536 || VIR_REALLOC_N(buf, maxbuf) < 0) { - VIR_ERROR("%s", _("Failed to reallocate enough memory for buffer")); + VIR_ERROR0("Failed to reallocate enough memory for buffer"); goto free_and_fail; } } if (ret != 0 || !grp) { - VIR_ERROR(_("Failed to lookup group '%s'"), unix_sock_group); + VIR_ERROR("Failed to lookup group '%s'", unix_sock_group); goto free_and_fail; } unix_sock_gid = grp->gr_gid; @@ -2786,7 +2775,7 @@ remoteReadConfigFile (struct qemud_server *server, const char *filename) GET_CONF_STR (conf, filename, unix_sock_ro_perms); if (unix_sock_ro_perms) { if (virStrToLong_i (unix_sock_ro_perms, NULL, 8, &unix_sock_ro_mask) != 0) { - VIR_ERROR(_("Failed to parse mode '%s'"), unix_sock_ro_perms); + VIR_ERROR("Failed to parse mode '%s'", unix_sock_ro_perms); goto free_and_fail; } VIR_FREE(unix_sock_ro_perms); @@ -2795,7 +2784,7 @@ remoteReadConfigFile (struct qemud_server *server, const char *filename) GET_CONF_STR (conf, filename, unix_sock_rw_perms); if (unix_sock_rw_perms) { if (virStrToLong_i (unix_sock_rw_perms, NULL, 8, &unix_sock_rw_mask) != 0) { - VIR_ERROR(_("Failed to parse mode '%s'"), unix_sock_rw_perms); + VIR_ERROR("Failed to parse mode '%s'", unix_sock_rw_perms); goto free_and_fail; } VIR_FREE(unix_sock_rw_perms); @@ -2870,13 +2859,13 @@ qemudSetupPrivs (void) if (__init_daemon_priv (PU_RESETGROUPS | PU_CLEARLIMITSET, SYSTEM_UID, SYSTEM_UID, PRIV_XVM_CONTROL, NULL)) { - VIR_ERROR0(_("additional privileges are required")); + VIR_ERROR0("additional privileges are required"); return -1; } if (priv_set (PRIV_OFF, PRIV_ALLSETS, PRIV_FILE_LINK_ANY, PRIV_PROC_INFO, PRIV_PROC_SESSION, PRIV_PROC_EXEC, PRIV_PROC_FORK, NULL)) { - VIR_ERROR0(_("failed to set reduced privileges")); + VIR_ERROR0("failed to set reduced privileges"); return -1; } @@ -2909,7 +2898,7 @@ daemonSetupSignals(struct qemud_server *server) virSetCloseExec(sigpipe[0]) < 0 || virSetCloseExec(sigpipe[1]) < 0) { char ebuf[1024]; - VIR_ERROR(_("Failed to create pipe: %s"), + VIR_ERROR("Failed to create pipe: %s", virStrerror(errno, ebuf, sizeof ebuf)); goto error; } @@ -2931,7 +2920,7 @@ daemonSetupSignals(struct qemud_server *server) VIR_EVENT_HANDLE_READABLE, qemudDispatchSignalEvent, server, NULL) < 0) { - VIR_ERROR0(_("Failed to register callback for signal pipe")); + VIR_ERROR0("Failed to register callback for signal pipe"); goto error; } @@ -3087,7 +3076,7 @@ int main(int argc, char **argv) { if (godaemon) { char ebuf[1024]; if ((statuswrite = daemonForkIntoBackground()) < 0) { - VIR_ERROR(_("Failed to fork as daemon: %s"), + VIR_ERROR("Failed to fork as daemon: %s", virStrerror(errno, ebuf, sizeof ebuf)); goto error; } @@ -3114,7 +3103,7 @@ int main(int argc, char **argv) { if (mkdir (rundir, 0755)) { if (errno != EEXIST) { char ebuf[1024]; - VIR_ERROR(_("unable to create rundir %s: %s"), rundir, + VIR_ERROR("unable to create rundir %s: %s", rundir, virStrerror(errno, ebuf, sizeof(ebuf))); ret = VIR_DAEMON_ERR_RUNDIR; goto error; diff --git a/daemon/libvirtd.h b/daemon/libvirtd.h index d292681..40cba8c 100644 --- a/daemon/libvirtd.h +++ b/daemon/libvirtd.h @@ -109,8 +109,6 @@ # endif # endif -# define qemudDebug DEBUG - /* Whether we're passing reads & writes through a sasl SSF */ enum qemud_sasl_ssf { QEMUD_SASL_SSF_NONE = 0, diff --git a/daemon/remote.c b/daemon/remote.c index 780d536..868113c 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -3223,7 +3223,7 @@ remoteDispatchAuthSaslInit (struct qemud_server *server, REMOTE_DEBUG("Initialize SASL auth %d", client->fd); if (client->auth != REMOTE_AUTH_SASL || client->saslconn != NULL) { - VIR_ERROR0(_("client tried invalid SASL init request")); + VIR_ERROR0("client tried invalid SASL init request"); goto authfail; } @@ -3265,7 +3265,7 @@ remoteDispatchAuthSaslInit (struct qemud_server *server, VIR_FREE(localAddr); VIR_FREE(remoteAddr); if (err != SASL_OK) { - VIR_ERROR(_("sasl context setup failed %d (%s)"), + VIR_ERROR("sasl context setup failed %d (%s)", err, sasl_errstring(err, NULL, NULL)); client->saslconn = NULL; goto authfail; @@ -3278,7 +3278,7 @@ remoteDispatchAuthSaslInit (struct qemud_server *server, cipher = gnutls_cipher_get(client->tlssession); if (!(ssf = (sasl_ssf_t)gnutls_cipher_get_key_size(cipher))) { - VIR_ERROR0(_("cannot get TLS cipher size")); + VIR_ERROR0("cannot get TLS cipher size"); sasl_dispose(&client->saslconn); client->saslconn = NULL; goto authfail; @@ -3287,7 +3287,7 @@ remoteDispatchAuthSaslInit (struct qemud_server *server, err = sasl_setprop(client->saslconn, SASL_SSF_EXTERNAL, &ssf); if (err != SASL_OK) { - VIR_ERROR(_("cannot set SASL external SSF %d (%s)"), + VIR_ERROR("cannot set SASL external SSF %d (%s)", err, sasl_errstring(err, NULL, NULL)); sasl_dispose(&client->saslconn); client->saslconn = NULL; @@ -3315,7 +3315,7 @@ remoteDispatchAuthSaslInit (struct qemud_server *server, err = sasl_setprop(client->saslconn, SASL_SEC_PROPS, &secprops); if (err != SASL_OK) { - VIR_ERROR(_("cannot set SASL security props %d (%s)"), + VIR_ERROR("cannot set SASL security props %d (%s)", err, sasl_errstring(err, NULL, NULL)); sasl_dispose(&client->saslconn); client->saslconn = NULL; @@ -3331,7 +3331,7 @@ remoteDispatchAuthSaslInit (struct qemud_server *server, NULL, NULL); if (err != SASL_OK) { - VIR_ERROR(_("cannot list SASL mechanisms %d (%s)"), + VIR_ERROR("cannot list SASL mechanisms %d (%s)", err, sasl_errdetail(client->saslconn)); sasl_dispose(&client->saslconn); client->saslconn = NULL; @@ -3340,7 +3340,7 @@ remoteDispatchAuthSaslInit (struct qemud_server *server, REMOTE_DEBUG("Available mechanisms for client: '%s'", mechlist); ret->mechlist = strdup(mechlist); if (!ret->mechlist) { - VIR_ERROR0(_("cannot allocate mechlist")); + VIR_ERROR0("cannot allocate mechlist"); sasl_dispose(&client->saslconn); client->saslconn = NULL; goto authfail; @@ -3371,7 +3371,7 @@ remoteSASLCheckSSF (struct qemud_client *client, err = sasl_getprop(client->saslconn, SASL_SSF, &val); if (err != SASL_OK) { - VIR_ERROR(_("cannot query SASL ssf on connection %d (%s)"), + VIR_ERROR("cannot query SASL ssf on connection %d (%s)", err, sasl_errstring(err, NULL, NULL)); remoteDispatchAuthError(rerr); sasl_dispose(&client->saslconn); @@ -3381,7 +3381,7 @@ remoteSASLCheckSSF (struct qemud_client *client, ssf = *(const int *)val; REMOTE_DEBUG("negotiated an SSF of %d", ssf); if (ssf < 56) { /* 56 is good for Kerberos */ - VIR_ERROR(_("negotiated SSF %d was not strong enough"), ssf); + VIR_ERROR("negotiated SSF %d was not strong enough", ssf); remoteDispatchAuthError(rerr); sasl_dispose(&client->saslconn); client->saslconn = NULL; @@ -3410,7 +3410,7 @@ remoteSASLCheckAccess (struct qemud_server *server, err = sasl_getprop(client->saslconn, SASL_USERNAME, &val); if (err != SASL_OK) { - VIR_ERROR(_("cannot query SASL username on connection %d (%s)"), + VIR_ERROR("cannot query SASL username on connection %d (%s)", err, sasl_errstring(err, NULL, NULL)); remoteDispatchAuthError(rerr); sasl_dispose(&client->saslconn); @@ -3418,7 +3418,7 @@ remoteSASLCheckAccess (struct qemud_server *server, return -1; } if (val == NULL) { - VIR_ERROR0(_("no client username was found")); + VIR_ERROR0("no client username was found"); remoteDispatchAuthError(rerr); sasl_dispose(&client->saslconn); client->saslconn = NULL; @@ -3428,7 +3428,7 @@ remoteSASLCheckAccess (struct qemud_server *server, client->saslUsername = strdup((const char*)val); if (client->saslUsername == NULL) { - VIR_ERROR0(_("out of memory copying username")); + VIR_ERROR0("out of memory copying username"); remoteDispatchAuthError(rerr); sasl_dispose(&client->saslconn); client->saslconn = NULL; @@ -3447,7 +3447,7 @@ remoteSASLCheckAccess (struct qemud_server *server, } /* Denied */ - VIR_ERROR(_("SASL client %s not allowed in whitelist"), client->saslUsername); + VIR_ERROR("SASL client %s not allowed in whitelist", client->saslUsername); remoteDispatchAuthError(rerr); sasl_dispose(&client->saslconn); client->saslconn = NULL; @@ -3478,7 +3478,7 @@ remoteDispatchAuthSaslStart (struct qemud_server *server, REMOTE_DEBUG("Start SASL auth %d", client->fd); if (client->auth != REMOTE_AUTH_SASL || client->saslconn == NULL) { - VIR_ERROR0(_("client tried invalid SASL start request")); + VIR_ERROR0("client tried invalid SASL start request"); goto authfail; } @@ -3493,14 +3493,14 @@ remoteDispatchAuthSaslStart (struct qemud_server *server, &serveroutlen); if (err != SASL_OK && err != SASL_CONTINUE) { - VIR_ERROR(_("sasl start failed %d (%s)"), + VIR_ERROR("sasl start failed %d (%s)", err, sasl_errdetail(client->saslconn)); sasl_dispose(&client->saslconn); client->saslconn = NULL; goto authfail; } if (serveroutlen > REMOTE_AUTH_SASL_DATA_MAX) { - VIR_ERROR(_("sasl start reply data too long %d"), serveroutlen); + VIR_ERROR("sasl start reply data too long %d", serveroutlen); sasl_dispose(&client->saslconn); client->saslconn = NULL; goto authfail; @@ -3566,7 +3566,7 @@ remoteDispatchAuthSaslStep (struct qemud_server *server, REMOTE_DEBUG("Step SASL auth %d", client->fd); if (client->auth != REMOTE_AUTH_SASL || client->saslconn == NULL) { - VIR_ERROR0(_("client tried invalid SASL start request")); + VIR_ERROR0("client tried invalid SASL start request"); goto authfail; } @@ -3580,7 +3580,7 @@ remoteDispatchAuthSaslStep (struct qemud_server *server, &serveroutlen); if (err != SASL_OK && err != SASL_CONTINUE) { - VIR_ERROR(_("sasl step failed %d (%s)"), + VIR_ERROR("sasl step failed %d (%s)", err, sasl_errdetail(client->saslconn)); sasl_dispose(&client->saslconn); client->saslconn = NULL; @@ -3588,7 +3588,7 @@ remoteDispatchAuthSaslStep (struct qemud_server *server, } if (serveroutlen > REMOTE_AUTH_SASL_DATA_MAX) { - VIR_ERROR(_("sasl step reply data too long %d"), + VIR_ERROR("sasl step reply data too long %d", serveroutlen); sasl_dispose(&client->saslconn); client->saslconn = NULL; @@ -3645,7 +3645,7 @@ remoteDispatchAuthSaslInit (struct qemud_server *server ATTRIBUTE_UNUSED, void *args ATTRIBUTE_UNUSED, remote_auth_sasl_init_ret *ret ATTRIBUTE_UNUSED) { - VIR_ERROR0(_("client tried unsupported SASL init request")); + VIR_ERROR0("client tried unsupported SASL init request"); remoteDispatchAuthError(rerr); return -1; } @@ -3659,7 +3659,7 @@ remoteDispatchAuthSaslStart (struct qemud_server *server ATTRIBUTE_UNUSED, remote_auth_sasl_start_args *args ATTRIBUTE_UNUSED, remote_auth_sasl_start_ret *ret ATTRIBUTE_UNUSED) { - VIR_ERROR0(_("client tried unsupported SASL start request")); + VIR_ERROR0("client tried unsupported SASL start request"); remoteDispatchAuthError(rerr); return -1; } @@ -3673,7 +3673,7 @@ remoteDispatchAuthSaslStep (struct qemud_server *server ATTRIBUTE_UNUSED, remote_auth_sasl_step_args *args ATTRIBUTE_UNUSED, remote_auth_sasl_step_ret *ret ATTRIBUTE_UNUSED) { - VIR_ERROR0(_("client tried unsupported SASL step request")); + VIR_ERROR0("client tried unsupported SASL step request"); remoteDispatchAuthError(rerr); return -1; } @@ -3715,33 +3715,33 @@ remoteDispatchAuthPolkit (struct qemud_server *server, REMOTE_DEBUG("Start PolicyKit auth %d", client->fd); if (client->auth != REMOTE_AUTH_POLKIT) { - VIR_ERROR0(_("client tried invalid PolicyKit init request")); + VIR_ERROR0("client tried invalid PolicyKit init request"); goto authfail; } if (qemudGetSocketIdentity(client->fd, &callerUid, &callerPid) < 0) { - VIR_ERROR0(_("cannot get peer socket identity")); + VIR_ERROR0("cannot get peer socket identity"); goto authfail; } - VIR_INFO(_("Checking PID %d running as %d"), callerPid, callerUid); + VIR_INFO("Checking PID %d running as %d", callerPid, callerUid); rv = snprintf(pidbuf, sizeof pidbuf, "%d", callerPid); if (rv < 0 || rv >= sizeof pidbuf) { - VIR_ERROR(_("Caller PID was too large %d"), callerPid); + VIR_ERROR("Caller PID was too large %d", callerPid); goto authfail; } if (virRun(pkcheck, &status) < 0) { - VIR_ERROR(_("Cannot invoke %s"), PKCHECK_PATH); + VIR_ERROR("Cannot invoke %s", PKCHECK_PATH); goto authfail; } if (status != 0) { - VIR_ERROR(_("Policy kit denied action %s from pid %d, uid %d, result: %d"), + VIR_ERROR("Policy kit denied action %s from pid %d, uid %d, result: %d", action, callerPid, callerUid, status); goto authfail; } - VIR_INFO(_("Policy allowed action %s from pid %d, uid %d"), + VIR_INFO("Policy allowed action %s from pid %d, uid %d", action, callerPid, callerUid); ret->complete = 1; client->auth = REMOTE_AUTH_NONE; @@ -3784,27 +3784,27 @@ remoteDispatchAuthPolkit (struct qemud_server *server, REMOTE_DEBUG("Start PolicyKit auth %d", client->fd); if (client->auth != REMOTE_AUTH_POLKIT) { - VIR_ERROR0(_("client tried invalid PolicyKit init request")); + VIR_ERROR0("client tried invalid PolicyKit init request"); goto authfail; } if (qemudGetSocketIdentity(client->fd, &callerUid, &callerPid) < 0) { - VIR_ERROR0(_("cannot get peer socket identity")); + VIR_ERROR0("cannot get peer socket identity"); goto authfail; } - VIR_INFO(_("Checking PID %d running as %d"), callerPid, callerUid); + VIR_INFO("Checking PID %d running as %d", callerPid, callerUid); dbus_error_init(&err); if (!(pkcaller = polkit_caller_new_from_pid(server->sysbus, callerPid, &err))) { - VIR_ERROR(_("Failed to lookup policy kit caller: %s"), err.message); + VIR_ERROR("Failed to lookup policy kit caller: %s", err.message); dbus_error_free(&err); goto authfail; } if (!(pkaction = polkit_action_new())) { char ebuf[1024]; - VIR_ERROR(_("Failed to create polkit action %s"), + VIR_ERROR("Failed to create polkit action %s", virStrerror(errno, ebuf, sizeof ebuf)); polkit_caller_unref(pkcaller); goto authfail; @@ -3814,7 +3814,7 @@ remoteDispatchAuthPolkit (struct qemud_server *server, if (!(pkcontext = polkit_context_new()) || !polkit_context_init(pkcontext, &pkerr)) { char ebuf[1024]; - VIR_ERROR(_("Failed to create polkit context %s"), + VIR_ERROR("Failed to create polkit context %s", (pkerr ? polkit_error_get_error_message(pkerr) : virStrerror(errno, ebuf, sizeof ebuf))); if (pkerr) @@ -3832,7 +3832,7 @@ remoteDispatchAuthPolkit (struct qemud_server *server, 0, &pkerr); if (pkerr && polkit_error_is_set(pkerr)) { - VIR_ERROR(_("Policy kit failed to check authorization %d %s"), + VIR_ERROR("Policy kit failed to check authorization %d %s", polkit_error_get_error_code(pkerr), polkit_error_get_error_message(pkerr)); goto authfail; @@ -3846,12 +3846,12 @@ remoteDispatchAuthPolkit (struct qemud_server *server, polkit_caller_unref(pkcaller); polkit_action_unref(pkaction); if (pkresult != POLKIT_RESULT_YES) { - VIR_ERROR(_("Policy kit denied action %s from pid %d, uid %d, result: %s"), + VIR_ERROR("Policy kit denied action %s from pid %d, uid %d, result: %s", action, callerPid, callerUid, polkit_result_to_string_representation(pkresult)); goto authfail; } - VIR_INFO(_("Policy allowed action %s from pid %d, uid %d, result %s"), + VIR_INFO("Policy allowed action %s from pid %d, uid %d, result %s", action, callerPid, callerUid, polkit_result_to_string_representation(pkresult)); ret->complete = 1; @@ -3877,7 +3877,7 @@ remoteDispatchAuthPolkit (struct qemud_server *server ATTRIBUTE_UNUSED, void *args ATTRIBUTE_UNUSED, remote_auth_polkit_ret *ret ATTRIBUTE_UNUSED) { - VIR_ERROR0(_("client tried unsupported PolicyKit init request")); + VIR_ERROR0("client tried unsupported PolicyKit init request"); remoteDispatchAuthError(rerr); return -1; } diff --git a/docs/api_extension/0007-Step-7-of-8-Implement-the-driver-methods.patch b/docs/api_extension/0007-Step-7-of-8-Implement-the-driver-methods.patch index 807ed78..ff1124f 100644 --- a/docs/api_extension/0007-Step-7-of-8-Implement-the-driver-methods.patch +++ b/docs/api_extension/0007-Step-7-of-8-Implement-the-driver-methods.patch @@ -146,7 +146,7 @@ index b84729f..4f73baf 100644 + goto cleanup; + } + -+ VIR_DEBUG(_("Vport operation path is '%s'"), operation_path); ++ VIR_DEBUG("Vport operation path is '%s'", operation_path); + + fd = open(operation_path, O_WRONLY); + @@ -959,7 +959,7 @@ index 0000000..1deb6d2 + char buf[64]; + struct stat st; + -+ VIR_DEBUG(_("Checking if host%d is an FC HBA"), d->scsi_host.host); ++ VIR_DEBUG("Checking if host%d is an FC HBA", d->scsi_host.host); + + if (virAsprintf(&sysfs_path, "%s/host%d", + LINUX_SYSFS_FC_HOST_PREFIX, diff --git a/po/POTFILES.in b/po/POTFILES.in index 417bfa1..6c93e2a 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1,5 +1,4 @@ daemon/dispatch.c -daemon/libvirtd.c daemon/remote.c daemon/stream.c src/conf/cpu_conf.c @@ -25,8 +24,6 @@ src/lxc/lxc_controller.c src/lxc/lxc_driver.c src/network/bridge_driver.c src/node_device/node_device_driver.c -src/node_device/node_device_linux_sysfs.c -src/node_device/node_device_udev.c src/nodeinfo.c src/nwfilter/nwfilter_driver.c src/nwfilter/nwfilter_ebiptables_driver.c @@ -61,19 +58,16 @@ src/test/test_driver.c src/uml/uml_conf.c src/uml/uml_driver.c src/util/authhelper.c -src/util/bridge.c src/util/conf.c src/util/hooks.c src/util/hostusb.c src/util/json.c -src/util/logging.c src/util/macvtap.c src/util/pci.c src/util/processinfo.c src/util/stats_linux.c src/util/storage_file.c src/util/util.c -src/util/uuid.c src/util/virterror.c src/util/xml.c src/vbox/vbox_driver.c @@ -87,5 +81,4 @@ src/xen/xm_internal.c src/xen/xs_internal.c src/xenapi/xenapi_driver.c src/xenapi/xenapi_utils.c -tools/console.c tools/virsh.c diff --git a/src/conf/secret_conf.c b/src/conf/secret_conf.c index bbdad89..b3657be 100644 --- a/src/conf/secret_conf.c +++ b/src/conf/secret_conf.c @@ -53,7 +53,7 @@ virSecretDefFree(virSecretDefPtr def) break; default: - VIR_ERROR(_("unexpected secret usage type %d"), def->usage_type); + VIR_ERROR("unexpected secret usage type %d", def->usage_type); break; } VIR_FREE(def); diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c index 706c796..018f4d5 100644 --- a/src/lxc/lxc_container.c +++ b/src/lxc/lxc_container.c @@ -716,7 +716,7 @@ static int lxcContainerDropCapabilities(void) * be unmasked - they can never escape the bounding set. */ #else - VIR_WARN0(_("libcap-ng support not compiled in, unable to clear capabilities")); + VIR_WARN0("libcap-ng support not compiled in, unable to clear capabilities"); #endif return 0; } diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index c120b8e..1732780 100644 --- a/src/lxc/lxc_controller.c +++ b/src/lxc/lxc_controller.c @@ -259,7 +259,7 @@ static int lxcControllerClearCapabilities(void) return -1; } #else - VIR_WARN0(_("libcap-ng support not compiled in, unable to clear capabilities")); + VIR_WARN0("libcap-ng support not compiled in, unable to clear capabilities"); #endif return 0; } diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 01330ec..fb9e010 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -1684,7 +1684,7 @@ lxcAutostartDomain(void *payload, const char *name ATTRIBUTE_UNUSED, void *opaqu int ret = lxcVmStart(data->conn, data->driver, vm); if (ret < 0) { virErrorPtr err = virGetLastError(); - VIR_ERROR(_("Failed to autostart VM '%s': %s"), + VIR_ERROR("Failed to autostart VM '%s': %s", vm->def->name, err ? err->message : ""); } else { diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 83ab00e..4eeaeed 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -806,7 +806,7 @@ networkReloadIptablesRules(struct network_driver *driver) { unsigned int i; - VIR_INFO0(_("Reloading iptables rules")); + VIR_INFO0("Reloading iptables rules"); for (i = 0 ; i < driver->networks.count ; i++) { virNetworkObjLock(driver->networks.objs[i]); @@ -970,14 +970,14 @@ static int networkStartNetworkDaemon(struct network_driver *driver, err_delbr1: if ((err = brSetInterfaceUp(driver->brctl, network->def->bridge, 0))) { char ebuf[1024]; - VIR_WARN(_("Failed to bring down bridge '%s' : %s"), + VIR_WARN("Failed to bring down bridge '%s' : %s", network->def->bridge, virStrerror(err, ebuf, sizeof ebuf)); } err_delbr: if ((err = brDeleteBridge(driver->brctl, network->def->bridge))) { char ebuf[1024]; - VIR_WARN(_("Failed to delete bridge '%s' : %s"), + VIR_WARN("Failed to delete bridge '%s' : %s", network->def->bridge, virStrerror(err, ebuf, sizeof ebuf)); } @@ -991,7 +991,7 @@ static int networkShutdownNetworkDaemon(struct network_driver *driver, int err; char *stateFile; - VIR_INFO(_("Shutting down network '%s'"), network->def->name); + VIR_INFO("Shutting down network '%s'", network->def->name); if (!virNetworkObjIsActive(network)) return 0; @@ -1010,12 +1010,12 @@ static int networkShutdownNetworkDaemon(struct network_driver *driver, char ebuf[1024]; if ((err = brSetInterfaceUp(driver->brctl, network->def->bridge, 0))) { - VIR_WARN(_("Failed to bring down bridge '%s' : %s"), + VIR_WARN("Failed to bring down bridge '%s' : %s", network->def->bridge, virStrerror(err, ebuf, sizeof ebuf)); } if ((err = brDeleteBridge(driver->brctl, network->def->bridge))) { - VIR_WARN(_("Failed to delete bridge '%s' : %s"), + VIR_WARN("Failed to delete bridge '%s' : %s", network->def->bridge, virStrerror(err, ebuf, sizeof ebuf)); } diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c index b0ea986..c0fdce6 100644 --- a/src/node_device/node_device_driver.c +++ b/src/node_device/node_device_driver.c @@ -51,14 +51,14 @@ static int update_caps(virNodeDeviceObjPtr dev) if (read_wwn(cap->data.scsi_host.host, "port_name", &cap->data.scsi_host.wwpn) == -1) { - VIR_ERROR(_("Failed to refresh WWPN for host%d"), + VIR_ERROR("Failed to refresh WWPN for host%d", cap->data.scsi_host.host); } if (read_wwn(cap->data.scsi_host.host, "node_name", &cap->data.scsi_host.wwnn) == -1) { - VIR_ERROR(_("Failed to refresh WWNN for host%d"), + VIR_ERROR("Failed to refresh WWNN for host%d", cap->data.scsi_host.host); } } @@ -432,7 +432,7 @@ nodeDeviceVportCreateDelete(const int parent_host, goto cleanup; } - VIR_DEBUG(_("Vport operation path is '%s'"), operation_path); + VIR_DEBUG("Vport operation path is '%s'", operation_path); if (virAsprintf(&vport_name, "%s:%s", @@ -455,7 +455,7 @@ nodeDeviceVportCreateDelete(const int parent_host, cleanup: VIR_FREE(vport_name); VIR_FREE(operation_path); - VIR_DEBUG("%s", _("Vport operation complete")); + VIR_DEBUG0("Vport operation complete"); return retval; } diff --git a/src/node_device/node_device_linux_sysfs.c b/src/node_device/node_device_linux_sysfs.c index c4d1d01..9ed0daa 100644 --- a/src/node_device/node_device_linux_sysfs.c +++ b/src/node_device/node_device_linux_sysfs.c @@ -53,10 +53,10 @@ static int open_wwn_file(const char *prefix, /* fd will be closed by caller */ if ((*fd = open(wwn_path, O_RDONLY)) != -1) { - VIR_DEBUG(_("Opened WWN path '%s' for reading"), + VIR_DEBUG("Opened WWN path '%s' for reading", wwn_path); } else { - VIR_ERROR(_("Failed to open WWN path '%s' for reading"), + VIR_ERROR("Failed to open WWN path '%s' for reading", wwn_path); } @@ -79,7 +79,7 @@ int read_wwn_linux(int host, const char *file, char **wwn) memset(buf, 0, sizeof(buf)); if (saferead(fd, buf, sizeof(buf)) < 0) { retval = -1; - VIR_DEBUG(_("Failed to read WWN for host%d '%s'"), + VIR_DEBUG("Failed to read WWN for host%d '%s'", host, file); goto out; } @@ -117,7 +117,7 @@ int check_fc_host_linux(union _virNodeDevCapData *d) int retval = 0; struct stat st; - VIR_DEBUG(_("Checking if host%d is an FC HBA"), d->scsi_host.host); + VIR_DEBUG("Checking if host%d is an FC HBA", d->scsi_host.host); if (virAsprintf(&sysfs_path, "%s/host%d", LINUX_SYSFS_FC_HOST_PREFIX, @@ -137,7 +137,7 @@ int check_fc_host_linux(union _virNodeDevCapData *d) if (read_wwn(d->scsi_host.host, "port_name", &d->scsi_host.wwpn) == -1) { - VIR_ERROR(_("Failed to read WWPN for host%d"), + VIR_ERROR("Failed to read WWPN for host%d", d->scsi_host.host); retval = -1; goto out; @@ -146,7 +146,7 @@ int check_fc_host_linux(union _virNodeDevCapData *d) if (read_wwn(d->scsi_host.host, "node_name", &d->scsi_host.wwnn) == -1) { - VIR_ERROR(_("Failed to read WWNN for host%d"), + VIR_ERROR("Failed to read WWNN for host%d", d->scsi_host.host); retval = -1; } diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c index e3114fa..47f53f7 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -112,7 +112,7 @@ static int udevGetDeviceProperty(struct udev_device *udev_device, udev_value = udev_device_get_property_value(udev_device, property_key); if (udev_value == NULL) { - VIR_INFO(_("udev reports device '%s' does not have property '%s'"), + VIR_INFO("udev reports device '%s' does not have property '%s'", udev_device_get_sysname(udev_device), property_key); ret = PROPERTY_MISSING; goto out; @@ -201,7 +201,7 @@ static int udevGetDeviceSysfsAttr(struct udev_device *udev_device, udev_value = udev_device_get_sysattr_value(udev_device, attr_name); if (udev_value == NULL) { - VIR_INFO(_("udev reports device '%s' does not have sysfs attr '%s'"), + VIR_INFO("udev reports device '%s' does not have sysfs attr '%s'", udev_device_get_sysname(udev_device), attr_name); ret = PROPERTY_MISSING; goto out; diff --git a/src/nwfilter/nwfilter_ebiptables_driver.c b/src/nwfilter/nwfilter_ebiptables_driver.c index 6d66543..cffe027 100644 --- a/src/nwfilter/nwfilter_ebiptables_driver.c +++ b/src/nwfilter/nwfilter_ebiptables_driver.c @@ -204,7 +204,7 @@ _printDataType(virConnectPtr conn, case DATATYPE_IPMASK: if (snprintf(buf, bufsize, "%d", item->u.u8) >= bufsize) { - virNWFilterReportError(conn, VIR_ERR_INVALID_NWFILTER, + virNWFilterReportError(conn, VIR_ERR_INVALID_NWFILTER, "%s", _("Buffer too small for uint8 type")); return 1; } diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c index 0e1d35f..365fb08 100644 --- a/src/phyp/phyp_driver.c +++ b/src/phyp/phyp_driver.c @@ -1234,30 +1234,30 @@ phypDomainDumpXML(virDomainPtr dom, int flags) dom->conn); if (lpar_name == NULL) { - VIR_ERROR("%s", "Unable to determine domain's name."); + VIR_ERROR0("Unable to determine domain's name."); goto err; } if (phypGetLparUUID(def.uuid, dom->id, dom->conn) == -1) { - VIR_ERROR("%s", "Unable to generate random uuid."); + VIR_ERROR0("Unable to generate random uuid."); goto err; } if ((def.maxmem = phypGetLparMem(dom->conn, managed_system, dom->id, 0)) == 0) { - VIR_ERROR("%s", "Unable to determine domain's max memory."); + VIR_ERROR0("Unable to determine domain's max memory."); goto err; } if ((def.memory = phypGetLparMem(dom->conn, managed_system, dom->id, 1)) == 0) { - VIR_ERROR("%s", "Unable to determine domain's memory."); + VIR_ERROR0("Unable to determine domain's memory."); goto err; } if ((def.vcpus = phypGetLparCPU(dom->conn, managed_system, dom->id)) == 0) { - VIR_ERROR("%s", "Unable to determine domain's CPU."); + VIR_ERROR0("Unable to determine domain's CPU."); goto err; } @@ -1521,9 +1521,8 @@ phypDomainSetCPU(virDomainPtr dom, unsigned int nvcpus) goto err; if (nvcpus > phypGetLparCPUMAX(dom)) { - VIR_ERROR("%s", - "You are trying to set a number of CPUs bigger than " - "the max possible.."); + VIR_ERROR0("You are trying to set a number of CPUs bigger than " + "the max possible.."); goto err; } @@ -1548,9 +1547,8 @@ phypDomainSetCPU(virDomainPtr dom, unsigned int nvcpus) ret = phypExec(session, cmd, &exit_status, dom->conn); if (exit_status < 0) { - VIR_ERROR("%s", - "Possibly you don't have IBM Tools installed in your LPAR." - "Contact your support to enable this feature."); + VIR_ERROR0("Possibly you don't have IBM Tools installed in your LPAR." + "Contact your support to enable this feature."); goto err; } @@ -1681,12 +1679,12 @@ phypBuildLpar(virConnectPtr conn, virDomainDefPtr def) ret = phypExec(session, cmd, &exit_status, conn); if (exit_status < 0) { - VIR_ERROR("%s\"%s\"", "Unable to create LPAR. Reason: ", ret); + VIR_ERROR("Unable to create LPAR. Reason: %s", ret); goto err; } if (phypUUIDTable_AddLpar(conn, def->uuid, def->id) == -1) { - VIR_ERROR("%s", "Unable to add LPAR to the table"); + VIR_ERROR0("Unable to add LPAR to the table"); goto err; } @@ -1828,13 +1826,13 @@ phypUUIDTable_WriteFile(virConnectPtr conn) if (safewrite(fd, &uuid_table->lpars[i]->id, sizeof(uuid_table->lpars[i]->id)) != sizeof(uuid_table->lpars[i]->id)) { - VIR_ERROR("%s", "Unable to write information to local file."); + VIR_ERROR0("Unable to write information to local file."); goto err; } if (safewrite(fd, uuid_table->lpars[i]->uuid, VIR_UUID_BUFLEN) != VIR_UUID_BUFLEN) { - VIR_ERROR("%s", "Unable to write information to local file."); + VIR_ERROR0("Unable to write information to local file."); goto err; } } diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 55397cd..087bb72 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -254,7 +254,7 @@ int qemudLoadDriverConfig(struct qemud_driver *driver, for (i = 0, pp = p->list; pp; ++i, pp = pp->next) { int ctl; if (pp->type != VIR_CONF_STRING) { - VIR_ERROR("%s", _("cgroup_controllers must be a list of strings")); + VIR_ERROR0("cgroup_controllers must be a list of strings"); virConfFree(conf); return -1; } @@ -292,7 +292,7 @@ int qemudLoadDriverConfig(struct qemud_driver *driver, } for (i = 0, pp = p->list; pp; ++i, pp = pp->next) { if (pp->type != VIR_CONF_STRING) { - VIR_ERROR("%s", _("cgroup_device_acl must be a list of strings")); + VIR_ERROR0("cgroup_device_acl must be a list of strings"); virConfFree(conf); return -1; } @@ -515,7 +515,7 @@ rewait: if (errno == EINTR) goto rewait; - VIR_ERROR(_("Unexpected exit status from qemu %d pid %lu"), + VIR_ERROR("Unexpected exit status from qemu %d pid %lu", WEXITSTATUS(status), (unsigned long)child); ret = -1; } @@ -523,7 +523,7 @@ rewait: * as there's really no need to throw an error if we did * actually read a valid version number above */ if (WEXITSTATUS(status) != 0) { - VIR_WARN(_("Unexpected exit status '%d', qemu probably failed"), + VIR_WARN("Unexpected exit status '%d', qemu probably failed", WEXITSTATUS(status)); } @@ -718,7 +718,7 @@ qemudProbeCPUModels(const char *qemu, if (STREQ(arch, "i686") || STREQ(arch, "x86_64")) parse = qemudParseX86Models; else { - VIR_DEBUG(_("don't know how to parse %s CPU models"), arch); + VIR_DEBUG("don't know how to parse %s CPU models", arch); return 0; } @@ -750,7 +750,7 @@ rewait: if (errno == EINTR) goto rewait; - VIR_ERROR(_("Unexpected exit status from qemu %d pid %lu"), + VIR_ERROR("Unexpected exit status from qemu %d pid %lu", WEXITSTATUS(status), (unsigned long)child); ret = -1; } @@ -758,7 +758,7 @@ rewait: * as there's really no need to throw an error if we did * actually read a valid version number above */ if (WEXITSTATUS(status) != 0) { - VIR_WARN(_("Unexpected exit status '%d', qemu probably failed"), + VIR_WARN("Unexpected exit status '%d', qemu probably failed", WEXITSTATUS(status)); } @@ -838,7 +838,7 @@ qemudCapsInitGuest(virCapsPtr caps, binary_mtime = st.st_mtime; } else { char ebuf[1024]; - VIR_WARN(_("Failed to stat %s, most peculiar : %s"), + VIR_WARN("Failed to stat %s, most peculiar : %s", binary, virStrerror(errno, ebuf, sizeof(ebuf))); binary_mtime = 0; } @@ -922,7 +922,7 @@ qemudCapsInitGuest(virCapsPtr caps, binary_mtime = st.st_mtime; } else { char ebuf[1024]; - VIR_WARN(_("Failed to stat %s, most peculiar : %s"), + VIR_WARN("Failed to stat %s, most peculiar : %s", binary, virStrerror(errno, ebuf, sizeof(ebuf))); binary_mtime = 0; } @@ -1385,7 +1385,7 @@ rewait: if (errno == EINTR) goto rewait; - VIR_ERROR(_("Unexpected exit status from qemu %d pid %lu"), + VIR_ERROR("Unexpected exit status from qemu %d pid %lu", WEXITSTATUS(status), (unsigned long)child); ret = -1; } @@ -1393,7 +1393,7 @@ rewait: * as there's really no need to throw an error if we did * actually read a valid version number above */ if (WEXITSTATUS(status) != 0) { - VIR_WARN(_("Unexpected exit status '%d', qemu probably failed"), + VIR_WARN("Unexpected exit status '%d', qemu probably failed", WEXITSTATUS(status)); } @@ -6085,7 +6085,7 @@ virDomainDefPtr qemuParseCommandLine(virCapsPtr caps, } else if (STREQ(arg, "-S")) { /* ignore, always added by libvirt */ } else { - VIR_WARN(_("unknown QEMU argument '%s' during conversion"), arg); + VIR_WARN("unknown QEMU argument '%s' during conversion", arg); #if 0 qemuReportError(VIR_ERR_INTERNAL_ERROR, _("unknown argument '%s'"), arg); diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index eea49bb..2ff33e0 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -632,7 +632,7 @@ qemuAutostartDomain(void *payload, const char *name ATTRIBUTE_UNUSED, void *opaq ret = qemudStartVMDaemon(data->conn, data->driver, vm, NULL, -1); if (ret < 0) { virErrorPtr err = virGetLastError(); - VIR_ERROR(_("Failed to autostart VM '%s': %s"), + VIR_ERROR("Failed to autostart VM '%s': %s", vm->def->name, err ? err->message : ""); } else { @@ -689,12 +689,12 @@ qemudRemoveDomainStatus(struct qemud_driver *driver, } if (unlink(file) < 0 && errno != ENOENT && errno != ENOTDIR) - VIR_WARN(_("Failed to remove domain XML for %s: %s"), + VIR_WARN("Failed to remove domain XML for %s: %s", vm->def->name, virStrerror(errno, ebuf, sizeof(ebuf))); VIR_FREE(file); if (virFileDeletePid(driver->stateDir, vm->def->name) != 0) - VIR_WARN(_("Failed to remove PID file for %s: %s"), + VIR_WARN("Failed to remove PID file for %s: %s", vm->def->name, virStrerror(errno, ebuf, sizeof(ebuf))); @@ -1178,7 +1178,7 @@ qemuConnectMonitor(struct qemud_driver *driver, virDomainObjPtr vm) priv->monConfig, priv->monJSON, &monitorCallbacks)) == NULL) { - VIR_ERROR(_("Failed to connect monitor for %s"), vm->def->name); + VIR_ERROR("Failed to connect monitor for %s", vm->def->name); return -1; } @@ -1279,7 +1279,7 @@ qemudSecurityInit(struct qemud_driver *qemud_drv) ret = virSecurityDriverStartup(&security_drv, qemud_drv->securityDriverName); if (ret == -1) { - VIR_ERROR0(_("Failed to start security driver")); + VIR_ERROR0("Failed to start security driver"); return -1; } @@ -1287,7 +1287,7 @@ qemudSecurityInit(struct qemud_driver *qemud_drv) * the DAC driver on its own */ if (ret == -2) { qemud_drv->securityDriver = &qemuDACSecurityDriver; - VIR_INFO0(_("No security driver available")); + VIR_INFO0("No security driver available"); } else { qemud_drv->securityPrimaryDriver = security_drv; qemud_drv->securitySecondaryDriver = &qemuDACSecurityDriver; @@ -1357,7 +1357,7 @@ qemudStartup(int privileged) { return -1; if (virMutexInit(&qemu_driver->lock) < 0) { - VIR_ERROR("%s", _("cannot initialize mutex")); + VIR_ERROR0("cannot initialize mutex"); VIR_FREE(qemu_driver); return -1; } @@ -1432,19 +1432,19 @@ qemudStartup(int privileged) { if (virFileMakePath(qemu_driver->stateDir) != 0) { char ebuf[1024]; - VIR_ERROR(_("Failed to create state dir '%s': %s"), + VIR_ERROR("Failed to create state dir '%s': %s", qemu_driver->stateDir, virStrerror(errno, ebuf, sizeof ebuf)); goto error; } if (virFileMakePath(qemu_driver->libDir) != 0) { char ebuf[1024]; - VIR_ERROR(_("Failed to create lib dir '%s': %s"), + VIR_ERROR("Failed to create lib dir '%s': %s", qemu_driver->libDir, virStrerror(errno, ebuf, sizeof ebuf)); goto error; } if (virFileMakePath(qemu_driver->cacheDir) != 0) { char ebuf[1024]; - VIR_ERROR(_("Failed to create cache dir '%s': %s"), + VIR_ERROR("Failed to create cache dir '%s': %s", qemu_driver->cacheDir, virStrerror(errno, ebuf, sizeof ebuf)); goto error; } @@ -1932,7 +1932,7 @@ qemudWaitForMonitor(struct qemud_driver* driver, "console", 30); if (close(logfd) < 0) { char ebuf[4096]; - VIR_WARN(_("Unable to close logfile: %s"), + VIR_WARN("Unable to close logfile: %s", virStrerror(errno, ebuf, sizeof ebuf)); } @@ -2750,7 +2750,7 @@ qemudReattachManagedDevice(pciDevice *dev) } if (pciReAttachDevice(dev) < 0) { virErrorPtr err = virGetLastError(); - VIR_ERROR(_("Failed to re-attach PCI device: %s"), + VIR_ERROR("Failed to re-attach PCI device: %s", err ? err->message : ""); virResetError(err); } @@ -2769,7 +2769,7 @@ qemuDomainReAttachHostDevices(struct qemud_driver *driver, if (!(pcidevs = qemuGetPciHostDeviceList(def))) { virErrorPtr err = virGetLastError(); - VIR_ERROR(_("Failed to allocate pciDeviceList: %s"), + VIR_ERROR("Failed to allocate pciDeviceList: %s", err ? err->message : ""); virResetError(err); return; @@ -2787,7 +2787,7 @@ qemuDomainReAttachHostDevices(struct qemud_driver *driver, pciDevice *dev = pciDeviceListGet(pcidevs, i); if (pciResetDevice(dev, driver->activePciHostdevs) < 0) { virErrorPtr err = virGetLastError(); - VIR_ERROR(_("Failed to reset PCI device: %s"), + VIR_ERROR("Failed to reset PCI device: %s", err ? err->message : ""); virResetError(err); } @@ -3215,29 +3215,29 @@ static int qemudStartVMDaemon(virConnectPtr conn, tmp = progenv; while (*tmp) { if (safewrite(logfile, *tmp, strlen(*tmp)) < 0) - VIR_WARN(_("Unable to write envv to logfile: %s"), + VIR_WARN("Unable to write envv to logfile: %s", virStrerror(errno, ebuf, sizeof ebuf)); if (safewrite(logfile, " ", 1) < 0) - VIR_WARN(_("Unable to write envv to logfile: %s"), + VIR_WARN("Unable to write envv to logfile: %s", virStrerror(errno, ebuf, sizeof ebuf)); tmp++; } tmp = argv; while (*tmp) { if (safewrite(logfile, *tmp, strlen(*tmp)) < 0) - VIR_WARN(_("Unable to write argv to logfile: %s"), + VIR_WARN("Unable to write argv to logfile: %s", virStrerror(errno, ebuf, sizeof ebuf)); if (safewrite(logfile, " ", 1) < 0) - VIR_WARN(_("Unable to write argv to logfile: %s"), + VIR_WARN("Unable to write argv to logfile: %s", virStrerror(errno, ebuf, sizeof ebuf)); tmp++; } if (safewrite(logfile, "\n", 1) < 0) - VIR_WARN(_("Unable to write argv to logfile: %s"), + VIR_WARN("Unable to write argv to logfile: %s", virStrerror(errno, ebuf, sizeof ebuf)); if ((pos = lseek(logfile, 0, SEEK_END)) < 0) - VIR_WARN(_("Unable to seek to end of logfile: %s"), + VIR_WARN("Unable to seek to end of logfile: %s", virStrerror(errno, ebuf, sizeof ebuf)); for (i = 0 ; i < ntapfds ; i++) @@ -7048,14 +7048,14 @@ cleanup: try_remove: if (vlan < 0) { - VIR_WARN0(_("Unable to remove network backend")); + VIR_WARN0("Unable to remove network backend"); } else { char *hostnet_name; if (virAsprintf(&hostnet_name, "host%s", net->info.alias) < 0) goto no_memory; qemuDomainObjEnterMonitorWithDriver(driver, vm); if (qemuMonitorRemoveHostNetwork(priv->mon, vlan, hostnet_name) < 0) - VIR_WARN(_("Failed to remove network backend for vlan %d, net %s"), + VIR_WARN("Failed to remove network backend for vlan %d, net %s", vlan, hostnet_name); qemuDomainObjExitMonitorWithDriver(driver, vm); VIR_FREE(hostnet_name); @@ -7066,7 +7066,7 @@ try_tapfd_close: if (tapfd_name) { qemuDomainObjEnterMonitorWithDriver(driver, vm); if (qemuMonitorCloseFileHandle(priv->mon, tapfd_name) < 0) - VIR_WARN(_("Failed to close tapfd with '%s'"), tapfd_name); + VIR_WARN("Failed to close tapfd with '%s'", tapfd_name); qemuDomainObjExitMonitorWithDriver(driver, vm); } @@ -10000,7 +10000,7 @@ endjob: * overwrite the previous error, though, so we just throw something * to the logs and hope for the best */ - VIR_ERROR(_("Failed to resume guest %s after failure"), + VIR_ERROR("Failed to resume guest %s after failure", vm->def->name); } qemuDomainObjExitMonitorWithDriver(driver, vm); diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 64779ac..ac73f0c 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -544,7 +544,7 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque) { } quit = 1; } else if (events) { - VIR_ERROR(_("unhandled fd event %d for monitor fd %d"), + VIR_ERROR("unhandled fd event %d for monitor fd %d", events, mon->fd); failed = 1; } diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c index a199de7..e171483 100644 --- a/src/qemu/qemu_monitor_text.c +++ b/src/qemu/qemu_monitor_text.c @@ -1399,42 +1399,42 @@ qemuMonitorTextParsePciAddReply(qemuMonitorPtr mon ATTRIBUTE_UNUSED, s += strlen("domain "); if (virStrToLong_ui(s, &e, 10, &addr->domain) == -1) { - VIR_WARN(_("Unable to parse domain number '%s'"), s); + VIR_WARN("Unable to parse domain number '%s'", s); return -1; } if (!STRPREFIX(e, ", ")) { - VIR_WARN(_("Expected ', ' parsing pci_add reply '%s'"), s); + VIR_WARN("Expected ', ' parsing pci_add reply '%s'", s); return -1; } s = e + 2; } if (!STRPREFIX(s, "bus ")) { - VIR_WARN(_("Expected 'bus ' parsing pci_add reply '%s'"), s); + VIR_WARN("Expected 'bus ' parsing pci_add reply '%s'", s); return -1; } s += strlen("bus "); if (virStrToLong_ui(s, &e, 10, &addr->bus) == -1) { - VIR_WARN(_("Unable to parse bus number '%s'"), s); + VIR_WARN("Unable to parse bus number '%s'", s); return -1; } if (!STRPREFIX(e, ", ")) { - VIR_WARN(_("Expected ', ' parsing pci_add reply '%s'"), s); + VIR_WARN("Expected ', ' parsing pci_add reply '%s'", s); return -1; } s = e + 2; if (!STRPREFIX(s, "slot ")) { - VIR_WARN(_("Expected 'slot ' parsing pci_add reply '%s'"), s); + VIR_WARN("Expected 'slot ' parsing pci_add reply '%s'", s); return -1; } s += strlen("slot "); if (virStrToLong_ui(s, &e, 10, &addr->slot) == -1) { - VIR_WARN(_("Unable to parse slot number '%s'"), s); + VIR_WARN("Unable to parse slot number '%s'", s); return -1; } @@ -1913,25 +1913,25 @@ qemudParseDriveAddReply(const char *reply, s += strlen("bus "); if (virStrToLong_ui(s, &e, 10, &addr->bus) == -1) { - VIR_WARN(_("Unable to parse bus '%s'"), s); + VIR_WARN("Unable to parse bus '%s'", s); return -1; } if (!STRPREFIX(e, ", ")) { - VIR_WARN(_("Expected ', ' parsing drive_add reply '%s'"), s); + VIR_WARN("Expected ', ' parsing drive_add reply '%s'", s); return -1; } s = e + 2; } if (!STRPREFIX(s, "unit ")) { - VIR_WARN(_("Expected 'unit ' parsing drive_add reply '%s'"), s); + VIR_WARN("Expected 'unit ' parsing drive_add reply '%s'", s); return -1; } s += strlen("bus "); if (virStrToLong_ui(s, &e, 10, &addr->unit) == -1) { - VIR_WARN(_("Unable to parse unit number '%s'"), s); + VIR_WARN("Unable to parse unit number '%s'", s); return -1; } diff --git a/src/secret/secret_driver.c b/src/secret/secret_driver.c index 22852a1..41d2cb8 100644 --- a/src/secret/secret_driver.c +++ b/src/secret/secret_driver.c @@ -498,7 +498,7 @@ loadSecrets(virSecretDriverStatePtr driver, if (secret == NULL) { virErrorPtr err = virGetLastError(); - VIR_ERROR(_("Error reading secret: %s"), + VIR_ERROR("Error reading secret: %s", err != NULL ? err->message: ""); virResetError(err); continue; @@ -1023,7 +1023,7 @@ secretDriverStartup(int privileged) return 0; out_of_memory: - VIR_ERROR0(_("Out of memory initializing secrets")); + VIR_ERROR0("Out of memory initializing secrets"); error: VIR_FREE(base); secretDriverUnlock(driverState); diff --git a/src/security/security_apparmor.c b/src/security/security_apparmor.c index db04d5c..8e1c794 100644 --- a/src/security/security_apparmor.c +++ b/src/security/security_apparmor.c @@ -483,7 +483,7 @@ AppArmorSetSecurityProcessLabel(virSecurityDriverPtr drv, virDomainObjPtr vm) } if (aa_change_profile(profile_name) < 0) { - virSecurityReportError(VIR_ERR_INTERNAL_ERROR, + virSecurityReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("error calling aa_change_profile()")); goto clean; } diff --git a/src/storage/storage_backend_mpath.c b/src/storage/storage_backend_mpath.c index 8318969..9c6e5ed 100644 --- a/src/storage/storage_backend_mpath.c +++ b/src/storage/storage_backend_mpath.c @@ -318,8 +318,6 @@ virStorageBackendMpathRefreshPool(virConnectPtr conn ATTRIBUTE_UNUSED, { int retval = 0; - VIR_ERROR(_("in %s"), __func__); - pool->def->allocation = pool->def->capacity = pool->def->available = 0; virFileWaitForDevices(); diff --git a/src/storage/storage_backend_scsi.c b/src/storage/storage_backend_scsi.c index 0260818..cd01f93 100644 --- a/src/storage/storage_backend_scsi.c +++ b/src/storage/storage_backend_scsi.c @@ -92,7 +92,7 @@ getDeviceType(uint32_t host, goto out; } - VIR_DEBUG(_("Device type is %d"), *type); + VIR_DEBUG("Device type is %d", *type); out: VIR_FREE(type_path); @@ -221,7 +221,7 @@ virStorageBackendSCSINewLun(virStoragePoolObjPtr pool, goto free_vol; } - VIR_DEBUG(_("Trying to create volume for '%s'"), devpath); + VIR_DEBUG("Trying to create volume for '%s'", devpath); /* Now figure out the stable path * @@ -239,7 +239,7 @@ virStorageBackendSCSINewLun(virStoragePoolObjPtr pool, !(STREQ(pool->def->target.path, "/dev") || STREQ(pool->def->target.path, "/dev/"))) { - VIR_DEBUG(_("No stable path found for '%s' in '%s'"), + VIR_DEBUG("No stable path found for '%s' in '%s'", devpath, pool->def->target.path); retval = -1; @@ -301,7 +301,7 @@ getNewStyleBlockDevice(const char *lun_path, goto out; } - VIR_DEBUG(_("Looking for block device in '%s'"), block_path); + VIR_DEBUG("Looking for block device in '%s'", block_path); block_dir = opendir(block_path); if (block_dir == NULL) { @@ -327,7 +327,7 @@ getNewStyleBlockDevice(const char *lun_path, goto out; } - VIR_DEBUG(_("Block device is '%s'"), *block_device); + VIR_DEBUG("Block device is '%s'", *block_device); break; } @@ -366,7 +366,7 @@ getOldStyleBlockDevice(const char *lun_path ATTRIBUTE_UNUSED, goto out; } - VIR_DEBUG(_("Block device is '%s'"), *block_device); + VIR_DEBUG("Block device is '%s'", *block_device); } out: @@ -436,7 +436,7 @@ processLU(virStoragePoolObjPtr pool, int device_type; char *block_device = NULL; - VIR_DEBUG(_("Processing LU %u:%u:%u:%u"), + VIR_DEBUG("Processing LU %u:%u:%u:%u", host, bus, target, lun); if (getDeviceType(host, bus, target, lun, &device_type) < 0) { @@ -457,7 +457,7 @@ processLU(virStoragePoolObjPtr pool, goto out; } - VIR_DEBUG(_("%u:%u:%u:%u is a Direct-Access LUN"), + VIR_DEBUG("%u:%u:%u:%u is a Direct-Access LUN", host, bus, target, lun); if (getBlockDevice(host, bus, target, lun, &block_device) < 0) { @@ -467,13 +467,13 @@ processLU(virStoragePoolObjPtr pool, if (virStorageBackendSCSINewLun(pool, host, bus, target, lun, block_device) < 0) { - VIR_DEBUG(_("Failed to create new storage volume for %u:%u:%u:%u"), + VIR_DEBUG("Failed to create new storage volume for %u:%u:%u:%u", host, bus, target, lun); retval = -1; goto out; } - VIR_DEBUG(_("Created new storage volume for %u:%u:%u:%u successfully"), + VIR_DEBUG("Created new storage volume for %u:%u:%u:%u successfully", host, bus, target, lun); VIR_FREE(type_path); @@ -494,7 +494,7 @@ virStorageBackendSCSIFindLUs(virStoragePoolObjPtr pool, struct dirent *lun_dirent = NULL; char devicepattern[64]; - VIR_DEBUG(_("Discovering LUs on host %u"), scanhost); + VIR_DEBUG("Discovering LUs on host %u", scanhost); virFileWaitForDevices(); @@ -520,7 +520,7 @@ virStorageBackendSCSIFindLUs(virStoragePoolObjPtr pool, continue; } - VIR_DEBUG(_("Found LU '%s'"), lun_dirent->d_name); + VIR_DEBUG("Found LU '%s'", lun_dirent->d_name); processLU(pool, scanhost, bus, target, lun); } @@ -541,7 +541,7 @@ virStorageBackendSCSIGetHostNumber(const char *sysfs_path, DIR *sysdir = NULL; struct dirent *dirent = NULL; - VIR_DEBUG(_("Finding host number from '%s'"), sysfs_path); + VIR_DEBUG("Finding host number from '%s'", sysfs_path); virFileWaitForDevices(); @@ -558,7 +558,7 @@ virStorageBackendSCSIGetHostNumber(const char *sysfs_path, if (STREQLEN(dirent->d_name, "target", strlen("target"))) { if (sscanf(dirent->d_name, "target%u:", host) != 1) { - VIR_DEBUG(_("Failed to parse target '%s'"), dirent->d_name); + VIR_DEBUG("Failed to parse target '%s'", dirent->d_name); retval = -1; break; } @@ -578,7 +578,7 @@ virStorageBackendSCSITriggerRescan(uint32_t host) int retval = 0; char *path; - VIR_DEBUG(_("Triggering rescan of host %d"), host); + VIR_DEBUG("Triggering rescan of host %d", host); if (virAsprintf(&path, "/sys/class/scsi_host/host%u/scan", host) < 0) { virReportOOMError(); @@ -586,7 +586,7 @@ virStorageBackendSCSITriggerRescan(uint32_t host) goto out; } - VIR_DEBUG(_("Scan trigger path is '%s'"), path); + VIR_DEBUG("Scan trigger path is '%s'", path); fd = open(path, O_WRONLY); @@ -612,7 +612,7 @@ virStorageBackendSCSITriggerRescan(uint32_t host) free_path: VIR_FREE(path); out: - VIR_DEBUG(_("Rescan of host %d complete"), host); + VIR_DEBUG("Rescan of host %d complete", host); return retval; } @@ -627,13 +627,13 @@ virStorageBackendSCSIRefreshPool(virConnectPtr conn ATTRIBUTE_UNUSED, pool->def->allocation = pool->def->capacity = pool->def->available = 0; if (sscanf(pool->def->source.adapter, "host%u", &host) != 1) { - VIR_DEBUG(_("Failed to get host number from '%s'"), + VIR_DEBUG("Failed to get host number from '%s'", pool->def->source.adapter); retval = -1; goto out; } - VIR_DEBUG(_("Scanning host%u"), host); + VIR_DEBUG("Scanning host%u", host); if (virStorageBackendSCSITriggerRescan(host) < 0) { retval = -1; diff --git a/src/uml/uml_conf.c b/src/uml/uml_conf.c index 876e16b..17f4e2e 100644 --- a/src/uml/uml_conf.c +++ b/src/uml/uml_conf.c @@ -49,9 +49,6 @@ #define VIR_FROM_THIS VIR_FROM_UML -#define umlLog(level, msg, ...) \ - virLogMessage(__FILE__, level, 0, msg, __VA_ARGS__) - virCapsPtr umlCapsInit(void) { struct utsname utsname; virCapsPtr caps; diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c index 443d82e..58ffe68 100644 --- a/src/uml/uml_driver.c +++ b/src/uml/uml_driver.c @@ -121,7 +121,7 @@ static int umlSetCloseExec(int fd) { goto error; return 0; error: - VIR_ERROR0(_("Failed to set close-on-exec file descriptor flag")); + VIR_ERROR0("Failed to set close-on-exec file descriptor flag"); return -1; } @@ -159,7 +159,7 @@ umlAutostartDomain(void *payload, const char *name ATTRIBUTE_UNUSED, void *opaqu virResetLastError(); if (umlStartVMDaemon(data->conn, data->driver, vm) < 0) { virErrorPtr err = virGetLastError(); - VIR_ERROR(_("Failed to autostart VM '%s': %s"), + VIR_ERROR("Failed to autostart VM '%s': %s", vm->def->name, err->message); } } @@ -412,13 +412,13 @@ umlStartup(int privileged) { uml_driver->caps->privateDataFreeFunc = umlDomainObjPrivateFree; if ((uml_driver->inotifyFD = inotify_init()) < 0) { - VIR_ERROR0(_("cannot initialize inotify")); + VIR_ERROR0("cannot initialize inotify"); goto error; } if (virFileMakePath(uml_driver->monitorDir) != 0) { char ebuf[1024]; - VIR_ERROR(_("Failed to create monitor directory %s: %s"), + VIR_ERROR("Failed to create monitor directory %s: %s", uml_driver->monitorDir, virStrerror(errno, ebuf, sizeof ebuf)); goto error; } @@ -450,7 +450,7 @@ umlStartup(int privileged) { return 0; out_of_memory: - VIR_ERROR0(_("umlStartup: out of memory")); + VIR_ERROR0("umlStartup: out of memory"); error: VIR_FREE(userdir); @@ -887,25 +887,25 @@ static int umlStartVMDaemon(virConnectPtr conn, tmp = progenv; while (*tmp) { if (safewrite(logfd, *tmp, strlen(*tmp)) < 0) - VIR_WARN(_("Unable to write envv to logfile: %s"), + VIR_WARN("Unable to write envv to logfile: %s", virStrerror(errno, ebuf, sizeof ebuf)); if (safewrite(logfd, " ", 1) < 0) - VIR_WARN(_("Unable to write envv to logfile: %s"), + VIR_WARN("Unable to write envv to logfile: %s", virStrerror(errno, ebuf, sizeof ebuf)); tmp++; } tmp = argv; while (*tmp) { if (safewrite(logfd, *tmp, strlen(*tmp)) < 0) - VIR_WARN(_("Unable to write argv to logfile: %s"), + VIR_WARN("Unable to write argv to logfile: %s", virStrerror(errno, ebuf, sizeof ebuf)); if (safewrite(logfd, " ", 1) < 0) - VIR_WARN(_("Unable to write argv to logfile: %s"), + VIR_WARN("Unable to write argv to logfile: %s", virStrerror(errno, ebuf, sizeof ebuf)); tmp++; } if (safewrite(logfd, "\n", 1) < 0) - VIR_WARN(_("Unable to write argv to logfile: %s"), + VIR_WARN("Unable to write argv to logfile: %s", virStrerror(errno, ebuf, sizeof ebuf)); priv->monitor = -1; @@ -953,8 +953,7 @@ static void umlShutdownVMDaemon(virConnectPtr conn ATTRIBUTE_UNUSED, priv->monitor = -1; if ((ret = waitpid(vm->pid, NULL, 0)) != vm->pid) { - VIR_WARN(_("Got unexpected pid %d != %d"), - ret, vm->pid); + VIR_WARN("Got unexpected pid %d != %d", ret, vm->pid); } vm->pid = -1; diff --git a/src/util/bridge.c b/src/util/bridge.c index b236f80..310ac20 100644 --- a/src/util/bridge.c +++ b/src/util/bridge.c @@ -394,14 +394,14 @@ brProbeVnetHdr(int tapfd) struct ifreq dummy; if (ioctl(tapfd, TUNGETFEATURES, &features) != 0) { - VIR_INFO0(_("Not enabling IFF_VNET_HDR; " - "TUNGETFEATURES ioctl() not implemented")); + VIR_INFO0("Not enabling IFF_VNET_HDR; " + "TUNGETFEATURES ioctl() not implemented"); return 0; } if (!(features & IFF_VNET_HDR)) { - VIR_INFO0(_("Not enabling IFF_VNET_HDR; " - "TUNGETFEATURES ioctl() reports no IFF_VNET_HDR")); + VIR_INFO0("Not enabling IFF_VNET_HDR; " + "TUNGETFEATURES ioctl() reports no IFF_VNET_HDR"); return 0; } @@ -409,17 +409,17 @@ brProbeVnetHdr(int tapfd) * If TUNGETIFF is not implemented then errno == EBADFD. */ if (ioctl(tapfd, TUNGETIFF, &dummy) != -1 || errno != EBADFD) { - VIR_INFO0(_("Not enabling IFF_VNET_HDR; " - "TUNGETIFF ioctl() not implemented")); + VIR_INFO0("Not enabling IFF_VNET_HDR; " + "TUNGETIFF ioctl() not implemented"); return 0; } - VIR_INFO0(_("Enabling IFF_VNET_HDR")); + VIR_INFO0("Enabling IFF_VNET_HDR"); return 1; # else (void) tapfd; - VIR_INFO0(_("Not enabling IFF_VNET_HDR; disabled at build time")); + VIR_INFO0("Not enabling IFF_VNET_HDR; disabled at build time"); return 0; # endif } diff --git a/src/util/logging.c b/src/util/logging.c index 6bc2ccf..248c47e 100644 --- a/src/util/logging.c +++ b/src/util/logging.c @@ -330,7 +330,7 @@ error: */ int virLogSetDefaultPriority(int priority) { if ((priority < VIR_LOG_DEBUG) || (priority > VIR_LOG_ERROR)) { - VIR_WARN0(_("Ignoring invalid log level setting.")); + VIR_WARN0("Ignoring invalid log level setting."); return(-1); } if (!virLogInitialized) @@ -781,7 +781,7 @@ int virLogParseOutputs(const char *outputs) { ret = count; cleanup: if (ret == -1) - VIR_WARN0(_("Ignoring invalid log output setting.")); + VIR_WARN0("Ignoring invalid log output setting."); return(ret); } @@ -837,7 +837,7 @@ int virLogParseFilters(const char *filters) { ret = count; cleanup: if (ret == -1) - VIR_WARN0(_("Ignoring invalid log filter setting.")); + VIR_WARN0("Ignoring invalid log filter setting."); return(ret); } @@ -959,7 +959,7 @@ int virLogParseDefaultPriority(const char *priority) { else if (STREQ(priority, "4") || STREQ(priority, "error")) ret = virLogSetDefaultPriority(VIR_LOG_ERROR); else - VIR_WARN0(_("Ignoring invalid log level setting")); + VIR_WARN0("Ignoring invalid log level setting"); return ret; } diff --git a/src/util/pci.c b/src/util/pci.c index 81193b7..e8f985c 100644 --- a/src/util/pci.c +++ b/src/util/pci.c @@ -173,7 +173,7 @@ pciOpenConfig(pciDevice *dev) fd = open(dev->path, O_RDWR); if (fd < 0) { char ebuf[1024]; - VIR_WARN(_("Failed to open config space file '%s': %s"), + VIR_WARN("Failed to open config space file '%s': %s", dev->path, virStrerror(errno, ebuf, sizeof(ebuf))); return -1; } @@ -193,7 +193,7 @@ pciRead(pciDevice *dev, unsigned pos, uint8_t *buf, unsigned buflen) if (lseek(dev->fd, pos, SEEK_SET) != pos || saferead(dev->fd, buf, buflen) != buflen) { char ebuf[1024]; - VIR_WARN(_("Failed to read from '%s' : %s"), dev->path, + VIR_WARN("Failed to read from '%s' : %s", dev->path, virStrerror(errno, ebuf, sizeof(ebuf))); return -1; } @@ -233,7 +233,7 @@ pciWrite(pciDevice *dev, unsigned pos, uint8_t *buf, unsigned buflen) if (lseek(dev->fd, pos, SEEK_SET) != pos || safewrite(dev->fd, buf, buflen) != buflen) { char ebuf[1024]; - VIR_WARN(_("Failed to write to '%s' : %s"), dev->path, + VIR_WARN("Failed to write to '%s' : %s", dev->path, virStrerror(errno, ebuf, sizeof(ebuf))); return -1; } @@ -730,7 +730,7 @@ recheck: if (virRun(backprobe, NULL) < 0 && virRun(stubprobe, NULL) < 0) { char ebuf[1024]; - VIR_WARN(_("failed to load pci-stub or pciback drivers: %s"), + VIR_WARN("failed to load pci-stub or pciback drivers: %s", virStrerror(errno, ebuf, sizeof ebuf)); return 0; } diff --git a/src/util/uuid.c b/src/util/uuid.c index 459273a..1cfdd07 100644 --- a/src/util/uuid.c +++ b/src/util/uuid.c @@ -101,8 +101,8 @@ virUUIDGenerate(unsigned char *uuid) if ((err = virUUIDGenerateRandomBytes(uuid, VIR_UUID_BUFLEN))) { char ebuf[1024]; - VIR_WARN(_("Falling back to pseudorandom UUID," - " failed to generate random bytes: %s"), + VIR_WARN("Falling back to pseudorandom UUID, " + "failed to generate random bytes: %s", virStrerror(err, ebuf, sizeof ebuf)); err = virUUIDGeneratePseudoRandomBytes(uuid, VIR_UUID_BUFLEN); } diff --git a/src/xen/proxy_internal.c b/src/xen/proxy_internal.c index 26eec13..c3cade8 100644 --- a/src/xen/proxy_internal.c +++ b/src/xen/proxy_internal.c @@ -240,7 +240,7 @@ virProxyCloseSocket(xenUnifiedPrivatePtr priv) { ret = close(priv->proxy); if (ret != 0) - VIR_WARN(_("Failed to close socket %d"), priv->proxy); + VIR_WARN("Failed to close socket %d", priv->proxy); else VIR_DEBUG("Closed socket %d", priv->proxy); priv->proxy = -1; @@ -297,7 +297,7 @@ virProxyWriteClientSocket(int fd, const char *data, int len) { ret = safewrite(fd, data, len); if (ret < 0) { - VIR_WARN(_("Failed to write to socket %d"), fd); + VIR_WARN("Failed to write to socket %d", fd); return(-1); } VIR_DEBUG("wrote %d bytes to socket %d", @@ -452,7 +452,7 @@ retry: goto error; } if (res->serial != serial) { - VIR_WARN(_("got asynchronous packet number %d"), res->serial); + VIR_WARN("got asynchronous packet number %d", res->serial); goto retry; } diff --git a/tools/console.c b/tools/console.c index 4201ba4..3a29a12 100644 --- a/tools/console.c +++ b/tools/console.c @@ -73,7 +73,7 @@ int vshRunConsole(const char *tty) { /* We do not want this to become the controlling TTY */ if ((ttyfd = open(tty, O_NOCTTY | O_RDWR)) < 0) { - VIR_ERROR(_("unable to open tty %s: %s"), + VIR_ERROR("unable to open tty %s: %s", tty, strerror(errno)); return -1; } @@ -84,7 +84,7 @@ int vshRunConsole(const char *tty) { also ensure Ctrl-C, etc is blocked, and misc other bits */ if (tcgetattr(STDIN_FILENO, &ttyattr) < 0) { - VIR_ERROR(_("unable to get tty attributes: %s"), + VIR_ERROR("unable to get tty attributes: %s", strerror(errno)); goto closetty; } @@ -93,7 +93,7 @@ int vshRunConsole(const char *tty) { cfmakeraw(&rawattr); if (tcsetattr(STDIN_FILENO, TCSAFLUSH, &rawattr) < 0) { - VIR_ERROR(_("unable to set tty attributes: %s"), + VIR_ERROR("unable to set tty attributes: %s", strerror(errno)); goto closetty; } @@ -128,7 +128,7 @@ int vshRunConsole(const char *tty) { if (errno == EINTR || errno == EAGAIN) continue; - VIR_ERROR(_("failure waiting for I/O: %s"), strerror(errno)); + VIR_ERROR("failure waiting for I/O: %s", strerror(errno)); goto cleanup; } @@ -142,7 +142,7 @@ int vshRunConsole(const char *tty) { int got, sent = 0, destfd; if ((got = read(fds[i].fd, buf, sizeof(buf))) < 0) { - VIR_ERROR(_("failure reading input: %s"), + VIR_ERROR("failure reading input: %s", strerror(errno)); goto cleanup; } @@ -164,7 +164,7 @@ int vshRunConsole(const char *tty) { int done; if ((done = safewrite(destfd, buf + sent, got - sent)) <= 0) { - VIR_ERROR(_("failure writing output: %s"), + VIR_ERROR("failure writing output: %s", strerror(errno)); goto cleanup; } -- 1.6.3.3 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list