From nobody Fri Dec 19 04:17:26 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1678464696; cv=none; d=zohomail.com; s=zohoarc; b=EndCdtKMseyHlCnyG/YkrmmfDh7PKxTQQX/7Huaxm+KzbkX38XFy3m1MlRofJcMSdr5Ml4Tx6fEj42OEzVQq2wfjyuxB5bHt6ZttBBhI6EB/FsBwEzHo8KxSeLNueiqZHePxLp4gIuv0iiC4fFgDLQ4jUICEhIfZdqbwmpE7Ae0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678464696; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=+sPG9NCTvvrVXs12dm+UCUpGLTeow9kBHupjP1RRDoI=; b=Wn2jhQStkFd5BMoIyoVzgSx6zL9tIEhE1iz2oWx+xtFSzanStgEIsvRVTtpNAki2yqa9Qe3nt9YDFFPnfXTeWz7RC4hBDzav4DLt/tXt8iHCTJjovItTQfaFSUhdTENH4WFDfPevMjapt2u4K6JiEWMra6B4Mv5L1ZRQ1/43NHg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1678464696449538.7668021285803; Fri, 10 Mar 2023 08:11:36 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-197-5_oWMLFzPEaa2jQ9qkWMPg-1; Fri, 10 Mar 2023 11:11:29 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 64345887408; Fri, 10 Mar 2023 16:11:09 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 442571121315; Fri, 10 Mar 2023 16:11:09 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 336F61946A54; Fri, 10 Mar 2023 16:11:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D81A51946A6F for ; Fri, 10 Mar 2023 16:11:07 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id CA88A140EBF6; Fri, 10 Mar 2023 16:11:07 +0000 (UTC) Received: from rein.int.mamuti.net (unknown [10.45.226.138]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1988D140EBF4 for ; Fri, 10 Mar 2023 16:11:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678464695; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=+sPG9NCTvvrVXs12dm+UCUpGLTeow9kBHupjP1RRDoI=; b=XKIjQhN6ggdtPmk5cexxWkq/SkoicQZizn2vj+fcbBob50XqpIcxuOdEiLCvY6HEXgFULl fNdbh/8twNy/O9+S1hjmCojegZzrFJxdYrvmNyFD+V8GWNV/tCgY8P9p/CFn8qwDdb1j9r VS2WNMv7DuVJkyCPW5eiqlk+waYvrMo= X-MC-Unique: 5_oWMLFzPEaa2jQ9qkWMPg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH 42/51] util: Update format strings in translated messages (part 3) Date: Fri, 10 Mar 2023 17:09:58 +0100 Message-Id: <5841220ac727cd7fd6e63f2d94c3ef1f34bfc88c.1678463799.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1678464697289100002 Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark --- src/util/virnetdevbandwidth.c | 7 +- src/util/virnetdevbridge.c | 64 +++++++++--------- src/util/virnetdevip.c | 28 ++++---- src/util/virnetdevmacvlan.c | 4 +- src/util/virnetdevmidonet.c | 4 +- src/util/virnetdevopenvswitch.c | 28 ++++---- src/util/virnetdevtap.c | 24 +++---- src/util/virnetdevveth.c | 4 +- src/util/virnetdevvportprofile.c | 39 +++++------ src/util/virnetlink.c | 14 ++-- src/util/virnodesuspend.c | 2 +- src/util/virnuma.c | 26 ++++---- src/util/virnvme.c | 6 +- src/util/virobject.c | 6 +- src/util/virpci.c | 108 ++++++++++++++----------------- src/util/virperf.c | 8 +-- src/util/virpidfile.c | 14 ++-- src/util/virpolkit.c | 2 +- src/util/virportallocator.c | 10 +-- src/util/virprocess.c | 61 ++++++++--------- src/util/virrandom.c | 2 +- src/util/virresctrl.c | 86 +++++++++++------------- src/util/virrotatingfile.c | 30 ++++----- src/util/virscsi.c | 6 +- src/util/virscsihost.c | 7 +- src/util/virscsivhost.c | 6 +- src/util/virsecret.c | 5 +- src/util/virsocketaddr.c | 51 ++++++--------- src/util/virstoragefile.c | 2 +- src/util/virstring.c | 8 +-- src/util/virsysinfo.c | 16 ++--- src/util/virsystemd.c | 2 +- src/util/virthreadjob.c | 4 +- src/util/virtpm.c | 10 +-- src/util/virtypedparam-public.c | 25 +++---- src/util/virtypedparam.c | 29 ++++----- src/util/viruri.c | 11 ++-- src/util/virusb.c | 16 ++--- src/util/virutil.c | 35 +++++----- src/util/virvhba.c | 7 +- src/util/virxml.c | 72 ++++++++++----------- 41 files changed, 415 insertions(+), 474 deletions(-) diff --git a/src/util/virnetdevbandwidth.c b/src/util/virnetdevbandwidth.c index e67cbd164d..52fb94a9fc 100644 --- a/src/util/virnetdevbandwidth.c +++ b/src/util/virnetdevbandwidth.c @@ -548,7 +548,7 @@ virNetDevBandwidthPlug(const char *brname, char ifmacStr[VIR_MAC_STRING_BUFLEN]; =20 if (id <=3D 2) { - virReportError(VIR_ERR_INTERNAL_ERROR, _("Invalid class ID %d"), i= d); + virReportError(VIR_ERR_INTERNAL_ERROR, _("Invalid class ID %1$d"),= id); return -1; } =20 @@ -556,8 +556,7 @@ virNetDevBandwidthPlug(const char *brname, =20 if (!net_bandwidth || !net_bandwidth->in) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Bridge '%s' has no QoS set, therefore " - "unable to set 'floor' on '%s'"), + _("Bridge '%1$s' has no QoS set, therefore unable t= o set 'floor' on '%2$s'"), brname, ifmacStr); return -1; } @@ -613,7 +612,7 @@ virNetDevBandwidthUnplug(const char *brname, g_autofree char *qdisc_id =3D NULL; =20 if (id <=3D 2) { - virReportError(VIR_ERR_INTERNAL_ERROR, _("Invalid class ID %d"), i= d); + virReportError(VIR_ERR_INTERNAL_ERROR, _("Invalid class ID %1$d"),= id); return -1; } =20 diff --git a/src/util/virnetdevbridge.c b/src/util/virnetdevbridge.c index f1a1c7f509..b870e26e5f 100644 --- a/src/util/virnetdevbridge.c +++ b/src/util/virnetdevbridge.c @@ -70,7 +70,7 @@ static int virNetDevBridgeCmd(const char *brname, =20 if (virStrcpyStatic(ifd.ifd_name, brname) < 0) { virReportSystemError(ERANGE, - _("Network interface name '%s' is too long"), + _("Network interface name '%1$s' is too long"), brname); return -1; } @@ -117,7 +117,7 @@ static int virNetDevBridgeSet(const char *brname, paramid =3D BRCTL_SET_BRIDGE_FORWARD_DELAY; } else { virReportSystemError(EINVAL, - _("Unable to set bridge %s %s via ioctl"), + _("Unable to set bridge %1$s %2$s via ioctl"), brname, paramname); return -1; } @@ -126,7 +126,7 @@ static int virNetDevBridgeSet(const char *brname, ifr->ifr_data =3D (char*)&args; if (ioctl(fd, SIOCDEVPRIVATE, ifr) < 0) { virReportSystemError(errno, - _("Failed to set bridge %s %s via ioctl"), + _("Failed to set bridge %1$s %2$s via ioctl"), brname, paramname); return -1; } @@ -154,7 +154,7 @@ static int virNetDevBridgeGet(const char *brname, =20 if (virStrToLong_ul(valuestr, NULL, 10, value) < 0) { virReportSystemError(EINVAL, - _("Unable to get bridge %s %s"), + _("Unable to get bridge %1$s %2$s"), brname, paramname); return -1; } @@ -168,7 +168,7 @@ static int virNetDevBridgeGet(const char *brname, ifr.ifr_data =3D (char*)&args; if (ioctl(fd, SIOCDEVPRIVATE, ifr) < 0) { virReportSystemError(errno, - _("Unable to get bridge %s %s"), brname, = paramname); + _("Unable to get bridge %1$s %2$s"), brna= me, paramname); return -1; } =20 @@ -178,7 +178,7 @@ static int virNetDevBridgeGet(const char *brname, *value =3D info.forward_delay; } else { virReportSystemError(EINVAL, - _("Unable to get bridge %s %s"), brname, = paramname); + _("Unable to get bridge %1$s %2$s"), brna= me, paramname); return -1; } } @@ -210,7 +210,7 @@ virNetDevBridgePortSet(const char *brname, =20 if (ret < 0) { virReportSystemError(errno, - _("Unable to set bridge %s port %s %s to %s"), + _("Unable to set bridge %1$s port %2$s %3$s t= o %4$s"), brname, ifname, paramname, valuestr); } =20 @@ -235,7 +235,7 @@ virNetDevBridgePortGet(const char *brname, =20 if (virStrToLong_ul(valuestr, NULL, 10, value) < 0) { virReportSystemError(EINVAL, - _("Unable to get bridge %s port %s %s"), + _("Unable to get bridge %1$s port %2$s %3$s"), brname, ifname, paramname); return -1; } @@ -404,7 +404,7 @@ virNetDevBridgeCreateWithIoctl(const char *brname, =20 if (ioctl(fd, SIOCBRADDBR, brname) < 0) { virReportSystemError(errno, - _("Unable to create bridge %s"), brname); + _("Unable to create bridge %1$s"), brname); return -1; } =20 @@ -441,7 +441,7 @@ virNetDevBridgeCreate(const char *brname, } # endif if (error < 0) - virReportSystemError(-error, _("error creating bridge interfac= e %s"), + virReportSystemError(-error, _("error creating bridge interfac= e %1$s"), brname); =20 return -1; @@ -497,7 +497,7 @@ virNetDevBridgeCreate(const char *brname, const virMacAddr *mac G_GNUC_UNUSED) { virReportSystemError(ENOSYS, - _("Unable to create bridge %s"), brname); + _("Unable to create bridge %1$s"), brname); return -1; } #endif @@ -523,7 +523,7 @@ virNetDevBridgeDeleteWithIoctl(const char *brname) =20 if (ioctl(fd, SIOCBRDELBR, brname) < 0) { virReportSystemError(errno, - _("Unable to delete bridge %s"), brname); + _("Unable to delete bridge %1$s"), brname); return -1; } =20 @@ -568,7 +568,7 @@ virNetDevBridgeDelete(const char *brname) =20 if (ioctl(s, SIOCIFDESTROY, &ifr) < 0) { virReportSystemError(errno, - _("Unable to remove bridge %s"), + _("Unable to remove bridge %1$s"), brname); return -1; } @@ -579,7 +579,7 @@ virNetDevBridgeDelete(const char *brname) int virNetDevBridgeDelete(const char *brname G_GNUC_UNUSED) { virReportSystemError(ENOSYS, - _("Unable to delete bridge %s"), brname); + _("Unable to delete bridge %1$s"), brname); return EINVAL; } #endif @@ -605,13 +605,13 @@ int virNetDevBridgeAddPort(const char *brname, =20 if (!(ifr.ifr_ifindex =3D if_nametoindex(ifname))) { virReportSystemError(ENODEV, - _("Unable to get interface index for %s"), if= name); + _("Unable to get interface index for %1$s"), = ifname); return -1; } =20 if (ioctl(fd, SIOCBRADDIF, &ifr) < 0) { virReportSystemError(errno, - _("Unable to add bridge %s port %s"), brname,= ifname); + _("Unable to add bridge %1$s port %2$s"), brn= ame, ifname); return -1; } =20 @@ -626,14 +626,14 @@ int virNetDevBridgeAddPort(const char *brname, memset(&req, 0, sizeof(req)); if (virStrcpyStatic(req.ifbr_ifsname, ifname) < 0) { virReportSystemError(ERANGE, - _("Network interface name '%s' is too long"), + _("Network interface name '%1$s' is too long"= ), ifname); return -1; } =20 if (virNetDevBridgeCmd(brname, BRDGADD, &req, sizeof(req)) < 0) { virReportSystemError(errno, - _("Unable to add bridge %s port %s"), brname,= ifname); + _("Unable to add bridge %1$s port %2$s"), brn= ame, ifname); return -1; } =20 @@ -644,7 +644,7 @@ int virNetDevBridgeAddPort(const char *brname, const char *ifname) { virReportSystemError(ENOSYS, - _("Unable to add bridge %s port %s"), brname, ifn= ame); + _("Unable to add bridge %1$s port %2$s"), brname,= ifname); return -1; } #endif @@ -670,14 +670,14 @@ int virNetDevBridgeRemovePort(const char *brname, =20 if (!(ifr.ifr_ifindex =3D if_nametoindex(ifname))) { virReportSystemError(ENODEV, - _("Unable to get interface index for %s"), if= name); + _("Unable to get interface index for %1$s"), = ifname); =20 return -1; } =20 if (ioctl(fd, SIOCBRDELIF, &ifr) < 0) { virReportSystemError(errno, - _("Unable to remove bridge %s port %s"), brna= me, ifname); + _("Unable to remove bridge %1$s port %2$s"), = brname, ifname); return -1; } =20 @@ -692,14 +692,14 @@ int virNetDevBridgeRemovePort(const char *brname, memset(&req, 0, sizeof(req)); if (virStrcpyStatic(req.ifbr_ifsname, ifname) < 0) { virReportSystemError(ERANGE, - _("Network interface name '%s' is too long"), + _("Network interface name '%1$s' is too long"= ), ifname); return -1; } =20 if (virNetDevBridgeCmd(brname, BRDGDEL, &req, sizeof(req)) < 0) { virReportSystemError(errno, - _("Unable to remove bridge %s port %s"), brna= me, ifname); + _("Unable to remove bridge %1$s port %2$s"), = brname, ifname); return -1; } =20 @@ -710,7 +710,7 @@ int virNetDevBridgeRemovePort(const char *brname, const char *ifname) { virReportSystemError(ENOSYS, - _("Unable to remove bridge %s port %s"), brname, = ifname); + _("Unable to remove bridge %1$s port %2$s"), brna= me, ifname); return -1; } #endif @@ -823,7 +823,7 @@ int virNetDevBridgeSetSTPDelay(const char *brname, =20 if (virNetDevBridgeCmd(brname, BRDGSFD, ¶m, sizeof(param)) < 0) { virReportSystemError(errno, - _("Unable to set STP delay on %s"), brname); + _("Unable to set STP delay on %1$s"), brname); return -1; } =20 @@ -833,7 +833,7 @@ int virNetDevBridgeGetSTPDelay(const char *brname, int *delay G_GNUC_UNUSED) { virReportSystemError(ENOSYS, - _("Unable to get STP delay on %s on this platform= "), + _("Unable to get STP delay on %1$s on this platfo= rm"), brname); return -1; } @@ -850,7 +850,7 @@ int virNetDevBridgeGetSTP(const char *brname, bool *enable G_GNUC_UNUSED) { virReportSystemError(ENOSYS, - _("Unable to get STP on %s on this platform"), + _("Unable to get STP on %1$s on this platform"), brname); return -1; } @@ -859,7 +859,7 @@ int virNetDevBridgeSetSTPDelay(const char *brname, int delay G_GNUC_UNUSED) { virReportSystemError(ENOSYS, - _("Unable to set STP delay on %s on this platform= "), + _("Unable to set STP delay on %1$s on this platfo= rm"), brname); return -1; } @@ -867,7 +867,7 @@ int virNetDevBridgeGetSTPDelay(const char *brname, int *delay G_GNUC_UNUSED) { virReportSystemError(ENOSYS, - _("Unable to get STP delay on %s on this platform= "), + _("Unable to get STP delay on %1$s on this platfo= rm"), brname); return -1; } @@ -877,7 +877,7 @@ int virNetDevBridgeSetSTP(const char *brname, =20 { virReportSystemError(ENOSYS, - _("Unable to set STP on %s on this platform"), + _("Unable to set STP on %1$s on this platform"), brname); return -1; } @@ -885,7 +885,7 @@ int virNetDevBridgeGetSTP(const char *brname, bool *enable G_GNUC_UNUSED) { virReportSystemError(ENOSYS, - _("Unable to get STP on %s on this platform"), + _("Unable to get STP on %1$s on this platform"), brname); return -1; } @@ -1047,7 +1047,7 @@ virNetDevBridgeFDBAddDel(const virMacAddr *mac, const= char *ifname, VIR_DEBUG("fdb entry for %s already exists", ifname); } else { virReportSystemError(-err->error, - _("error adding fdb entry for %s"), i= fname); + _("error adding fdb entry for %1$s"),= ifname); return -1; } } diff --git a/src/util/virnetdevip.c b/src/util/virnetdevip.c index 034b392ee7..d1e717641c 100644 --- a/src/util/virnetdevip.c +++ b/src/util/virnetdevip.c @@ -181,7 +181,7 @@ virNetDevIPAddrAdd(const char *ifname, =20 if (virSocketAddrBroadcastByPrefix(addr, prefix, broadcast) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to determine broadcast address for '%= s/%d'"), + _("Failed to determine broadcast address for '%= 1$s/%2$d'"), ipStr, prefix); return -1; } @@ -206,7 +206,7 @@ virNetDevIPAddrAdd(const char *ifname, =20 if (virNetlinkGetErrorCode(resp, recvbuflen) < 0) { virReportError(VIR_ERR_SYSTEM_ERROR, - _("Failed to add IP address %s/%d%s%s%s%s to %s"), + _("Failed to add IP address %1$s/%2$d%3$s%4$s%5$s%6= $s to %7$s"), ipStr, prefix, peerStr ? " peer " : "", peerStr ? peerStr : "", bcastStr ? " bcast " : "", bcastStr ? bcastStr : "", @@ -248,7 +248,7 @@ virNetDevIPAddrDel(const char *ifname, =20 if (virNetlinkGetErrorCode(resp, recvbuflen) < 0) { virReportError(VIR_ERR_SYSTEM_ERROR, - _("Error removing IP address from %s"), ifname); + _("Error removing IP address from %1$s"), ifname); return -1; } =20 @@ -352,7 +352,7 @@ virNetDevIPRouteAdd(const char *ifname, return -1; =20 if ((errCode =3D virNetlinkGetErrorCode(resp, recvbuflen)) < 0) { - virReportSystemError(errCode, _("Error adding route to %s"), ifnam= e); + virReportSystemError(errCode, _("Error adding route to %1$s"), ifn= ame); return -1; } =20 @@ -538,8 +538,8 @@ virNetDevIPCheckIPv6Forwarding(void) if ((len =3D virFileReadAll(PROC_NET_IPV6_ROUTE, MAX_ROUTE_SIZE, &buf)) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to read %s " - "for ipv6 forwarding checks"), PROC_NET_IPV6_ROUT= E); + _("Unable to read %1$s for ipv6 forwarding checks"), + PROC_NET_IPV6_ROUTE); return false; } =20 @@ -592,10 +592,8 @@ virNetDevIPCheckIPv6Forwarding(void) */ if (ret =3D=3D 1 || (ret =3D=3D 0 && all_accept_ra =3D=3D 1)) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Check the host setup: interface %s has k= ernel " - "autoconfigured IPv6 routes and enabling = forwarding " - " without accept_ra set to 2 will cause t= he kernel " - "to flush them, breaking networking."), i= face_val); + _("Check the host setup: interface %1$s has= kernel autoconfigured IPv6 routes and enabling forwarding without accept_r= a set to 2 will cause the kernel to flush them, breaking networking."), + iface_val); return false; } } @@ -638,7 +636,7 @@ virNetDevGetIPv4AddressIoctl(const char *ifname, =20 if (ioctl(fd, SIOCGIFADDR, (char *)&ifr) < 0) { virReportSystemError(errno, - _("Unable to get IPv4 address for interface %= s via ioctl"), + _("Unable to get IPv4 address for interface %= 1$s via ioctl"), ifname); goto cleanup; } @@ -684,7 +682,7 @@ virNetDevGetifaddrsAddress(const char *ifname, =20 if (getifaddrs(&ifap) < 0) { virReportSystemError(errno, - _("Could not get interface list for '%s'"), + _("Could not get interface list for '%1$s'"), ifname); return -1; } @@ -714,7 +712,7 @@ virNetDevGetifaddrsAddress(const char *ifname, } =20 virReportError(VIR_ERR_INTERNAL_ERROR, - _("no IP address found for interface '%s'"), + _("no IP address found for interface '%1$s'"), ifname); cleanup: freeifaddrs(ifap); @@ -875,7 +873,7 @@ virNetDevIPInfoAddToDev(const char *ifname, NULL, ip->prefix)) < 0) { ipStr =3D virSocketAddrFormat(&ip->address); virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to determine prefix for IP address '%= s'"), + _("Failed to determine prefix for IP address '%= 1$s'"), NULLSTR(ipStr)); return -1; } @@ -890,7 +888,7 @@ virNetDevIPInfoAddToDev(const char *ifname, if ((prefix =3D virNetDevIPRouteGetPrefix(route)) < 0) { ipStr =3D virSocketAddrFormat(&route->address); virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to determine prefix for route with de= stination '%s'"), + _("Failed to determine prefix for route with de= stination '%1$s'"), NULLSTR(ipStr)); return -1; } diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c index 94968a8b4d..db5f41bae8 100644 --- a/src/util/virnetdevmacvlan.c +++ b/src/util/virnetdevmacvlan.c @@ -113,7 +113,7 @@ virNetDevMacVLanCreate(const char *ifname, char macstr[VIR_MAC_STRING_BUFLEN]; =20 virReportSystemError(-error, - _("error creating %s interface %s@%s (%s)"), + _("error creating %1$s interface %2$s@%3$s (%= 4$s)"), type, ifname, srcdev, virMacAddrFormat(macaddress, macstr)); return -1; @@ -177,7 +177,7 @@ virNetDevMacVLanTapOpen(const char *ifname, } else { /* However, if haven't succeeded, quit. */ virReportSystemError(errno, - _("cannot open macvtap tap device %s"= ), + _("cannot open macvtap tap device %1$= s"), tapname); goto cleanup; } diff --git a/src/util/virnetdevmidonet.c b/src/util/virnetdevmidonet.c index 202808ef0f..7a285d2bab 100644 --- a/src/util/virnetdevmidonet.c +++ b/src/util/virnetdevmidonet.c @@ -49,7 +49,7 @@ virNetDevMidonetBindPort(const char *ifname, =20 if (virCommandRun(cmd, NULL) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to bind port %s to the virtual port %s"), + _("Unable to bind port %1$s to the virtual port %2$= s"), ifname, virtportuuid); return -1; } @@ -78,7 +78,7 @@ virNetDevMidonetUnbindPort(const virNetDevVPortProfile *v= irtualport) =20 if (virCommandRun(cmd, NULL) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to unbind the virtual port %s from Midone= t"), + _("Unable to unbind the virtual port %1$s from Mido= net"), virtportuuid); return -1; } diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitc= h.c index 7418716600..dbdd645f8e 100644 --- a/src/util/virnetdevopenvswitch.c +++ b/src/util/virnetdevopenvswitch.c @@ -185,7 +185,7 @@ int virNetDevOpenvswitchAddPort(const char *brname, con= st char *ifname, =20 if (virCommandRun(cmd, NULL) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to add port %s to OVS bridge %s"), + _("Unable to add port %1$s to OVS bridge %2$s"), ifname, brname); return -1; } @@ -209,7 +209,7 @@ int virNetDevOpenvswitchRemovePort(const char *brname G= _GNUC_UNUSED, const char =20 if (virCommandRun(cmd, NULL) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to delete port %s from OVS"), ifname); + _("Unable to delete port %1$s from OVS"), ifname); return -1; } =20 @@ -238,8 +238,8 @@ int virNetDevOpenvswitchGetMigrateData(char **migrate, = const char *ifname) /* Run the command */ if (virCommandRun(cmd, NULL) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to run command to get OVS port data for " - "interface %s"), ifname); + _("Unable to run command to get OVS port data for i= nterface %1$s"), + ifname); return -1; } =20 @@ -276,8 +276,8 @@ int virNetDevOpenvswitchSetMigrateData(char *migrate, c= onst char *ifname) /* Run the command */ if (virCommandRun(cmd, NULL) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to run command to set OVS port data for " - "interface %s"), ifname); + _("Unable to run command to set OVS port data for i= nterface %1$s"), + ifname); return -1; } =20 @@ -443,8 +443,8 @@ virNetDevOpenvswitchInterfaceGetMaster(const char *ifna= me, char **master) =20 if (virCommandRun(cmd, &exitstatus) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to run command to get OVS master for " - "interface %s"), ifname); + _("Unable to run command to get OVS master for inte= rface %1$s"), + ifname); return -1; } =20 @@ -614,7 +614,7 @@ int virNetDevOpenvswitchUpdateVlan(const char *ifname, =20 if (virCommandRun(cmd, NULL) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to set vlan configuration on port %s"), i= fname); + _("Unable to set vlan configuration on port %1$s"),= ifname); return -1; } =20 @@ -730,7 +730,7 @@ virNetDevOpenvswitchInterfaceClearRxQos(const char *ifn= ame) =20 if (virCommandRun(cmd, NULL) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to reset ingress on port %s"), ifname); + _("Unable to reset ingress on port %1$s"), ifname); return -1; } =20 @@ -806,10 +806,10 @@ virNetDevOpenvswitchInterfaceSetTxQos(const char *ifn= ame, if (virCommandRun(cmd, NULL) < 0) { if (queue_uuid && *queue_uuid) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to set queue configuration on port %s= "), ifname); + _("Unable to set queue configuration on port %1= $s"), ifname); } else { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to create and set qos configuration o= n port %s"), ifname); + _("Unable to create and set qos configuration o= n port %1$s"), ifname); } return -1; } @@ -829,7 +829,7 @@ virNetDevOpenvswitchInterfaceSetTxQos(const char *ifnam= e, virCommandAddArgList(qoscmd, vmid_ex_id, ifname_ex_id, NULL); if (virCommandRun(qoscmd, NULL) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to set qos configuration on port %s")= , ifname); + _("Unable to set qos configuration on port %1$s= "), ifname); return -1; } } @@ -853,7 +853,7 @@ virNetDevOpenvswitchInterfaceSetRxQos(const char *ifnam= e, =20 if (virCommandRun(cmd, NULL) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to set vlan configuration on port %s"), i= fname); + _("Unable to set vlan configuration on port %1$s"),= ifname); return -1; } =20 diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c index 2101d7847c..b85b753c96 100644 --- a/src/util/virnetdevtap.c +++ b/src/util/virnetdevtap.c @@ -105,7 +105,7 @@ virNetDevTapGetRealDeviceName(char *ifname G_GNUC_UNUSE= D) =20 if ((ifindex =3D if_nametoindex(ifname)) =3D=3D 0) { virReportSystemError(errno, - _("Unable to get interface index for '%s'"), + _("Unable to get interface index for '%1$s'"), ifname); return NULL; } @@ -119,7 +119,7 @@ virNetDevTapGetRealDeviceName(char *ifname G_GNUC_UNUSE= D) =20 if (sysctl(name, 6, NULL, &len, 0, 0) < 0) { virReportSystemError(errno, - _("Unable to get driver name for '%s'"), + _("Unable to get driver name for '%1$s'"), ifname); return NULL; } @@ -128,7 +128,7 @@ virNetDevTapGetRealDeviceName(char *ifname G_GNUC_UNUSE= D) =20 if (sysctl(name, 6, ret, &len, 0, 0) < 0) { virReportSystemError(errno, - _("Unable to get driver name for '%s'"), + _("Unable to get driver name for '%1$s'"), ifname); VIR_FREE(ret); return NULL; @@ -195,7 +195,7 @@ int virNetDevTapCreate(char **ifname, return -1; } else if (rc > 0) { virReportError(VIR_ERR_OPERATION_INVALID, - _("The %s interface already exists"), + _("The %1$s interface already exists"), *ifname); return -1; } @@ -208,7 +208,7 @@ int virNetDevTapCreate(char **ifname, for (i =3D 0; i < tapfdSize; i++) { if ((fd =3D open(tunpath, O_RDWR)) < 0) { virReportSystemError(errno, - _("Unable to open %s, is tun module loade= d?"), + _("Unable to open %1$s, is tun module loa= ded?"), tunpath); goto cleanup; } @@ -225,7 +225,7 @@ int virNetDevTapCreate(char **ifname, =20 if (virStrcpyStatic(ifr.ifr_name, *ifname) < 0) { virReportSystemError(ERANGE, - _("Network interface name '%s' is too lon= g"), + _("Network interface name '%1$s' is too l= ong"), *ifname); goto cleanup; =20 @@ -233,7 +233,7 @@ int virNetDevTapCreate(char **ifname, =20 if (ioctl(fd, TUNSETIFF, &ifr) < 0) { virReportSystemError(errno, - _("Unable to create tap device %s"), + _("Unable to create tap device %1$s"), NULLSTR(*ifname)); goto cleanup; } @@ -248,7 +248,7 @@ int virNetDevTapCreate(char **ifname, if ((flags & VIR_NETDEV_TAP_CREATE_PERSIST) && ioctl(fd, TUNSETPERSIST, 1) < 0) { virReportSystemError(errno, - _("Unable to set tap device %s to persist= ent"), + _("Unable to set tap device %1$s to persi= stent"), NULLSTR(*ifname)); goto cleanup; } @@ -281,7 +281,7 @@ int virNetDevTapDelete(const char *ifname, =20 if ((fd =3D open(tunpath, O_RDWR)) < 0) { virReportSystemError(errno, - _("Unable to open %s, is tun module loaded?"), + _("Unable to open %1$s, is tun module loaded?= "), tunpath); return -1; } @@ -291,7 +291,7 @@ int virNetDevTapDelete(const char *ifname, =20 if (virStrcpyStatic(try.ifr_name, ifname) < 0) { virReportSystemError(ERANGE, - _("Network interface name '%s' is too long"), + _("Network interface name '%1$s' is too long"= ), ifname); goto cleanup; } @@ -357,7 +357,7 @@ int virNetDevTapCreate(char **ifname, =20 if ((*tapfd =3D open(dev_path, O_RDWR)) < 0) { virReportSystemError(errno, - _("Unable to open %s"), + _("Unable to open %1$s"), dev_path); goto cleanup; } @@ -386,7 +386,7 @@ int virNetDevTapDelete(const char *ifname, =20 if (ioctl(s, SIOCIFDESTROY, &ifr) < 0) { virReportSystemError(errno, - _("Unable to remove tap device %s"), + _("Unable to remove tap device %1$s"), ifname); goto cleanup; } diff --git a/src/util/virnetdevveth.c b/src/util/virnetdevveth.c index ad1f517039..4365345664 100644 --- a/src/util/virnetdevveth.c +++ b/src/util/virnetdevveth.c @@ -42,7 +42,7 @@ virNetDevVethCreateInternal(const char *veth1, const char= *veth2) if (virNetlinkNewLink(veth1, "veth", &data, &error) < 0) { if (error !=3D 0) { virReportSystemError(-error, - _("unable to create %s <-> %s veth pair"), + _("unable to create %1$s <-> %2$s veth pa= ir"), veth1, veth2); } return -1; @@ -83,7 +83,7 @@ virNetDevVethDeleteInternal(const char *veth) return 0; } virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to delete veth device %s"), veth); + _("Failed to delete veth device %1$s"), veth); return -1; } =20 diff --git a/src/util/virnetdevvportprofile.c b/src/util/virnetdevvportprof= ile.c index ae23f795b2..cf92f1838b 100644 --- a/src/util/virnetdevvportprofile.c +++ b/src/util/virnetdevvportprofile.c @@ -205,7 +205,7 @@ virNetDevVPortProfileCheckComplete(virNetDevVPortProfil= e *virtport, =20 if (missing) { virReportError(VIR_ERR_XML_ERROR, - _("missing %s in "), missi= ng, + _("missing %1$s in "), m= issing, virNetDevVPortTypeToString(virtport->virtPortType)); return -1; } @@ -262,7 +262,7 @@ virNetDevVPortProfileCheckNoExtras(const virNetDevVPort= Profile *virtport) =20 if (extra) { virReportError(VIR_ERR_XML_ERROR, - _("extra %s unsupported in "), + _("extra %1$s unsupported in "), extra, virNetDevVPortTypeToString(virtport->virtPortType)); return -1; @@ -290,8 +290,7 @@ virNetDevVPortProfileMerge(virNetDevVPortProfile *orig, if (otype !=3D VIR_NETDEV_VPORT_PROFILE_NONE && otype !=3D mods->virtPortType) { virReportError(VIR_ERR_XML_ERROR, - _("attempt to merge virtualports " - "with mismatched types (%s and %s)"), + _("attempt to merge virtualports with mismatche= d types (%1$s and %2$s)"), virNetDevVPortTypeToString(otype), virNetDevVPortTypeToString(mods->virtPortType)); return -1; @@ -305,8 +304,7 @@ virNetDevVPortProfileMerge(virNetDevVPortProfile *orig, if (orig->managerID_specified && (orig->managerID !=3D mods->managerID)) { virReportError(VIR_ERR_XML_ERROR, - _("attempt to merge virtualports " - "with mismatched managerids (%d and %d)"), + _("attempt to merge virtualports with mismatche= d managerids (%1$d and %2$d)"), orig->managerID, mods->managerID); return -1; } @@ -320,8 +318,7 @@ virNetDevVPortProfileMerge(virNetDevVPortProfile *orig, if (orig->typeID_specified && (orig->typeID !=3D mods->typeID)) { virReportError(VIR_ERR_XML_ERROR, - _("attempt to merge virtualports " - "with mismatched typeids (%d and %d)"), + _("attempt to merge virtualports with mismatche= d typeids (%1$d and %2$d)"), orig->typeID, mods->typeID); return -1; } @@ -335,8 +332,7 @@ virNetDevVPortProfileMerge(virNetDevVPortProfile *orig, if (orig->typeIDVersion_specified && (orig->typeIDVersion !=3D mods->typeIDVersion)) { virReportError(VIR_ERR_XML_ERROR, - _("attempt to merge virtualports with " - "mismatched typeidversions (%d and %d)"), + _("attempt to merge virtualports with mismatche= d typeidversions (%1$d and %2$d)"), orig->typeIDVersion, mods->typeIDVersion); return -1; } @@ -354,8 +350,7 @@ virNetDevVPortProfileMerge(virNetDevVPortProfile *orig, char modsuuid[VIR_UUID_STRING_BUFLEN]; =20 virReportError(VIR_ERR_XML_ERROR, - _("attempt to merge virtualports with " - "mismatched instanceids ('%s' and '%s')"), + _("attempt to merge virtualports with mismatche= d instanceids ('%1$s' and '%2$s')"), virUUIDFormat(orig->instanceID, origuuid), virUUIDFormat(mods->instanceID, modsuuid)); return -1; @@ -374,8 +369,7 @@ virNetDevVPortProfileMerge(virNetDevVPortProfile *orig, char modsuuid[VIR_UUID_STRING_BUFLEN]; =20 virReportError(VIR_ERR_XML_ERROR, - _("attempt to merge virtualports with " - "mismatched interfaceids ('%s' and '%s')"), + _("attempt to merge virtualports with mismatche= d interfaceids ('%1$s' and '%2$s')"), virUUIDFormat(orig->interfaceID, origuuid), virUUIDFormat(mods->interfaceID, modsuuid)); return -1; @@ -391,8 +385,7 @@ virNetDevVPortProfileMerge(virNetDevVPortProfile *orig, if (orig->profileID[0] && STRNEQ(orig->profileID, mods->profileID)) { virReportError(VIR_ERR_XML_ERROR, - _("attempt to merge virtualports with " - "mismatched profileids ('%s' and '%s')"), + _("attempt to merge virtualports with mismatche= d profileids ('%1$s' and '%2$s')"), orig->profileID, mods->profileID); return -1; } @@ -485,7 +478,7 @@ virNetDevVPortProfileGetLldpadPid(void) } } else { virReportSystemError(errno, - _("Error opening file %s"), LLDPAD_PID_FILE); + _("Error opening file %1$s"), LLDPAD_PID_FILE= ); } =20 VIR_FORCE_CLOSE(fd); @@ -577,8 +570,7 @@ virNetDevVPortProfileGetStatus(struct nlattr **tb, int3= 2_t vf, virUUIDFormat(instanceId, instanceIdStr); =20 virReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not find vf/instanceId %u/%s " - " in netlink response"), + _("Could not find vf/instanceId %1$u/%2$s i= n netlink response"), vf, instanceIdStr); =20 /* go through all the entries again. This seems tedious, @@ -812,7 +804,7 @@ virNetDevVPortProfileOpSetLink(const char *ifname, int = ifindex, =20 if (err->error) { virReportSystemError(-err->error, - _("error during virtual port configuratio= n of ifindex %d"), + _("error during virtual port configuratio= n of ifindex %1$d"), ifindex); goto cleanup; } @@ -978,8 +970,7 @@ virNetDevVPortProfileOpCommon(const char *ifname, int i= findex, /* keep trying... */ } else { virReportSystemError(EINVAL, - _("error %d during port-profile setlink o= n " - "interface %s (%d)"), + _("error %1$d during port-profile setlink= on interface %2$s (%3$d)"), status, ifname, ifindex); rc =3D -1; break; @@ -1080,7 +1071,7 @@ virNetDevVPortProfileOp8021Qbg(const char *ifname, break; default: virReportError(VIR_ERR_INTERNAL_ERROR, - _("operation type %d not supported"), virtPortOp); + _("operation type %1$d not supported"), virtPortOp); return -1; } =20 @@ -1189,7 +1180,7 @@ virNetDevVPortProfileOp8021Qbh(const char *ifname, =20 case VIR_NETDEV_VPORT_PROFILE_LINK_OP_PREASSOCIATE: virReportError(VIR_ERR_INTERNAL_ERROR, - _("operation type %d not supported"), virtPortOp); + _("operation type %1$d not supported"), virtPortOp); rc =3D -1; break; default: diff --git a/src/util/virnetlink.c b/src/util/virnetlink.c index 98f75652e9..f18a08c277 100644 --- a/src/util/virnetlink.c +++ b/src/util/virnetlink.c @@ -218,8 +218,8 @@ virNetlinkCreateSocket(int protocol) } if (nl_connect(nlhandle, protocol) < 0) { virReportSystemError(errno, - _("cannot connect to netlink socket " - "with protocol %d"), protocol); + _("cannot connect to netlink socket with prot= ocol %1$d"), + protocol); goto error; } =20 @@ -255,7 +255,7 @@ virNetlinkSendRequest(struct nl_msg *nl_msg, uint32_t s= rc_pid, =20 if (protocol >=3D MAX_LINKS) { virReportSystemError(EINVAL, - _("invalid protocol argument: %d"), protocol); + _("invalid protocol argument: %1$d"), protoco= l); goto error; } =20 @@ -541,7 +541,7 @@ virNetlinkDumpLink(const char *ifname, int ifindex, if (virNetlinkTalk(ifname, nl_msg, src_pid, dst_pid, &resp, &resp_len, &error, NULL) < 0) { virReportSystemError(-error, - _("error dumping %s (%d) interface"), + _("error dumping %1$s (%2$d) interface"), ifname, ifindex); return -1; } @@ -692,7 +692,7 @@ virNetlinkDelLink(const char *ifname, virNetlinkTalkFal= lback fallback) if (virNetlinkTalk(ifname, nl_msg, 0, 0, &resp, &resp_len, &error, fallback) < 0) { virReportSystemError(-error, - _("error destroying network device %s"), + _("error destroying network device %1$s"), ifname); return -1; } @@ -953,7 +953,7 @@ virNetlinkEventServiceIsRunning(unsigned int protocol) { if (protocol >=3D MAX_LINKS) { virReportSystemError(EINVAL, - _("invalid protocol argument: %d"), protocol); + _("invalid protocol argument: %1$d"), protoco= l); return false; } =20 @@ -1003,7 +1003,7 @@ virNetlinkEventServiceStart(unsigned int protocol, un= signed int groups) =20 if (protocol >=3D MAX_LINKS) { virReportSystemError(EINVAL, - _("invalid protocol argument: %d"), protocol); + _("invalid protocol argument: %1$d"), protoco= l); return -EINVAL; } =20 diff --git a/src/util/virnodesuspend.c b/src/util/virnodesuspend.c index 5feef79c43..01f387d6fa 100644 --- a/src/util/virnodesuspend.c +++ b/src/util/virnodesuspend.c @@ -66,7 +66,7 @@ static int virNodeSuspendSetNodeWakeup(unsigned long long= alarmTime) =20 if (alarmTime < MIN_TIME_REQ_FOR_SUSPEND) { virReportError(VIR_ERR_INVALID_ARG, - _("Suspend duration is too short, must be at least = %u seconds"), + _("Suspend duration is too short, must be at least = %1$u seconds"), MIN_TIME_REQ_FOR_SUSPEND); return -1; } diff --git a/src/util/virnuma.c b/src/util/virnuma.c index 43e299f4bb..d78fc78ac1 100644 --- a/src/util/virnuma.c +++ b/src/util/virnuma.c @@ -112,7 +112,7 @@ virNumaSetupMemoryPolicy(virDomainNumatuneMemMode mode, while ((bit =3D virBitmapNextSetBit(nodeset, bit)) >=3D 0) { if (bit > maxnode) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("NUMA node %d is out of range"), bit); + _("NUMA node %1$d is out of range"), bit); return -1; } nodemask_set(&mask, bit); @@ -348,7 +348,7 @@ virNumaNodesetToCPUset(virBitmap *nodeset, /* Error is reported for cases other than non-existent NUMA no= de. */ if (rc =3D=3D -2) { virReportError(VIR_ERR_OPERATION_FAILED, - _("NUMA node %zu is not available"), + _("NUMA node %1$zu is not available"), i); } return -1; @@ -568,16 +568,16 @@ virNumaGetHugePageInfoPath(char **path, if (node !=3D -1) { if (!virNumaNodeIsAvailable(node)) { virReportError(VIR_ERR_OPERATION_FAILED, - _("NUMA node %d is not available"), + _("NUMA node %1$d is not available"), node); } else { virReportError(VIR_ERR_OPERATION_FAILED, - _("page size %u is not available on node %d= "), + _("page size %1$u is not available on node = %2$d"), page_size, node); } } else { virReportError(VIR_ERR_OPERATION_FAILED, - _("page size %u is not available"), + _("page size %1$u is not available"), page_size); } return -1; @@ -638,7 +638,7 @@ virNumaGetHugePageInfo(int node, if (virStrToLong_ull(buf, &end, 10, page_avail) < 0 || *end !=3D '\n') { virReportError(VIR_ERR_INTERNAL_ERROR, - _("unable to parse: %s"), + _("unable to parse: %1$s"), buf); return -1; } @@ -657,7 +657,7 @@ virNumaGetHugePageInfo(int node, if (virStrToLong_ull(buf, &end, 10, page_free) < 0 || *end !=3D '\n') { virReportError(VIR_ERR_INTERNAL_ERROR, - _("unable to parse: %s"), + _("unable to parse: %1$s"), buf); return -1; } @@ -809,7 +809,7 @@ virNumaGetPages(int node, if (virStrToLong_ui(page_name, &end, 10, &page_size) < 0 || STRCASENEQ(end, "kB")) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("unable to parse %s"), + _("unable to parse %1$s"), entry->d_name); return -1; } @@ -902,7 +902,7 @@ virNumaSetPagePoolSize(int node, if (virStrToLong_ull(nr_buf, &end, 10, &nr_count) < 0 || *end !=3D '\n') { virReportError(VIR_ERR_OPERATION_FAILED, - _("invalid number '%s' in '%s'"), + _("invalid number '%1$s' in '%2$s'"), nr_buf, nr_path); return -1; } @@ -933,7 +933,7 @@ virNumaSetPagePoolSize(int node, =20 if (virFileWriteStr(nr_path, nr_buf, 0) < 0) { virReportSystemError(errno, - _("Unable to write to: %s"), nr_path); + _("Unable to write to: %1$s"), nr_path); return -1; } =20 @@ -946,14 +946,14 @@ virNumaSetPagePoolSize(int node, if (virStrToLong_ull(nr_buf, &end, 10, &nr_count) < 0 || *end !=3D '\n') { virReportError(VIR_ERR_OPERATION_FAILED, - _("invalid number '%s' in '%s'"), + _("invalid number '%1$s' in '%2$s'"), nr_buf, nr_path); return -1; } =20 if (nr_count !=3D page_count) { virReportError(VIR_ERR_OPERATION_FAILED, - _("Unable to allocate %llu pages. Allocated only %l= lu"), + _("Unable to allocate %1$llu pages. Allocated only = %2$llu"), page_count, nr_count); return -1; } @@ -1014,7 +1014,7 @@ virNumaNodesetIsAvailable(virBitmap *nodeset) continue; =20 virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("NUMA node %zd is unavailable"), bit); + _("NUMA node %1$zd is unavailable"), bit); return false; } return true; diff --git a/src/util/virnvme.c b/src/util/virnvme.c index d0f0c04aba..f7f8dc5ea9 100644 --- a/src/util/virnvme.c +++ b/src/util/virnvme.c @@ -185,7 +185,7 @@ virNVMeDeviceListAdd(virNVMeDeviceList *list, if ((tmp =3D virNVMeDeviceListLookup(list, dev))) { g_autofree char *addrStr =3D virPCIDeviceAddressAsString(&tmp->add= ress); virReportError(VIR_ERR_INTERNAL_ERROR, - _("NVMe device %s namespace %u is already on the li= st"), + _("NVMe device %1$s namespace %2$u is already on th= e list"), NULLSTR(addrStr), tmp->namespace); return -1; } @@ -209,7 +209,7 @@ virNVMeDeviceListDel(virNVMeDeviceList *list, if ((idx =3D virNVMeDeviceListLookupIndex(list, dev)) < 0) { g_autofree char *addrStr =3D virPCIDeviceAddressAsString(&dev->add= ress); virReportError(VIR_ERR_INTERNAL_ERROR, - _("NVMe device %s namespace %u not found"), + _("NVMe device %1$s namespace %2$u not found"), NULLSTR(addrStr), dev->namespace); return -1; } @@ -420,7 +420,7 @@ virNVMeDeviceListCreateReAttachList(virNVMeDeviceList *= activeList, /* Shouldn't happen (TM) */ g_autofree char *addrStr =3D virPCIDeviceAddressAsString(&d->a= ddress); virReportError(VIR_ERR_INTERNAL_ERROR, - _("NVMe device %s namespace %u not found"), + _("NVMe device %1$s namespace %2$u not found"), NULLSTR(addrStr), d->namespace); return NULL; } else if (nused > 1) { diff --git a/src/util/virobject.c b/src/util/virobject.c index b74d74a545..92af4f9fd6 100644 --- a/src/util/virobject.c +++ b/src/util/virobject.c @@ -181,7 +181,7 @@ virClassNew(virClass *parent, } else if (objectSize <=3D parentSize || parentSize !=3D (parent ? parent->objectSize : 0)) { virReportInvalidArg(objectSize, - _("object size %zu of %s is not larger than pa= rent class %zu"), + _("object size %1$zu of %2$s is not larger tha= n parent class %3$zu"), objectSize, name, parent->objectSize); return NULL; } @@ -266,7 +266,7 @@ virObjectLockableNew(virClass *klass) =20 if (!virClassIsDerivedFrom(klass, virClassForObjectLockable())) { virReportInvalidArg(klass, - _("Class %s must derive from virObjectLockable= "), + _("Class %1$s must derive from virObjectLockab= le"), virClassName(klass)); return NULL; } @@ -292,7 +292,7 @@ virObjectRWLockableNew(virClass *klass) =20 if (!virClassIsDerivedFrom(klass, virClassForObjectRWLockable())) { virReportInvalidArg(klass, - _("Class %s must derive from virObjectRWLockab= le"), + _("Class %1$s must derive from virObjectRWLock= able"), virClassName(klass)); return NULL; } diff --git a/src/util/virpci.c b/src/util/virpci.c index 7800966963..9e564e4a4f 100644 --- a/src/util/virpci.c +++ b/src/util/virpci.c @@ -252,13 +252,13 @@ virPCIDeviceGetDriverPathAndName(virPCIDevice *dev, c= har **path, char **name) =20 if (virFileIsLink(drvlink) !=3D 1) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Invalid device %s driver file %s is not a symlin= k"), + _("Invalid device %1$s driver file %2$s is not a sy= mlink"), dev->name, drvlink); goto cleanup; } if (virFileResolveLink(drvlink, path) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to resolve device %s driver symlink %s"), + _("Unable to resolve device %1$s driver symlink %2$= s"), dev->name, drvlink); goto cleanup; } @@ -287,7 +287,7 @@ virPCIDeviceConfigOpenInternal(virPCIDevice *dev, bool = readonly, bool fatal) if (fd < 0) { if (fatal) { virReportSystemError(errno, - _("Failed to open config space file '%s'"= ), + _("Failed to open config space file '%1$s= '"), dev->path); } else { VIR_WARN("Failed to open config space file '%s': %s", @@ -408,7 +408,7 @@ virPCIDeviceReadClass(virPCIDevice *dev, uint16_t *devi= ce_class) id_str[8] =3D '\0'; if (virStrToLong_ui(id_str, NULL, 16, &value) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unusual value in %s/devices/%s/class: %s"), + _("Unusual value in %1$s/devices/%2$s/class: %3$s"), PCI_SYSFS, dev->name, id_str); return -1; } @@ -836,7 +836,7 @@ virPCIDeviceTrySecondaryBusReset(virPCIDevice *dev, */ if ((conflict =3D virPCIDeviceBusContainsActiveDevices(dev, inactiveDe= vs))) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Active %s devices on bus with %s, not doing bus = reset"), + _("Active %1$s devices on bus with %2$s, not doing = bus reset"), conflict->name, dev->name); return -1; } @@ -846,7 +846,7 @@ virPCIDeviceTrySecondaryBusReset(virPCIDevice *dev, return -1; if (!parent) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to find parent device for %s"), + _("Failed to find parent device for %1$s"), dev->name); return -1; } @@ -861,7 +861,7 @@ virPCIDeviceTrySecondaryBusReset(virPCIDevice *dev, */ if (virPCIDeviceRead(dev, cfgfd, 0, config_space, PCI_CONF_LEN) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to read PCI config space for %s"), + _("Failed to read PCI config space for %1$s"), dev->name); goto out; } @@ -882,7 +882,7 @@ virPCIDeviceTrySecondaryBusReset(virPCIDevice *dev, =20 if (virPCIDeviceWrite(dev, cfgfd, 0, config_space, PCI_CONF_LEN) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to restore PCI config space for %s"), + _("Failed to restore PCI config space for %1$s"), dev->name); goto out; } @@ -909,7 +909,7 @@ virPCIDeviceTryPowerManagementReset(virPCIDevice *dev, = int cfgfd) /* Save and restore the device's config space. */ if (virPCIDeviceRead(dev, cfgfd, 0, &config_space[0], PCI_CONF_LEN) < = 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to read PCI config space for %s"), + _("Failed to read PCI config space for %1$s"), dev->name); return -1; } @@ -931,7 +931,7 @@ virPCIDeviceTryPowerManagementReset(virPCIDevice *dev, = int cfgfd) =20 if (virPCIDeviceWrite(dev, cfgfd, 0, &config_space[0], PCI_CONF_LEN) <= 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to restore PCI config space for %s"), + _("Failed to restore PCI config space for %1$s"), dev->name); return -1; } @@ -1015,15 +1015,14 @@ virPCIDeviceReset(virPCIDevice *dev, =20 if (hdrType !=3D VIR_PCI_HEADER_ENDPOINT) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Invalid attempt to reset PCI device %s. " - "Only PCI endpoint devices can be reset"), + _("Invalid attempt to reset PCI device %1$s. Only P= CI endpoint devices can be reset"), dev->name); return -1; } =20 if (activeDevs && virPCIDeviceListFind(activeDevs, &dev->address)) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Not resetting active device %s"), dev->name); + _("Not resetting active device %1$s"), dev->name); return -1; } =20 @@ -1071,7 +1070,7 @@ virPCIDeviceReset(virPCIDevice *dev, if (ret < 0) { virErrorPtr err =3D virGetLastError(); virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to reset PCI device %s: %s"), + _("Unable to reset PCI device %1$s: %2$s"), dev->name, err ? err->message : _("no FLR, PM reset or bus reset available")); @@ -1119,12 +1118,11 @@ virPCIProbeStubDriver(virPCIStubDriver driver) */ if (virKModIsProhibited(drvname)) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to load PCI stub module %s: " - "administratively prohibited"), + _("Failed to load PCI stub module %1$s: administrat= ively prohibited"), drvname); } else { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to load PCI stub module %s"), + _("Failed to load PCI stub module %1$s"), drvname); } =20 @@ -1150,7 +1148,7 @@ virPCIDeviceUnbind(virPCIDevice *dev) if (virFileExists(path)) { if (virFileWriteStr(path, dev->name, 0) < 0) { virReportSystemError(errno, - _("Failed to unbind PCI device '%s' from = %s"), + _("Failed to unbind PCI device '%1$s' fro= m %2$s"), dev->name, driver); return -1; } @@ -1175,7 +1173,7 @@ int virPCIDeviceRebind(virPCIDevice *dev) =20 if (virFileWriteStr(PCI_SYSFS "drivers_probe", dev->name, 0) < 0) { virReportSystemError(errno, - _("Failed to trigger a probe for PCI device '= %s'"), + _("Failed to trigger a probe for PCI device '= %1$s'"), dev->name); return -1; } @@ -1205,8 +1203,7 @@ virPCIDeviceBindWithDriverOverride(virPCIDevice *dev, =20 if (virFileWriteStr(path, driverName, 0) < 0) { virReportSystemError(errno, - _("Failed to add driver '%s' to driver_overri= de " - " interface of PCI device '%s'"), + _("Failed to add driver '%1$s' to driver_over= ride interface of PCI device '%2$s'"), driverName, dev->name); return -1; } @@ -1238,12 +1235,12 @@ virPCIDeviceBindToStub(virPCIDevice *dev) /* Check the device is configured to use one of the known stub drivers= */ if (dev->stubDriver =3D=3D VIR_PCI_STUB_DRIVER_NONE) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("No stub driver configured for PCI device %s"), + _("No stub driver configured for PCI device %1$s"), dev->name); return -1; } else if (!(stubDriverName =3D virPCIStubDriverTypeToString(dev->stub= Driver))) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unknown stub driver configured for PCI device %s= "), + _("Unknown stub driver configured for PCI device %1= $s"), dev->name); return -1; } @@ -1295,7 +1292,7 @@ virPCIDeviceDetach(virPCIDevice *dev, =20 if (activeDevs && virPCIDeviceListFind(activeDevs, &dev->address)) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Not detaching active device %s"), dev->name); + _("Not detaching active device %1$s"), dev->name); return -1; } =20 @@ -1325,7 +1322,7 @@ virPCIDeviceReattach(virPCIDevice *dev, { if (activeDevs && virPCIDeviceListFind(activeDevs, &dev->address)) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Not reattaching active device %s"), dev->name); + _("Not reattaching active device %1$s"), dev->name); return -1; } =20 @@ -1370,24 +1367,21 @@ virPCIDeviceAddressIsValid(virPCIDeviceAddress *add= r, if (addr->bus > 0xFF) { if (report) virReportError(VIR_ERR_XML_ERROR, - _("Invalid PCI address bus=3D'0x%x', " - "must be <=3D 0xFF"), + _("Invalid PCI address bus=3D'0x%1$x', must be = <=3D 0xFF"), addr->bus); return false; } if (addr->slot > 0x1F) { if (report) virReportError(VIR_ERR_XML_ERROR, - _("Invalid PCI address slot=3D'0x%x', " - "must be <=3D 0x1F"), + _("Invalid PCI address slot=3D'0x%1$x', must be= <=3D 0x1F"), addr->slot); return false; } if (addr->function > 7) { if (report) virReportError(VIR_ERR_XML_ERROR, - _("Invalid PCI address function=3D0x%x, " - "must be <=3D 7"), + _("Invalid PCI address function=3D0x%1$x, must = be <=3D 7"), addr->function); return false; } @@ -1468,7 +1462,7 @@ virPCIDeviceNew(const virPCIDeviceAddress *address) =20 if (!virFileExists(dev->path)) { virReportSystemError(errno, - _("Device %s not found: could not access %s"), + _("Device %1$s not found: could not access %2= $s"), dev->name, dev->path); return NULL; } @@ -1478,7 +1472,7 @@ virPCIDeviceNew(const virPCIDeviceAddress *address) =20 if (!vendor || !product) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to read product/vendor ID for %s"), + _("Failed to read product/vendor ID for %1$s"), dev->name); return NULL; } @@ -1487,7 +1481,7 @@ virPCIDeviceNew(const virPCIDeviceAddress *address) if (g_snprintf(dev->id, sizeof(dev->id), "%s %s", &vendor[2], &product[2]) >=3D sizeof(dev->id)) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("dev->id buffer overflow: %s %s"), + _("dev->id buffer overflow: %1$s %2$s"), &vendor[2], &product[2]); return NULL; } @@ -1678,7 +1672,7 @@ virPCIDeviceListAdd(virPCIDeviceList *list, { if (virPCIDeviceListFind(list, &dev->address)) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Device %s is already in use"), dev->name); + _("Device %1$s is already in use"), dev->name); return -1; } VIR_APPEND_ELEMENT(list->devs, list->count, dev); @@ -1868,7 +1862,7 @@ virPCIDeviceAddressIOMMUGroupIterate(virPCIDeviceAddr= ess *orig, =20 if (virPCIDeviceAddressParse(ent->d_name, &newDev) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Found invalid device link '%s' in '%s'"), + _("Found invalid device link '%1$s' in '%2$s'"), ent->d_name, groupPath); return -1; } @@ -1995,7 +1989,7 @@ virPCIDeviceAddressGetIOMMUGroupNum(virPCIDeviceAddre= ss *addr) return -2; if (virFileResolveLink(devPath, &groupPath) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to resolve device %s iommu_group symlink = %s"), + _("Unable to resolve device %1$s iommu_group symlin= k %2$s"), devName, devPath); return -1; } @@ -2003,8 +1997,7 @@ virPCIDeviceAddressGetIOMMUGroupNum(virPCIDeviceAddre= ss *addr) groupNumStr =3D g_path_get_basename(groupPath); if (virStrToLong_ui(groupNumStr, NULL, 10, &groupNum) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("device %s iommu_group symlink %s has " - "invalid group number %s"), + _("device %1$s iommu_group symlink %2$s has invalid= group number %3$s"), devName, groupPath, groupNumStr); return -1; } @@ -2039,13 +2032,13 @@ virPCIDeviceGetIOMMUGroupDev(virPCIDevice *dev) =20 if (virFileIsLink(devPath) !=3D 1) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Invalid device %s iommu_group file %s is not a s= ymlink"), + _("Invalid device %1$s iommu_group file %2$s is not= a symlink"), dev->name, devPath); return NULL; } if (virFileResolveLink(devPath, &groupPath) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to resolve device %s iommu_group symlink = %s"), + _("Unable to resolve device %1$s iommu_group symlin= k %2$s"), dev->name, devPath); return NULL; } @@ -2119,7 +2112,7 @@ virPCIDeviceIsBehindSwitchLackingACS(virPCIDevice *de= v) return 0; } else { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to find parent device for %s"), + _("Failed to find parent device for %1$s"), dev->name); return -1; } @@ -2172,8 +2165,7 @@ int virPCIDeviceIsAssignable(virPCIDevice *dev, dev->id, dev->name); } else { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Device %s is behind a switch lacking ACS and= " - "cannot be assigned"), + _("Device %1$s is behind a switch lacking ACS a= nd cannot be assigned"), dev->name); return 0; } @@ -2192,7 +2184,7 @@ logStrToLong_ui(char const *s, =20 ret =3D virStrToLong_ui(s, end_ptr, base, result); if (ret !=3D 0) - VIR_ERROR(_("Failed to convert '%s' to unsigned int"), s); + VIR_ERROR(_("Failed to convert '%1$s' to unsigned int"), s); return ret; } =20 @@ -2282,7 +2274,7 @@ virPCIGetDeviceAddressFromSysfsLink(const char *devic= e_link) device_path =3D virFileCanonicalizePath(device_link); if (device_path =3D=3D NULL) { virReportSystemError(errno, - _("Failed to resolve device link '%s'"), + _("Failed to resolve device link '%1$s'"), device_link); return NULL; } @@ -2292,7 +2284,7 @@ virPCIGetDeviceAddressFromSysfsLink(const char *devic= e_link) =20 if (virPCIDeviceAddressParse(config_address, bdf) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to parse PCI config address '%s'"), + _("Failed to parse PCI config address '%1$s'"), config_address); return NULL; } @@ -2364,7 +2356,7 @@ virPCIGetVirtualFunctionsFull(const char *sysfs_path, return -1; if (virStrToLong_ull(totalvfs_str, &end, 10, &maxfunctions) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unrecognized value in %s: %s"), + _("Unrecognized value in %1$s: %2$s"), totalvfs_file, totalvfs_str); return -1; } @@ -2383,7 +2375,7 @@ virPCIGetVirtualFunctionsFull(const char *sysfs_path, =20 if (!(fnc.addr =3D virPCIGetDeviceAddressFromSysfsLink(device_link= ))) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to get SRIOV function from device lin= k '%s'"), + _("Failed to get SRIOV function from device lin= k '%1$s'"), device_link); return -1; } @@ -2434,8 +2426,8 @@ virPCIGetVirtualFunctionIndex(const char *pf_sysfs_de= vice_link, =20 if (virPCIGetVirtualFunctions(pf_sysfs_device_link, &virt_fns) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Error getting physical function's '%s' " - "virtual_functions"), pf_sysfs_device_link); + _("Error getting physical function's '%1$s' virtual= _functions"), + pf_sysfs_device_link); return -1; } =20 @@ -2582,7 +2574,7 @@ virPCIGetNetName(const char *device_link_sysfs_path, } =20 virReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not find any network device under PCI device a= t %s"), + _("Could not find any network device under PCI device a= t %1$s"), device_link_sysfs_path); return -1; } @@ -2635,7 +2627,7 @@ virPCIGetVirtualFunctionInfo(const char *vf_sysfs_dev= ice_path, * PF device is bound to a network driver */ virReportError(VIR_ERR_INTERNAL_ERROR, - _("The PF device for VF %s has no network device na= me"), + _("The PF device for VF %1$s has no network device = name"), vf_sysfs_device_path); return -1; } @@ -2680,18 +2672,18 @@ virPCIDeviceGetVPD(virPCIDevice *dev) =20 vpdPath =3D virPCIFile(dev->name, "vpd"); if (!virPCIDeviceHasVPD(dev)) { - virReportError(VIR_ERR_INTERNAL_ERROR, _("Device %s does not have = a VPD"), + virReportError(VIR_ERR_INTERNAL_ERROR, _("Device %1$s does not hav= e a VPD"), virPCIDeviceGetName(dev)); return NULL; } if ((fd =3D open(vpdPath, O_RDONLY)) < 0) { - virReportSystemError(-fd, _("Failed to open a VPD file '%s'"), vpd= Path); + virReportSystemError(-fd, _("Failed to open a VPD file '%1$s'"), v= pdPath); return NULL; } res =3D virPCIVPDParse(fd); =20 if (VIR_CLOSE(fd) < 0) { - virReportSystemError(errno, _("Unable to close the VPD file, fd: %= d"), fd); + virReportSystemError(errno, _("Unable to close the VPD file, fd: %= 1$d"), fd); return NULL; } =20 @@ -2854,7 +2846,7 @@ virPCIDeviceGetLinkCapSta(virPCIDevice *dev, =20 if (!dev->pcie_cap_pos) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("pci device %s is not a PCI-Express device"), + _("pci device %1$s is not a PCI-Express device"), dev->name); goto cleanup; } @@ -2894,7 +2886,7 @@ int virPCIGetHeaderType(virPCIDevice *dev, int *hdrTy= pe) type &=3D PCI_HEADER_TYPE_MASK; if (type >=3D VIR_PCI_HEADER_LAST) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unknown PCI header type '%d' for device '%s'"), + _("Unknown PCI header type '%1$d' for device '%2$s'= "), type, dev->name); return -1; } diff --git a/src/util/virperf.c b/src/util/virperf.c index 434d1d99c4..03341e73e3 100644 --- a/src/util/virperf.c +++ b/src/util/virperf.c @@ -214,7 +214,7 @@ virPerfEventEnable(virPerf *perf, type =3D=3D VIR_PERF_EVENT_MBMT || type =3D=3D VIR_PERF_EVENT_MBML)) { virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, - _("unable to enable host cpu perf event for %s"), + _("unable to enable host cpu perf event for %1$s"), virPerfEventTypeToString(type)); return -1; } @@ -244,14 +244,14 @@ virPerfEventEnable(virPerf *perf, event->fd =3D syscall(__NR_perf_event_open, &attr, pid, -1, -1, 0); if (event->fd < 0) { virReportSystemError(errno, - _("unable to open host cpu perf event for %s"= ), + _("unable to open host cpu perf event for %1$= s"), virPerfEventTypeToString(type)); goto error; } =20 if (ioctl(event->fd, PERF_EVENT_IOC_ENABLE) < 0) { virReportSystemError(errno, - _("unable to enable host cpu perf event for %= s"), + _("unable to enable host cpu perf event for %= 1$s"), virPerfEventTypeToString(type)); goto error; } @@ -275,7 +275,7 @@ virPerfEventDisable(virPerf *perf, =20 if (ioctl(event->fd, PERF_EVENT_IOC_DISABLE) < 0) { virReportSystemError(errno, - _("unable to disable host cpu perf event for = %s"), + _("unable to disable host cpu perf event for = %1$s"), virPerfEventTypeToString(type)); return -1; } diff --git a/src/util/virpidfile.c b/src/util/virpidfile.c index 4693aaaf78..f61caca2de 100644 --- a/src/util/virpidfile.c +++ b/src/util/virpidfile.c @@ -378,7 +378,7 @@ int virPidFileAcquirePathFull(const char *path, if ((fd =3D open(path, O_WRONLY|O_CREAT, 0644)) < 0) { if (!quiet) { virReportSystemError(errno, - _("Failed to open pid file '%s'"), + _("Failed to open pid file '%1$s'"), path); } return -1; @@ -387,7 +387,7 @@ int virPidFileAcquirePathFull(const char *path, if (virSetCloseExec(fd) < 0) { if (!quiet) { virReportSystemError(errno, - _("Failed to set close-on-exec flag '= %s'"), + _("Failed to set close-on-exec flag '= %1$s'"), path); } VIR_FORCE_CLOSE(fd); @@ -397,7 +397,7 @@ int virPidFileAcquirePathFull(const char *path, if (fstat(fd, &b) < 0) { if (!quiet) { virReportSystemError(errno, - _("Unable to check status of pid file= '%s'"), + _("Unable to check status of pid file= '%1$s'"), path); } VIR_FORCE_CLOSE(fd); @@ -407,7 +407,7 @@ int virPidFileAcquirePathFull(const char *path, if (virFileLock(fd, false, 0, 1, waitForLock) < 0) { if (!quiet) { virReportSystemError(errno, - _("Failed to acquire pid file '%s'"), + _("Failed to acquire pid file '%1$s'"= ), path); } VIR_FORCE_CLOSE(fd); @@ -438,7 +438,7 @@ int virPidFileAcquirePathFull(const char *path, if (ftruncate(fd, 0) < 0) { if (!quiet) { virReportSystemError(errno, - _("Failed to truncate pid file '%s'"), + _("Failed to truncate pid file '%1$s'"), path); } VIR_FORCE_CLOSE(fd); @@ -448,7 +448,7 @@ int virPidFileAcquirePathFull(const char *path, if (safewrite(fd, pidstr, strlen(pidstr)) < 0) { if (!quiet) { virReportSystemError(errno, - _("Failed to write to pid file '%s'"), + _("Failed to write to pid file '%1$s'"), path); } VIR_FORCE_CLOSE(fd); @@ -544,7 +544,7 @@ virPidFileConstructPath(bool privileged, =20 if (g_mkdir_with_parents(rundir, 0700) < 0) { virReportSystemError(errno, - _("Cannot create user runtime directory '= %s'"), + _("Cannot create user runtime directory '= %1$s'"), rundir); return -1; } diff --git a/src/util/virpolkit.c b/src/util/virpolkit.c index 6c83eaf412..0a637db9ba 100644 --- a/src/util/virpolkit.c +++ b/src/util/virpolkit.c @@ -137,7 +137,7 @@ int virPolkitCheckAuth(const char *actionid, _("user cancelled authentication process")); } else if (is_challenge) { virReportError(VIR_ERR_AUTH_UNAVAILABLE, - _("no polkit agent available to authenticate action= '%s'"), + _("no polkit agent available to authenticate action= '%1$s'"), actionid); } else { virReportError(VIR_ERR_AUTH_FAILED, "%s", diff --git a/src/util/virportallocator.c b/src/util/virportallocator.c index 87835a3ed7..6d6f99778e 100644 --- a/src/util/virportallocator.c +++ b/src/util/virportallocator.c @@ -147,7 +147,7 @@ virPortAllocatorBindToPort(bool *used, addr =3D (struct sockaddr*)&addr4; addrlen =3D sizeof(addr4); } else { - virReportError(VIR_ERR_INTERNAL_ERROR, _("Unknown family %d"), fam= ily); + virReportError(VIR_ERR_INTERNAL_ERROR, _("Unknown family %1$d"), f= amily); return -1; } =20 @@ -176,7 +176,7 @@ virPortAllocatorBindToPort(bool *used, *used =3D true; ret =3D 0; } else { - virReportSystemError(errno, _("Unable to bind to port %d"), po= rt); + virReportSystemError(errno, _("Unable to bind to port %1$d"), = port); } goto cleanup; } @@ -224,7 +224,7 @@ virPortAllocatorAcquire(const virPortAllocatorRange *ra= nge, /* Add port to bitmap of reserved ports */ if (virBitmapSetBit(pa->bitmap, i) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to reserve port %zu"), i); + _("Failed to reserve port %1$zu"), i); return -1; } *port =3D i; @@ -234,7 +234,7 @@ virPortAllocatorAcquire(const virPortAllocatorRange *ra= nge, } =20 virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to find an unused port in range '%s' (%d-%d)"= ), + _("Unable to find an unused port in range '%1$s' (%2$d-= %3$d)"), range->name, range->start, range->end); return -1; } @@ -272,7 +272,7 @@ virPortAllocatorSetUsed(unsigned short port) if (virBitmapIsBitSet(pa->bitmap, port) || virBitmapSetBit(pa->bitmap, port) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to reserve port %d"), port); + _("Failed to reserve port %1$d"), port); return -1; } } diff --git a/src/util/virprocess.c b/src/util/virprocess.c index 39ca5de811..7f29f8be89 100644 --- a/src/util/virprocess.c +++ b/src/util/virprocess.c @@ -97,13 +97,13 @@ virProcessTranslateStatus(int status) { char *buf; if (WIFEXITED(status)) { - buf =3D g_strdup_printf(_("exit status %d"), + buf =3D g_strdup_printf(_("exit status %1$d"), WEXITSTATUS(status)); } else if (WIFSIGNALED(status)) { - buf =3D g_strdup_printf(_("fatal signal %d"), + buf =3D g_strdup_printf(_("fatal signal %1$d"), WTERMSIG(status)); } else { - buf =3D g_strdup_printf(_("invalid value %d"), status); + buf =3D g_strdup_printf(_("invalid value %1$d"), status); } return buf; } @@ -200,7 +200,7 @@ virProcessWait(pid_t pid, int *exitstatus, bool raw) =20 if (pid <=3D 0) { if (pid !=3D -1) - virReportSystemError(EINVAL, _("unable to wait for process %ll= d"), + virReportSystemError(EINVAL, _("unable to wait for process %1$= lld"), (long long) pid); return -1; } @@ -210,7 +210,7 @@ virProcessWait(pid_t pid, int *exitstatus, bool raw) errno =3D=3D EINTR); =20 if (ret =3D=3D -1) { - virReportSystemError(errno, _("unable to wait for process %lld"), + virReportSystemError(errno, _("unable to wait for process %1$lld"), (long long) pid); return -1; } @@ -231,7 +231,7 @@ virProcessWait(pid_t pid, int *exitstatus, bool raw) error: st =3D virProcessTranslateStatus(status); virReportError(VIR_ERR_INTERNAL_ERROR, - _("Child process (%lld) unexpected %s"), + _("Child process (%1$lld) unexpected %2$s"), (long long) pid, NULLSTR(st)); return -1; } @@ -241,7 +241,7 @@ virProcessWait(pid_t pid, int *exitstatus, bool raw) char * virProcessTranslateStatus(int status) { - return g_strdup_printf(_("invalid value %d"), status); + return g_strdup_printf(_("invalid value %1$d"), status); } =20 =20 @@ -256,7 +256,7 @@ virProcessAbort(pid_t pid) int virProcessWait(pid_t pid, int *exitstatus G_GNUC_UNUSED, bool raw G_GNUC_U= NUSED) { - virReportSystemError(ENOSYS, _("unable to wait for process %lld"), + virReportSystemError(ENOSYS, _("unable to wait for process %1$lld"), (long long) pid); return -1; } @@ -417,7 +417,7 @@ virProcessKillPainfullyDelay(pid_t pid, bool force, uns= igned int extradelay, boo if (rc < 0) { if (errno !=3D ESRCH) { virReportSystemError(errno, - _("Failed to terminate process %lld w= ith SIG%s"), + _("Failed to terminate process %1$lld= with SIG%2$s"), (long long)pid, signame); return -1; } @@ -428,7 +428,7 @@ virProcessKillPainfullyDelay(pid_t pid, bool force, uns= igned int extradelay, boo } =20 virReportSystemError(EBUSY, - _("Failed to terminate process %lld with SIG%s"), + _("Failed to terminate process %1$lld with SIG%2$= s"), (long long)pid, signame); =20 return 0; @@ -486,7 +486,7 @@ int virProcessSetAffinity(pid_t pid, virBitmap *map, bo= ol quiet) pid, g_strerror(errno)); } else { virReportSystemError(errno, - _("cannot set CPU affinity on process %d"= ), pid); + _("cannot set CPU affinity on process %1$= d"), pid); return -1; } } @@ -515,7 +515,7 @@ virProcessGetAffinity(pid_t pid) =20 if (sched_getaffinity(pid, masklen, mask) < 0) { virReportSystemError(errno, - _("cannot get CPU affinity of process %d"), p= id); + _("cannot get CPU affinity of process %1$d"),= pid); goto cleanup; } =20 @@ -554,7 +554,7 @@ int virProcessSetAffinity(pid_t pid, pid, g_strerror(errno)); } else { virReportSystemError(errno, - _("cannot set CPU affinity on process %d"= ), pid); + _("cannot set CPU affinity on process %1$= d"), pid); return -1; } } @@ -573,7 +573,7 @@ virProcessGetAffinity(pid_t pid) if (cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, pid, sizeof(mask), &mask) !=3D 0) { virReportSystemError(errno, - _("cannot get CPU affinity of process %d"), p= id); + _("cannot get CPU affinity of process %1$d"),= pid); return NULL; } =20 @@ -927,8 +927,7 @@ virProcessSetMaxMemLock(pid_t pid, unsigned long long b= ytes) =20 if (virProcessSetLimit(pid, RLIMIT_MEMLOCK, &rlim) < 0) { virReportSystemError(errno, - _("cannot limit locked memory " - "of process %lld to %llu"), + _("cannot limit locked memory of process %1$l= ld to %2$llu"), (long long int)pid, bytes); return -1; } @@ -969,8 +968,7 @@ virProcessGetMaxMemLock(pid_t pid, =20 if (virProcessGetLimit(pid, RLIMIT_MEMLOCK, &rlim) < 0) { virReportSystemError(errno, - _("cannot get locked memory limit " - "of process %lld"), + _("cannot get locked memory limit of process = %1$lld"), (long long int) pid); return -1; } @@ -1017,8 +1015,7 @@ virProcessSetMaxProcesses(pid_t pid, unsigned int pro= cs) =20 if (virProcessSetLimit(pid, RLIMIT_NPROC, &rlim) < 0) { virReportSystemError(errno, - _("cannot limit number of subprocesses " - "of process %lld to %u"), + _("cannot limit number of subprocesses of process %1$lld t= o %2$u"), (long long int)pid, procs); return -1; } @@ -1061,8 +1058,7 @@ virProcessSetMaxFiles(pid_t pid, unsigned int files) =20 if (virProcessSetLimit(pid, RLIMIT_NOFILE, &rlim) < 0) { virReportSystemError(errno, - _("cannot limit number of open files " - "of process %lld to %u"), + _("cannot limit number of open files of proce= ss %1$lld to %2$u"), (long long int)pid, files); return -1; } @@ -1098,8 +1094,7 @@ virProcessSetMaxCoreSize(pid_t pid, unsigned long lon= g bytes) =20 if (virProcessSetLimit(pid, RLIMIT_CORE, &rlim) < 0) { virReportSystemError(errno, - _("cannot limit core file size " - "of process %lld to %llu"), + _("cannot limit core file size of process %1$lld to %2$llu= "), (long long int)pid, bytes); return -1; } @@ -1130,14 +1125,14 @@ int virProcessGetStartTime(pid_t pid, =20 if (!proc_stat || g_strv_length(proc_stat) < 22) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Cannot find start time for pid %d"), (int)pid); + _("Cannot find start time for pid %1$d"), (int)pid); return -1; } =20 starttime_str =3D proc_stat[VIR_PROCESS_STAT_STARTTIME]; if (virStrToLong_ull(starttime_str, NULL, 10, timestamp) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Cannot parse start time %s for pid %d"), + _("Cannot parse start time %1$s for pid %2$d"), starttime_str, (int)pid); return -1; } @@ -1363,7 +1358,7 @@ virProcessRunInFork(virProcessForkCallback cb, memcpy(bin->bindata, buf, sizeof(*bin)); =20 virReportError(VIR_ERR_INTERNAL_ERROR, - _("child reported (status=3D%d): %s"), + _("child reported (status=3D%1$d): %2$s= "), status, NULLSTR(bin->data.message)); =20 virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, @@ -1378,7 +1373,7 @@ virProcessRunInFork(virProcessForkCallback cb, "%s", bin->data.message); } else { virReportError(VIR_ERR_INTERNAL_ERROR, - _("child didn't write error (status=3D%= d)"), + _("child didn't write error (status=3D%= 1$d)"), status); } } @@ -1599,7 +1594,7 @@ virProcessSetScheduler(pid_t pid, =20 if (pol < 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Scheduler '%s' is not supported on this platform= "), + _("Scheduler '%1$s' is not supported on this platfo= rm"), virProcessSchedPolicyTypeToString(policy)); return -1; } @@ -1624,7 +1619,7 @@ virProcessSetScheduler(pid_t pid, =20 if (priority < min || priority > max) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Scheduler priority %d out of range [%d, %d]"= ), + _("Scheduler priority %1$d out of range [%2$d, = %3$d]"), priority, min, max); return -1; } @@ -1634,7 +1629,7 @@ virProcessSetScheduler(pid_t pid, =20 if (sched_setscheduler(pid, pol, ¶m) < 0) { virReportSystemError(errno, - _("Cannot set scheduler parameters for pid %l= ld"), + _("Cannot set scheduler parameters for pid %1= $lld"), (long long) pid); return -1; } @@ -1827,7 +1822,7 @@ virProcessGetSchedInfo(unsigned long long *cpuWait, line =3D strchr(line, ':'); if (!line) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Missing separator in sched info '%s'"), + _("Missing separator in sched info '%1$s'"), lines[i]); return -1; } @@ -1837,7 +1832,7 @@ virProcessGetSchedInfo(unsigned long long *cpuWait, =20 if (virStrToDouble(line, NULL, &val) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to parse sched info value '%s'"), + _("Unable to parse sched info value '%1$s'"= ), line); return -1; } diff --git a/src/util/virrandom.c b/src/util/virrandom.c index e23ddf8e1d..73c5832a05 100644 --- a/src/util/virrandom.c +++ b/src/util/virrandom.c @@ -111,7 +111,7 @@ virRandomBytes(unsigned char *buf, =20 if ((rv =3D gnutls_rnd(GNUTLS_RND_RANDOM, buf, buflen)) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("failed to generate byte stream: %s"), + _("failed to generate byte stream: %1$s"), gnutls_strerror(rv)); return -1; } diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c index c46a78f113..1e98b111f2 100644 --- a/src/util/virresctrl.c +++ b/src/util/virresctrl.c @@ -614,7 +614,7 @@ virResctrlGetCacheInfo(virResctrlInfo *resctrl, =20 if (i_level->types[type]) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Duplicate cache type in resctrl for level %u= "), + _("Duplicate cache type in resctrl for level %1= $u"), level); return -1; } @@ -894,8 +894,7 @@ virResctrlInfoGetCache(virResctrlInfo *resctrl, } else { if (i_type->size !=3D size) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("level %u cache size %llu does not match " - "expected size %llu"), + _("level %1$u cache size %2$llu does not ma= tch expected size %3$llu"), level, i_type->size, size); goto error; } @@ -966,7 +965,7 @@ virResctrlInfoGetMonitorPrefix(virResctrlInfo *resctrl, =20 if (!mon) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Bad prefix name '%s' for resctrl monitor"), + _("Bad prefix name '%1$s' for resctrl monitor"), prefix); return -1; } @@ -1205,8 +1204,7 @@ virResctrlAllocSetCacheSize(virResctrlAlloc *alloc, { if (virResctrlAllocCheckCollision(alloc, level, type, cache)) { virReportError(VIR_ERR_XML_ERROR, - _("Colliding cache allocations for cache " - "level '%u' id '%u', type '%s'"), + _("Colliding cache allocations for cache level '%1$= u' id '%2$u', type '%3$s'"), level, cache, virCacheTypeToString(type)); return -1; } @@ -1290,7 +1288,7 @@ virResctrlAllocSetMemoryBandwidth(virResctrlAlloc *al= loc, =20 if (mem_bw->bandwidths[id]) { virReportError(VIR_ERR_XML_ERROR, - _("Memory Bandwidth already defined for node %u"), + _("Memory Bandwidth already defined for node %1$u"), id); return -1; } @@ -1346,7 +1344,7 @@ virResctrlSetID(char **resctrlid, =20 if (*resctrlid) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Attempt to overwrite resctrlid=3D'%s' with id=3D= '%s'"), + _("Attempt to overwrite resctrlid=3D'%1$s' with id= =3D'%2$s'"), *resctrlid, id); return -1; } @@ -1421,19 +1419,19 @@ virResctrlAllocParseProcessMemoryBandwidth(virResct= rlInfo *resctrl, =20 if (virStrToLong_uip(mem_bw, NULL, 10, &id) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Invalid node id %u "), id); + _("Invalid node id %1$u "), id); return -1; } if (virStrToLong_uip(tmp, NULL, 10, &bandwidth) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Invalid bandwidth %u"), bandwidth); + _("Invalid bandwidth %1$u"), bandwidth); return -1; } if (bandwidth < resctrl->membw_info->min_bandwidth || id > resctrl->membw_info->max_id) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Missing or inconsistent resctrl info for " - "memory bandwidth node '%u'"), id); + _("Missing or inconsistent resctrl info for memory = bandwidth node '%1$u'"), + id); return -1; } if (alloc->mem_bw->nbandwidths <=3D id) { @@ -1576,7 +1574,7 @@ virResctrlAllocParseProcessCache(virResctrlInfo *resc= trl, =20 if (virStrToLong_uip(cache, NULL, 10, &cache_id) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Invalid cache id '%s'"), cache); + _("Invalid cache id '%1$s'"), cache); return -1; } =20 @@ -1589,8 +1587,7 @@ virResctrlAllocParseProcessCache(virResctrlInfo *resc= trl, !resctrl->levels[level] || !resctrl->levels[level]->types[type]) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Missing or inconsistent resctrl info for " - "level '%u' type '%s'"), + _("Missing or inconsistent resctrl info for level '= %1$u' type '%2$s'"), level, virCacheTypeToString(type)); return -1; } @@ -1632,7 +1629,7 @@ virResctrlAllocParseCacheLine(virResctrlInfo *resctrl, =20 if (virStrToLong_uip(line + 1, &line, 10, &level) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Cannot parse resctrl schema level '%s'"), + _("Cannot parse resctrl schema level '%1$s'"), line + 1); return -1; } @@ -1640,7 +1637,7 @@ virResctrlAllocParseCacheLine(virResctrlInfo *resctrl, type =3D virResctrlTypeFromString(line); if (type < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Cannot parse resctrl schema level '%s'"), + _("Cannot parse resctrl schema level '%1$s'"), line + 1); return -1; } @@ -1866,7 +1863,7 @@ virResctrlAllocGetUnused(virResctrlInfo *resctrl) =20 if (rv < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not read schemata file for group %s"), + _("Could not read schemata file for group %1$s"= ), ent->d_name); return NULL; } @@ -1912,7 +1909,7 @@ virResctrlAllocFindUnused(virResctrlAlloc *alloc, =20 if (cache >=3D f_type->nmasks) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Cache with id %u does not exists for level %d"), + _("Cache with id %1$u does not exists for level %2$= d"), cache, level); return -1; } @@ -1920,16 +1917,14 @@ virResctrlAllocFindUnused(virResctrlAlloc *alloc, f_mask =3D f_type->masks[cache]; if (!f_mask) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Cache level %d id %u does not support tuning for= " - "scope type '%s'"), + _("Cache level %1$d id %2$u does not support tuning= for scope type '%3$s'"), level, cache, virCacheTypeToString(type)); return -1; } =20 if (*size =3D=3D i_type->size) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Cache allocation for the whole cache is not " - "possible, specify size smaller than %llu"), + _("Cache allocation for the whole cache is not poss= ible, specify size smaller than %1$llu"), i_type->size); return -1; } @@ -1938,16 +1933,14 @@ virResctrlAllocFindUnused(virResctrlAlloc *alloc, =20 if (*size % i_type->control.granularity) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Cache allocation of size %llu is not " - "divisible by granularity %llu"), + _("Cache allocation of size %1$llu is not divisible= by granularity %2$llu"), *size, i_type->control.granularity); return -1; } =20 if (need_bits < i_type->min_cbm_bits) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Cache allocation of size %llu is smaller " - "than the minimum allowed allocation %llu"), + _("Cache allocation of size %1$llu is smaller than = the minimum allowed allocation %2$llu"), *size, i_type->control.granularity * i_type->min_cbm_bits); return -1; @@ -1985,9 +1978,7 @@ virResctrlAllocFindUnused(virResctrlAlloc *alloc, =20 if (last_pos < 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Not enough room for allocation of " - "%llu bytes for level %u cache %u " - "scope type '%s'"), + _("Not enough room for allocation of %1$llu bytes f= or level %2$u cache %3$u scope type '%4$s'"), *size, level, cache, virCacheTypeToString(type)); return -1; @@ -2028,25 +2019,21 @@ virResctrlAllocMemoryBandwidth(virResctrlInfo *resc= trl, =20 if (*(mem_bw_alloc->bandwidths[i]) % mem_bw_info->bandwidth_granul= arity) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Memory Bandwidth allocation of size " - "%u is not divisible by granularity %u"), + _("Memory Bandwidth allocation of size %1$u is = not divisible by granularity %2$u"), *(mem_bw_alloc->bandwidths[i]), mem_bw_info->bandwidth_granularity); return -1; } if (*(mem_bw_alloc->bandwidths[i]) < mem_bw_info->min_bandwidth) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Memory Bandwidth allocation of size " - "%u is smaller than the minimum " - "allowed allocation %u"), + _("Memory Bandwidth allocation of size %1$u is = smaller than the minimum allowed allocation %2$u"), *(mem_bw_alloc->bandwidths[i]), mem_bw_info->min_bandwidth); return -1; } if (i > mem_bw_info->max_id) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("bandwidth controller id %zd does not " - "exist, max controller id %u"), + _("bandwidth controller id %1$zd does not exist= , max controller id %2$u"), i, mem_bw_info->max_id); return -1; } @@ -2168,7 +2155,7 @@ virResctrlAllocAssign(virResctrlInfo *resctrl, =20 if (!f_level) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Cache level %d does not support tuning"), + _("Cache level %1$d does not support tuning"), level); return -1; } @@ -2183,8 +2170,7 @@ virResctrlAllocAssign(virResctrlInfo *resctrl, =20 if (!f_type) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Cache level %d does not support tuning f= or " - "scope type '%s'"), + _("Cache level %1$d does not support tuning= for scope type '%2$s'"), level, virCacheTypeToString(type)); return -1; } @@ -2210,8 +2196,8 @@ virResctrlDeterminePath(const char *parentpath, { if (!id) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Resctrl ID must be set before determining resctr= l " - "parentpath=3D'%s' prefix=3D'%s'"), parentpath, p= refix); + _("Resctrl ID must be set before determining resctr= l parentpath=3D'%1$s' prefix=3D'%2$s'"), + parentpath, prefix); return NULL; } =20 @@ -2225,7 +2211,7 @@ virResctrlAllocDeterminePath(virResctrlAlloc *alloc, { if (alloc->path) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Resctrl allocation path is already set to '%s'"), + _("Resctrl allocation path is already set to '%1$s'= "), alloc->path); return -1; } @@ -2258,7 +2244,7 @@ virResctrlCreateGroupPath(const char *path) =20 if (g_mkdir_with_parents(path, 0777) < 0) { virReportSystemError(errno, - _("Cannot create resctrl directory '%s'"), + _("Cannot create resctrl directory '%1$s'"), path); return -1; } @@ -2315,7 +2301,7 @@ virResctrlAllocCreate(virResctrlInfo *resctrl, if (virFileWriteStr(schemata_path, alloc_str, 0) < 0) { rmdir(alloc->path); virReportSystemError(errno, - _("Cannot write into schemata file '%s'"), + _("Cannot write into schemata file '%1$s'"), schemata_path); goto cleanup; } @@ -2346,7 +2332,7 @@ virResctrlAddPID(const char *path, =20 if (virFileWriteStr(tasks, pidstr, 0) < 0) { virReportSystemError(errno, - _("Cannot write pid in tasks file '%s'"), + _("Cannot write pid in tasks file '%1$s'"), tasks); return -1; } @@ -2383,7 +2369,7 @@ virResctrlAllocRemove(virResctrlAlloc *alloc) VIR_DEBUG("Removing resctrl allocation %s", alloc->path); if (rmdir(alloc->path) !=3D 0 && errno !=3D ENOENT) { ret =3D -errno; - VIR_ERROR(_("Unable to remove %s (%d)"), alloc->path, errno); + VIR_ERROR(_("Unable to remove %1$s (%2$d)"), alloc->path, errno); } =20 return ret; @@ -2438,7 +2424,7 @@ virResctrlMonitorDeterminePath(virResctrlMonitor *mon= itor, =20 if (monitor->path) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Resctrl monitor path is already set to '%s'"), + _("Resctrl monitor path is already set to '%1$s'"), monitor->path); return -1; } @@ -2530,7 +2516,7 @@ virResctrlMonitorRemove(virResctrlMonitor *monitor) VIR_DEBUG("Removing resctrl monitor path=3D%s", monitor->path); if (rmdir(monitor->path) !=3D 0 && errno !=3D ENOENT) { ret =3D -errno; - VIR_ERROR(_("Unable to remove %s (%d)"), monitor->path, errno); + VIR_ERROR(_("Unable to remove %1$s (%2$d)"), monitor->path, errno); } =20 return ret; @@ -2627,7 +2613,7 @@ virResctrlMonitorGetStats(virResctrlMonitor *monitor, ent->d_name, resources[i]); if (rv =3D=3D -2) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("File '%s/%s/%s' does not exist."), + _("File '%1$s/%2$s/%3$s' does not exist."), datapath, ent->d_name, resources[i]); } if (rv < 0) diff --git a/src/util/virrotatingfile.c b/src/util/virrotatingfile.c index d339e58e1c..b02a88c4b0 100644 --- a/src/util/virrotatingfile.c +++ b/src/util/virrotatingfile.c @@ -106,21 +106,21 @@ virRotatingFileWriterEntryNew(const char *path, =20 if ((entry->fd =3D open(path, O_CREAT|O_APPEND|O_WRONLY|O_CLOEXEC, mod= e)) < 0) { virReportSystemError(errno, - _("Unable to open file: %s"), path); + _("Unable to open file: %1$s"), path); goto error; } =20 entry->pos =3D lseek(entry->fd, 0, SEEK_END); if (entry->pos =3D=3D (off_t)-1) { virReportSystemError(errno, - _("Unable to determine current file offset: %= s"), + _("Unable to determine current file offset: %= 1$s"), path); goto error; } =20 if (fstat(entry->fd, &sb) < 0) { virReportSystemError(errno, - _("Unable to determine current file inode: %s= "), + _("Unable to determine current file inode: %1= $s"), path); goto error; } @@ -149,7 +149,7 @@ virRotatingFileReaderEntryNew(const char *path) if ((entry->fd =3D open(path, O_RDONLY|O_CLOEXEC)) < 0) { if (errno !=3D ENOENT) { virReportSystemError(errno, - _("Unable to open file: %s"), path); + _("Unable to open file: %1$s"), path); goto error; } } @@ -157,7 +157,7 @@ virRotatingFileReaderEntryNew(const char *path) if (entry->fd !=3D -1) { if (fstat(entry->fd, &sb) < 0) { virReportSystemError(errno, - _("Unable to determine current file inode= : %s"), + _("Unable to determine current file inode= : %1$s"), path); goto error; } @@ -183,7 +183,7 @@ virRotatingFileWriterDelete(virRotatingFileWriter *file) if (unlink(file->basepath) < 0 && errno !=3D ENOENT) { virReportSystemError(errno, - _("Unable to delete file %s"), + _("Unable to delete file %1$s"), file->basepath); return -1; } @@ -195,7 +195,7 @@ virRotatingFileWriterDelete(virRotatingFileWriter *file) if (unlink(oldpath) < 0 && errno !=3D ENOENT) { virReportSystemError(errno, - _("Unable to delete file %s"), + _("Unable to delete file %1$s"), oldpath); VIR_FREE(oldpath); return -1; @@ -240,7 +240,7 @@ virRotatingFileWriterNew(const char *path, =20 if (maxbackup > VIR_MAX_MAX_BACKUP) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Max backup %zu must be less than or equal to %d"= ), + _("Max backup %1$zu must be less than or equal to %= 2$d"), maxbackup, VIR_MAX_MAX_BACKUP); goto error; } @@ -287,7 +287,7 @@ virRotatingFileReaderNew(const char *path, =20 if (maxbackup > VIR_MAX_MAX_BACKUP) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Max backup %zu must be less than or equal to %d"= ), + _("Max backup %1$zu must be less than or equal to %= 2$d"), maxbackup, VIR_MAX_MAX_BACKUP); goto error; } @@ -368,7 +368,7 @@ virRotatingFileWriterRollover(virRotatingFileWriter *fi= le) if (unlink(file->basepath) < 0 && errno !=3D ENOENT) { virReportSystemError(errno, - _("Unable to remove %s"), + _("Unable to remove %1$s"), file->basepath); goto cleanup; } @@ -386,7 +386,7 @@ virRotatingFileWriterRollover(virRotatingFileWriter *fi= le) if (rename(thispath, nextpath) < 0 && errno !=3D ENOENT) { virReportSystemError(errno, - _("Unable to rename %s to %s"), + _("Unable to rename %1$s to %2$s"), thispath, nextpath); goto cleanup; } @@ -456,7 +456,7 @@ virRotatingFileWriterAppend(virRotatingFileWriter *file, if (towrite) { if (safewrite(file->entry->fd, buf, towrite) !=3D towrite) { virReportSystemError(errno, - _("Unable to write to file %s"), + _("Unable to write to file %1$s"), file->basepath); return -1; } @@ -520,7 +520,7 @@ virRotatingFileReaderSeek(virRotatingFileReader *file, ret =3D lseek(entry->fd, offset, SEEK_SET); if (ret =3D=3D (off_t)-1) { virReportSystemError(errno, - _("Unable to seek to inode %llu offset %l= lu"), + _("Unable to seek to inode %1$llu offset = %2$llu"), (unsigned long long)inode, (unsigned long= long)offset); return -1; } @@ -533,7 +533,7 @@ virRotatingFileReaderSeek(virRotatingFileReader *file, ret =3D lseek(file->entries[0]->fd, offset, SEEK_SET); if (ret =3D=3D (off_t)-1) { virReportSystemError(errno, - _("Unable to seek to inode %llu offset %llu"), + _("Unable to seek to inode %1$llu offset %2$l= lu"), (unsigned long long)inode, (unsigned long lon= g)offset); return -1; } @@ -576,7 +576,7 @@ virRotatingFileReaderConsume(virRotatingFileReader *fil= e, got =3D saferead(entry->fd, buf + ret, len); if (got < 0) { virReportSystemError(errno, - _("Unable to read from file %s"), + _("Unable to read from file %1$s"), entry->path); return -1; } diff --git a/src/util/virscsi.c b/src/util/virscsi.c index 6a90d9002f..3d2c77e3b8 100644 --- a/src/util/virscsi.c +++ b/src/util/virscsi.c @@ -93,7 +93,7 @@ virSCSIDeviceGetAdapterId(const char *adapter, NULL, 0, adapter_id) =3D=3D 0) return 0; virReportError(VIR_ERR_INTERNAL_ERROR, - _("Cannot parse adapter '%s'"), adapter); + _("Cannot parse adapter '%1$s'"), adapter); return -1; } =20 @@ -195,7 +195,7 @@ virSCSIDeviceNew(const char *sysfs_prefix, =20 if (!virFileExists(dev->sg_path)) { virReportSystemError(errno, - _("SCSI device '%s': could not access %s"), + _("SCSI device '%1$s': could not access %2$s"= ), dev->name, dev->sg_path); return NULL; } @@ -353,7 +353,7 @@ virSCSIDeviceListAdd(virSCSIDeviceList *list, { if (virSCSIDeviceListFind(list, dev)) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Device %s already exists"), + _("Device %1$s already exists"), dev->name); return -1; } diff --git a/src/util/virscsihost.c b/src/util/virscsihost.c index 32d7f2312f..09023f5c83 100644 --- a/src/util/virscsihost.c +++ b/src/util/virscsihost.c @@ -176,14 +176,14 @@ virSCSIHostGetNumber(const char *adapter_name, adapter_name +=3D strlen("host"); } else { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Invalid adapter name '%s' for SCSI pool"), + _("Invalid adapter name '%1$s' for SCSI pool"), adapter_name); return -1; } =20 if (virStrToLong_ui(adapter_name, NULL, 10, result) =3D=3D -1) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Invalid adapter name '%s' for SCSI pool"), + _("Invalid adapter name '%1$s' for SCSI pool"), adapter_name); return -1; } @@ -218,8 +218,7 @@ virSCSIHostGetNameByParentaddr(unsigned int domain, function); if (!(name =3D virSCSIHostFindByPCI(NULL, parentaddr, unique_id))) { virReportError(VIR_ERR_XML_ERROR, - _("Failed to find scsi_host using PCI '%s' " - "and unique_id=3D'%u'"), + _("Failed to find scsi_host using PCI '%1$s' and un= ique_id=3D'%2$u'"), parentaddr, unique_id); return NULL; } diff --git a/src/util/virscsivhost.c b/src/util/virscsivhost.c index 1ea6a1ee2a..15024d7106 100644 --- a/src/util/virscsivhost.c +++ b/src/util/virscsivhost.c @@ -80,7 +80,7 @@ virSCSIVHostOpenVhostSCSI(int *vhostfd) { if (!virFileExists(VHOST_SCSI_DEVICE)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("vhost-scsi device file '%s' cannot be found"), + _("vhost-scsi device file '%1$s' cannot be found"), VHOST_SCSI_DEVICE); return -1; } @@ -88,7 +88,7 @@ virSCSIVHostOpenVhostSCSI(int *vhostfd) *vhostfd =3D open(VHOST_SCSI_DEVICE, O_RDWR); =20 if (*vhostfd < 0) { - virReportSystemError(errno, _("Failed to open %s"), VHOST_SCSI_DEV= ICE); + virReportSystemError(errno, _("Failed to open %1$s"), VHOST_SCSI_D= EVICE); return -1; } =20 @@ -174,7 +174,7 @@ virSCSIVHostDeviceListAdd(virSCSIVHostDeviceList *list, { if (virSCSIVHostDeviceListFind(list, dev)) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Device %s is already in use"), dev->name); + _("Device %1$s is already in use"), dev->name); return -1; } VIR_APPEND_ELEMENT(list->devs, list->count, dev); diff --git a/src/util/virsecret.c b/src/util/virsecret.c index f2c13e27c9..b558aa1d61 100644 --- a/src/util/virsecret.c +++ b/src/util/virsecret.c @@ -84,7 +84,7 @@ virSecretLookupParseSecret(xmlNodePtr secretnode, if (uuid) { if (virUUIDParse(uuid, def->u.uuid) < 0) { virReportError(VIR_ERR_XML_ERROR, - _("invalid secret uuid '%s'"), uuid); + _("invalid secret uuid '%1$s'"), uuid); return -1; } def->type =3D VIR_SECRET_LOOKUP_TYPE_UUID; @@ -165,8 +165,7 @@ virSecretGetSecretString(virConnectPtr conn, =20 virUUIDFormat(seclookupdef->u.uuid, uuidstr); virReportError(VIR_ERR_INVALID_ARG, - _("secret with uuid %s is of type '%s' not " - "expected '%s' type"), + _("secret with uuid %1$s is of type '%2$s' not expe= cted '%3$s' type"), uuidstr, virSecretUsageTypeToString(sec->usageType), virSecretUsageTypeToString(secretUsageType)); return -1; diff --git a/src/util/virsocketaddr.c b/src/util/virsocketaddr.c index 0480485ab7..43511bdd69 100644 --- a/src/util/virsocketaddr.c +++ b/src/util/virsocketaddr.c @@ -107,7 +107,7 @@ virSocketAddrParseInternal(struct addrinfo **res, if ((err =3D getaddrinfo(val, NULL, &hints, res)) !=3D 0) { if (reportError) virReportError(VIR_ERR_SYSTEM_ERROR, - _("Cannot parse socket address '%s': %s"), + _("Cannot parse socket address '%1$s': %2$s"), val, gai_strerror(err)); =20 return -1; @@ -137,7 +137,7 @@ int virSocketAddrParse(virSocketAddr *addr, const char = *val, int family) =20 if (res =3D=3D NULL) { virReportError(VIR_ERR_SYSTEM_ERROR, - _("No socket addresses found for '%s'"), + _("No socket addresses found for '%1$s'"), val); return -1; } @@ -182,7 +182,7 @@ int virSocketAddrParseAny(virSocketAddr *addr, if (res =3D=3D NULL) { if (reportError) { virReportError(VIR_ERR_SYSTEM_ERROR, - _("No socket addresses found for '%s'"), + _("No socket addresses found for '%1$s'"), val); } return -1; @@ -248,7 +248,7 @@ int virSocketAddrResolveService(const char *service) =20 if ((err =3D getaddrinfo(NULL, service, &hints, &res)) !=3D 0) { virReportError(VIR_ERR_SYSTEM_ERROR, - _("Cannot parse socket service '%s': %s"), + _("Cannot parse socket service '%1$s': %2$s"), service, gai_strerror(err)); return -1; } @@ -270,7 +270,7 @@ int virSocketAddrResolveService(const char *service) } =20 virReportError(VIR_ERR_SYSTEM_ERROR, - _("No matches for socket service '%s': %s"), + _("No matches for socket service '%1$s': %2$s"), service, gai_strerror(err)); =20 cleanup: @@ -484,7 +484,7 @@ virSocketAddrFormatFull(const virSocketAddr *addr, port, sizeof(port), NI_NUMERICHOST | NI_NUMERICSERV)) !=3D 0) { virReportError(VIR_ERR_SYSTEM_ERROR, - _("Cannot convert socket address to string: %s"), + _("Cannot convert socket address to string: %1$s"), gai_strerror(err)); return NULL; } @@ -871,7 +871,7 @@ virSocketAddrGetRange(virSocketAddr *start, virSocketAd= dr *end, =20 if (start =3D=3D NULL || end =3D=3D NULL) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("NULL argument - %p %p"), start, end); + _("NULL argument - %1$p %2$p"), start, end); return -1; } =20 @@ -882,7 +882,7 @@ virSocketAddrGetRange(virSocketAddr *start, virSocketAd= dr *end, =20 if (VIR_SOCKET_ADDR_FAMILY(start) !=3D VIR_SOCKET_ADDR_FAMILY(end)) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("mismatch of address family in range %s - %s"), + _("mismatch of address family in range %1$s - %2$s"= ), startStr, endStr); return -1; } @@ -896,8 +896,7 @@ virSocketAddrGetRange(virSocketAddr *start, virSocketAd= dr *end, =20 if (VIR_SOCKET_ADDR_FAMILY(start) !=3D VIR_SOCKET_ADDR_FAMILY(netw= ork)) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("mismatch of address family in " - "range %s - %s for network %s"), + _("mismatch of address family in range %1$s - %= 2$s for network %3$s"), startStr, endStr, netStr); return -1; } @@ -906,8 +905,7 @@ virSocketAddrGetRange(virSocketAddr *start, virSocketAd= dr *end, virSocketAddrPrefixToNetmask(prefix, &netmask, VIR_SOCKET_ADDR_FAMILY(network)) = < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("bad prefix %d for network %s when " - " checking range %s - %s"), + _("bad prefix %1$d for network %2$s when checki= ng range %3$s - %4$s"), prefix, netStr, startStr, endStr); return -1; } @@ -916,8 +914,7 @@ virSocketAddrGetRange(virSocketAddr *start, virSocketAd= dr *end, if (virSocketAddrCheckNetmask(start, network, &netmask) <=3D 0 || virSocketAddrCheckNetmask(end, network, &netmask) <=3D 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("range %s - %s is not entirely within " - "network %s/%d"), + _("range %1$s - %2$s is not entirely within net= work %3$s/%4$d"), startStr, endStr, netStr, prefix); return -1; } @@ -928,8 +925,7 @@ virSocketAddrGetRange(virSocketAddr *start, virSocketAd= dr *end, if (virSocketAddrBroadcast(network, &netmask, &broadcast) < 0 = || virSocketAddrMask(network, &netmask, &netaddr) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("failed to construct broadcast or network= " - "address for network %s/%d"), + _("failed to construct broadcast or network= address for network %1$s/%2$d"), netStr, prefix); return -1; } @@ -943,16 +939,14 @@ virSocketAddrGetRange(virSocketAddr *start, virSocket= Addr *end, */ if (virSocketAddrEqual(start, &netaddr)) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("start of range %s - %s in network %s/%d " - "is the network address"), + _("start of range %1$s - %2$s in network %3= $s/%4$d is the network address"), startStr, endStr, netStr, prefix); return -1; } =20 if (virSocketAddrEqual(end, &broadcast)) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("end of range %s - %s in network %s/%d " - "is the broadcast address"), + _("end of range %1$s - %2$s in network %3$s= /%4$d is the broadcast address"), startStr, endStr, netStr, prefix); return -1; } @@ -965,8 +959,7 @@ virSocketAddrGetRange(virSocketAddr *start, virSocketAd= dr *end, if (virSocketAddrGetIPv4Addr(start, &t1) < 0 || virSocketAddrGetIPv4Addr(end, &t2) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("failed to get IPv4 address " - "for start or end of range %s - %s"), + _("failed to get IPv4 address for start or end = of range %1$s - %2$s"), startStr, endStr); return -1; } @@ -977,7 +970,7 @@ virSocketAddrGetRange(virSocketAddr *start, virSocketAd= dr *end, for (i =3D 0; i < 2; i++) { if (t1[i] !=3D t2[i]) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("range %s - %s is too large (> 65535)"), + _("range %1$s - %2$s is too large (> 65535)= "), startStr, endStr); return -1; } @@ -985,7 +978,7 @@ virSocketAddrGetRange(virSocketAddr *start, virSocketAd= dr *end, ret =3D (t2[2] - t1[2]) * 256 + (t2[3] - t1[3]); if (ret < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("range %s - %s is reversed "), + _("range %1$s - %2$s is reversed "), startStr, endStr); return -1; } @@ -996,8 +989,7 @@ virSocketAddrGetRange(virSocketAddr *start, virSocketAd= dr *end, if (virSocketAddrGetIPv6Addr(start, &t1) < 0 || virSocketAddrGetIPv6Addr(end, &t2) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("failed to get IPv6 address " - "for start or end of range %s - %s"), + _("failed to get IPv6 address for start or end = of range %1$s - %2$s"), startStr, endStr); return -1; } @@ -1008,7 +1000,7 @@ virSocketAddrGetRange(virSocketAddr *start, virSocket= Addr *end, for (i =3D 0; i < 7; i++) { if (t1[i] !=3D t2[i]) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("range %s - %s is too large (> 65535)"), + _("range %1$s - %2$s is too large (> 65535)= "), startStr, endStr); return -1; } @@ -1016,15 +1008,14 @@ virSocketAddrGetRange(virSocketAddr *start, virSock= etAddr *end, ret =3D t2[7] - t1[7]; if (ret < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("range %s - %s start larger than end"), + _("range %1$s - %2$s start larger than end"), startStr, endStr); return -1; } ret++; } else { virReportError(VIR_ERR_INTERNAL_ERROR, - _("unsupported address family " - "for range %s - %s, must be ipv4 or ipv6"), + _("unsupported address family for range %1$s - %2$s= , must be ipv4 or ipv6"), startStr, endStr); return -1; } diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index 873da65d42..031baa1407 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@ -90,7 +90,7 @@ int virStorageFileGetSCSIKey(const char *path, bool ignoreError) { if (!ignoreError) - virReportSystemError(ENOSYS, _("Unable to get SCSI key for %s"), p= ath); + virReportSystemError(ENOSYS, _("Unable to get SCSI key for %1$s"),= path); return -1; } #endif diff --git a/src/util/virstring.c b/src/util/virstring.c index 7b7aee6179..b49c0f86b6 100644 --- a/src/util/virstring.c +++ b/src/util/virstring.c @@ -598,13 +598,13 @@ virStringSearch(const char *str, regex =3D g_regex_new(regexp, 0, 0, &err); if (!regex) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to compile regex %s"), err->message); + _("Failed to compile regex %1$s"), err->message); return -1; } =20 if (g_regex_get_capture_count(regex) !=3D 1) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Regular expression '%s' must have exactly 1 matc= h group, not %d"), + _("Regular expression '%1$s' must have exactly 1 ma= tch group, not %2$d"), regexp, g_regex_get_capture_count(regex)); goto cleanup; } @@ -982,13 +982,13 @@ virStringParsePort(const char *str, =20 if (virStrToLong_uip(str, NULL, 10, &p) < 0) { virReportError(VIR_ERR_INVALID_ARG, - _("failed to parse port number '%s'"), str); + _("failed to parse port number '%1$s'"), str); return -1; } =20 if (p > UINT16_MAX) { virReportError(VIR_ERR_INVALID_ARG, - _("port '%s' out of range"), str); + _("port '%1$s' out of range"), str); return -1; } =20 diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c index 376d5d4816..36a861c53f 100644 --- a/src/util/virsysinfo.c +++ b/src/util/virsysinfo.c @@ -319,7 +319,7 @@ virSysinfoReadPPC(void) =20 if (virFileReadAll(CPUINFO, CPUINFO_FILE_LEN, &outbuf) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to open %s"), CPUINFO); + _("Failed to open %1$s"), CPUINFO); return NULL; } =20 @@ -445,7 +445,7 @@ virSysinfoReadARM(void) =20 if (virFileReadAll(CPUINFO, CPUINFO_FILE_LEN, &outbuf) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to open %s"), CPUINFO); + _("Failed to open %1$s"), CPUINFO); return NULL; } =20 @@ -600,7 +600,7 @@ virSysinfoReadS390(void) /* Gather info from /proc/cpuinfo */ if (virFileReadAll(CPUINFO, CPUINFO_FILE_LEN, &outbuf) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to open %s"), CPUINFO); + _("Failed to open %1$s"), CPUINFO); return NULL; } =20 @@ -613,7 +613,7 @@ virSysinfoReadS390(void) /* Gather info from /proc/sysinfo */ if (virFileReadAll(SYSINFO, 8192, &outbuf) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to open %s"), SYSINFO); + _("Failed to open %1$s"), SYSINFO); return NULL; } =20 @@ -1537,7 +1537,7 @@ virSysinfoFormat(virBuffer *buf, virSysinfoDef *def) =20 if (!type) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected sysinfo type model %d"), + _("unexpected sysinfo type model %1$d"), def->type); return -1; } @@ -1564,7 +1564,7 @@ virSysinfoFormat(virBuffer *buf, virSysinfoDef *def) do { \ if (STRNEQ_NULLABLE(src->name, dst->name)) { \ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, \ - _("Target sysinfo %s %s does not match source %= s"), \ + _("Target sysinfo %1$s %2$s does not match sour= ce %3$s"), \ desc, NULLSTR(dst->name), NULLSTR(src->name)); \ return false; \ } \ @@ -1680,7 +1680,7 @@ bool virSysinfoIsEqual(virSysinfoDef *src, =20 if (src->type !=3D dst->type) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Target sysinfo %s does not match source %s"), + _("Target sysinfo %1$s does not match source %2$s"), virSysinfoTypeToString(dst->type), virSysinfoTypeToString(src->type)); return false; @@ -1694,7 +1694,7 @@ bool virSysinfoIsEqual(virSysinfoDef *src, =20 if (src->nbaseBoard !=3D dst->nbaseBoard) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Target sysinfo base board count '%zu' does not m= atch source '%zu'"), + _("Target sysinfo base board count '%1$zu' does not= match source '%2$zu'"), dst->nbaseBoard, src->nbaseBoard); return false; } diff --git a/src/util/virsystemd.c b/src/util/virsystemd.c index 18bf2932a4..3112a1ba80 100644 --- a/src/util/virsystemd.c +++ b/src/util/virsystemd.c @@ -766,7 +766,7 @@ virSystemdActivationInitFromNames(virSystemdActivation = *act, =20 if (g_strv_length(fdnamelistptr) !=3D nfds) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Expecting %d FD names but got %u"), + _("Expecting %1$d FD names but got %2$u"), nfds, g_strv_length(fdnamelistptr)); goto error; } diff --git a/src/util/virthreadjob.c b/src/util/virthreadjob.c index 2c6f45fd51..3666cf9fe2 100644 --- a/src/util/virthreadjob.c +++ b/src/util/virthreadjob.c @@ -69,7 +69,7 @@ virThreadJobSetWorker(const char *worker) =20 if (virThreadLocalSet(&virThreadJobWorker, (void *) worker) < 0) virReportSystemError(errno, - _("cannot set worker name to %s"), + _("cannot set worker name to %1$s"), worker); =20 VIR_DEBUG("Thread %llu is running worker %s", virThreadSelfID(), worke= r); @@ -86,7 +86,7 @@ virThreadJobSet(const char *caller) =20 if (virThreadLocalSet(&virThreadJobName, (void *) caller) < 0) virReportSystemError(errno, - _("cannot set current job to %s"), + _("cannot set current job to %1$s"), caller); =20 if ((worker =3D virThreadLocalGet(&virThreadJobWorker))) { diff --git a/src/util/virtpm.c b/src/util/virtpm.c index 19850de1c8..81fd6166cf 100644 --- a/src/util/virtpm.c +++ b/src/util/virtpm.c @@ -72,7 +72,7 @@ virTPMCreateCancelPath(const char *devpath) =20 if (!(dev =3D strrchr(devpath, '/'))) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("TPM device path %s is invalid"), devpath); + _("TPM device path %1$s is invalid"), devpath); return NULL; } =20 @@ -243,7 +243,7 @@ virTPMExecGetCaps(virCommand *cmd, =20 error_bad_json: virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unexpected JSON format: %s"), outbuf); + _("Unexpected JSON format: %1$s"), outbuf); return bitmap; } =20 @@ -296,21 +296,21 @@ virTPMEmulatorInit(bool quiet) if (!path) { if (!quiet) virReportSystemError(ENOENT, - _("Unable to find '%s' binary in = $PATH"), + _("Unable to find '%1$s' binary i= n $PATH"), virTPMBinaryTypeToString(i)); return -1; } if (!virFileIsExecutable(path)) { if (!quiet) virReportError(VIR_ERR_INTERNAL_ERROR, - _("%s is not an executable"), + _("%1$s is not an executable"), path); return -1; } if (stat(path, &swtpmBinaries[i].stat) < 0) { if (!quiet) virReportSystemError(errno, - _("Could not stat %s"), path); + _("Could not stat %1$s"), path); return -1; } swtpmBinaries[i].path =3D g_steal_pointer(&path); diff --git a/src/util/virtypedparam-public.c b/src/util/virtypedparam-publi= c.c index 5bd207d1e6..3486623a9c 100644 --- a/src/util/virtypedparam-public.c +++ b/src/util/virtypedparam-public.c @@ -35,13 +35,13 @@ virTypedParameterAssignFromStr(virTypedParameterPtr par= am, const char *val) { if (!val) { - virReportError(VIR_ERR_INVALID_ARG, _("NULL value for field '%s'"), + virReportError(VIR_ERR_INVALID_ARG, _("NULL value for field '%1$s'= "), name); return -1; } =20 if (virStrcpyStatic(param->field, name) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, _("Field name '%s' too long= "), + virReportError(VIR_ERR_INTERNAL_ERROR, _("Field name '%1$s' too lo= ng"), name); return -1; } @@ -51,7 +51,7 @@ virTypedParameterAssignFromStr(virTypedParameterPtr param, case VIR_TYPED_PARAM_INT: if (virStrToLong_i(val, NULL, 10, ¶m->value.i) < 0) { virReportError(VIR_ERR_INVALID_ARG, - _("Invalid value for field '%s': expected int"), + _("Invalid value for field '%1$s': expected int= "), name); return -1; } @@ -59,8 +59,7 @@ virTypedParameterAssignFromStr(virTypedParameterPtr param, case VIR_TYPED_PARAM_UINT: if (virStrToLong_ui(val, NULL, 10, ¶m->value.ui) < 0) { virReportError(VIR_ERR_INVALID_ARG, - _("Invalid value for field '%s': " - "expected unsigned int"), + _("Invalid value for field '%1$s': expected uns= igned int"), name); return -1; } @@ -68,8 +67,7 @@ virTypedParameterAssignFromStr(virTypedParameterPtr param, case VIR_TYPED_PARAM_LLONG: if (virStrToLong_ll(val, NULL, 10, ¶m->value.l) < 0) { virReportError(VIR_ERR_INVALID_ARG, - _("Invalid value for field '%s': " - "expected long long"), + _("Invalid value for field '%1$s': expected lon= g long"), name); return -1; } @@ -77,8 +75,7 @@ virTypedParameterAssignFromStr(virTypedParameterPtr param, case VIR_TYPED_PARAM_ULLONG: if (virStrToLong_ull(val, NULL, 10, ¶m->value.ul) < 0) { virReportError(VIR_ERR_INVALID_ARG, - _("Invalid value for field '%s': " - "expected unsigned long long"), + _("Invalid value for field '%1$s': expected uns= igned long long"), name); return -1; } @@ -86,8 +83,7 @@ virTypedParameterAssignFromStr(virTypedParameterPtr param, case VIR_TYPED_PARAM_DOUBLE: if (virStrToDouble(val, NULL, ¶m->value.d) < 0) { virReportError(VIR_ERR_INVALID_ARG, - _("Invalid value for field '%s': " - "expected double"), + _("Invalid value for field '%1$s': expected dou= ble"), name); return -1; } @@ -99,7 +95,7 @@ virTypedParameterAssignFromStr(virTypedParameterPtr param, param->value.b =3D false; } else { virReportError(VIR_ERR_INVALID_ARG, - _("Invalid boolean value for field '%s'"), name= ); + _("Invalid boolean value for field '%1$s'"), na= me); return -1; } break; @@ -108,7 +104,7 @@ virTypedParameterAssignFromStr(virTypedParameterPtr par= am, break; default: virReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected type %d for field %s"), type, name); + _("unexpected type %1$d for field %2$s"), type, nam= e); return -1; } =20 @@ -154,8 +150,7 @@ virTypedParamsGet(virTypedParameterPtr params, #define VIR_TYPED_PARAM_CHECK_TYPE(check_type) \ do { if (param->type !=3D check_type) { \ virReportError(VIR_ERR_INVALID_ARG, \ - _("Invalid type '%s' requested for parameter '%s', = " \ - "actual type is '%s'"), \ + _("Invalid type '%1$s' requested for parameter '%2$= s', actual type is '%3$s'"), \ virTypedParameterTypeToString(check_type), \ name, \ virTypedParameterTypeToString(param->type)); \ diff --git a/src/util/virtypedparam.c b/src/util/virtypedparam.c index ae676d02fe..e6ad9ec7a9 100644 --- a/src/util/virtypedparam.c +++ b/src/util/virtypedparam.c @@ -81,7 +81,7 @@ virTypedParamsValidate(virTypedParameterPtr params, int n= params, ...) =20 if (virStrcpyStatic(keys[nkeys].field, name) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Field name '%s' too long"), name); + _("Field name '%1$s' too long"), name); goto cleanup; } =20 @@ -102,7 +102,7 @@ virTypedParamsValidate(virTypedParameterPtr params, int= nparams, ...) if (STREQ_NULLABLE(last_name, sorted[i].field) && !(keys[j].value.i & VIR_TYPED_PARAM_MULTIPLE)) { virReportError(VIR_ERR_INVALID_ARG, - _("parameter '%s' occurs multiple times"), + _("parameter '%1$s' occurs multiple times"), sorted[i].field); goto cleanup; } @@ -113,8 +113,7 @@ virTypedParamsValidate(virTypedParameterPtr params, int= nparams, ...) if (!badtype) badtype =3D virTypedParameterTypeToString(0); virReportError(VIR_ERR_INVALID_ARG, - _("invalid type '%s' for parameter '%s', " - "expected '%s'"), + _("invalid type '%1$s' for parameter '%2$s'= , expected '%3$s'"), badtype, sorted[i].field, virTypedParameterTypeToString(keys[j].type)= ); goto cleanup; @@ -126,7 +125,7 @@ virTypedParamsValidate(virTypedParameterPtr params, int= nparams, ...) =20 if (j =3D=3D nkeys && i !=3D nparams) { virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, - _("parameter '%s' not supported"), + _("parameter '%1$s' not supported"), sorted[i].field); goto cleanup; } @@ -195,7 +194,7 @@ virTypedParameterToString(virTypedParameterPtr param) break; default: virReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected type %d for field %s"), + _("unexpected type %1$d for field %2$s"), param->type, param->field); } =20 @@ -241,7 +240,7 @@ virTypedParameterAssignValueVArgs(virTypedParameterPtr = param, break; default: virReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected type %d for field %s"), type, + _("unexpected type %1$d for field %2$s"), type, NULLSTR(param->field)); return -1; } @@ -279,7 +278,7 @@ virTypedParameterAssign(virTypedParameterPtr param, con= st char *name, int ret =3D -1; =20 if (virStrcpyStatic(param->field, name) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, _("Field name '%s' too long= "), + virReportError(VIR_ERR_INTERNAL_ERROR, _("Field name '%1$s' too lo= ng"), name); return -1; } @@ -322,7 +321,7 @@ virTypedParamsReplaceString(virTypedParameterPtr *param= s, if (param) { if (param->type !=3D VIR_TYPED_PARAM_STRING) { virReportError(VIR_ERR_INVALID_ARG, - _("Parameter '%s' is not a string"), + _("Parameter '%1$s' is not a string"), param->field); return -1; } @@ -529,7 +528,7 @@ virTypedParamsDeserialize(struct _virTypedParameterRemo= te *remote_params, =20 if (limit && remote_params_len > limit) { virReportError(VIR_ERR_RPC, - _("too many parameters '%u' for limit '%d'"), + _("too many parameters '%1$u' for limit '%2$d'"), remote_params_len, limit); goto cleanup; } @@ -538,7 +537,7 @@ virTypedParamsDeserialize(struct _virTypedParameterRemo= te *remote_params, /* Check the length of the returned list carefully. */ if (remote_params_len > *nparams) { virReportError(VIR_ERR_RPC, - _("too many parameters '%u' for nparams '%d'"), + _("too many parameters '%1$u' for nparams '%2$d= '"), remote_params_len, *nparams); goto cleanup; } @@ -555,7 +554,7 @@ virTypedParamsDeserialize(struct _virTypedParameterRemo= te *remote_params, if (virStrcpyStatic(param->field, remote_param->field) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("parameter %s too big for destination"), + _("parameter %1$s too big for destination"), remote_param->field); goto cleanup; } @@ -590,7 +589,7 @@ virTypedParamsDeserialize(struct _virTypedParameterRemo= te *remote_params, param->value.s =3D g_strdup(remote_param->value.remote_typed_p= aram_value.s); break; default: - virReportError(VIR_ERR_RPC, _("unknown parameter type: %d"), + virReportError(VIR_ERR_RPC, _("unknown parameter type: %1$d"), param->type); goto cleanup; } @@ -648,7 +647,7 @@ virTypedParamsSerialize(virTypedParameterPtr params, =20 if (nparams > limit) { virReportError(VIR_ERR_RPC, - _("too many parameters '%d' for limit '%d'"), + _("too many parameters '%1$d' for limit '%2$d'"), nparams, limit); goto cleanup; } @@ -695,7 +694,7 @@ virTypedParamsSerialize(virTypedParameterPtr params, val->value.remote_typed_param_value.s =3D g_strdup(param->valu= e.s); break; default: - virReportError(VIR_ERR_RPC, _("unknown parameter type: %d"), + virReportError(VIR_ERR_RPC, _("unknown parameter type: %1$d"), param->type); goto cleanup; } diff --git a/src/util/viruri.c b/src/util/viruri.c index 3af2e54565..a824a983df 100644 --- a/src/util/viruri.c +++ b/src/util/viruri.c @@ -146,7 +146,7 @@ virURIParse(const char *uri) if (!xmluri) { /* libxml2 does not tell us what failed. Grr :-( */ virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to parse URI %s"), uri); + _("Unable to parse URI %1$s"), uri); return NULL; } =20 @@ -302,16 +302,15 @@ virURIFindAliasMatch(char *const*aliases, const char = *alias, =20 if (!(offset =3D strchr(*aliases, '=3D'))) { virReportError(VIR_ERR_CONF_SYNTAX, - _("Malformed 'uri_aliases' config entry '%s', " - "expected 'alias=3Duri://host/path'"), *alias= es); + _("Malformed 'uri_aliases' config entry '%1$s',= expected 'alias=3Duri://host/path'"), + *aliases); return -1; } =20 safe =3D strspn(*aliases, URI_ALIAS_CHARS); if (safe < (offset - *aliases)) { virReportError(VIR_ERR_CONF_SYNTAX, - _("Malformed 'uri_aliases' config entry '%s', " - "aliases may only contain 'a-Z, 0-9, _, -'"), + _("Malformed 'uri_aliases' config entry '%1$s',= aliases may only contain 'a-Z, 0-9, _, -'"), *aliases); return -1; } @@ -387,7 +386,7 @@ virURIGetParam(virURI *uri, const char *name) } =20 virReportError(VIR_ERR_INVALID_ARG, - _("Missing URI parameter '%s'"), name); + _("Missing URI parameter '%1$s'"), name); return NULL; } =20 diff --git a/src/util/virusb.c b/src/util/virusb.c index 9e6ec9c9cf..cf3461f80a 100644 --- a/src/util/virusb.c +++ b/src/util/virusb.c @@ -95,7 +95,7 @@ static int virUSBSysReadFile(const char *f_name, const ch= ar *d_name, =20 if (virStrToLong_ui(buf, &ignore, base, value) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not parse usb file %s"), filename); + _("Could not parse usb file %1$s"), filename); return -1; } =20 @@ -145,7 +145,7 @@ virUSBDeviceSearch(unsigned int vendor, =20 if (virStrToLong_ui(tmpstr, &ignore, 10, &found_bus) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to parse dir name '%s'"), + _("Failed to parse dir name '%1$s'"), de->d_name); goto cleanup; } @@ -211,7 +211,7 @@ virUSBDeviceFindByVendor(unsigned int vendor, } =20 virReportError(VIR_ERR_INTERNAL_ERROR, - _("Did not find USB device %04x:%04x"), vendor, pro= duct); + _("Did not find USB device %1$04x:%2$04x"), vendor,= product); return -1; } =20 @@ -249,7 +249,7 @@ virUSBDeviceFindByBus(unsigned int bus, } =20 virReportError(VIR_ERR_INTERNAL_ERROR, - _("Did not find USB device bus:%u device:%u"), + _("Did not find USB device bus:%1$u device:%2$u"), bus, devno); return -1; } @@ -290,7 +290,7 @@ virUSBDeviceFind(unsigned int vendor, } =20 virReportError(VIR_ERR_INTERNAL_ERROR, - _("Did not find USB device %04x:%04x bus:%u device:= %u"), + _("Did not find USB device %1$04x:%2$04x bus:%3$u d= evice:%4$u"), vendor, product, bus, devno); return -1; } @@ -319,7 +319,7 @@ virUSBDeviceNew(unsigned int bus, if (g_snprintf(dev->name, sizeof(dev->name), "%.3d:%.3d", dev->bus, dev->dev) >=3D sizeof(dev->name)) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("dev->name buffer overflow: %.3d:%.3d"), + _("dev->name buffer overflow: %1$.3d:%2$.3d"), dev->bus, dev->dev); virUSBDeviceFree(dev); return NULL; @@ -337,7 +337,7 @@ virUSBDeviceNew(unsigned int bus, if (g_snprintf(dev->id, sizeof(dev->id), "%d %d", dev->bus, dev->dev) >=3D sizeof(dev->id)) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("dev->id buffer overflow: %d %d"), + _("dev->id buffer overflow: %1$d %2$d"), dev->bus, dev->dev); virUSBDeviceFree(dev); return NULL; @@ -443,7 +443,7 @@ virUSBDeviceListAdd(virUSBDeviceList *list, { if (virUSBDeviceListFind(list, *dev)) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Device %s is already in use"), + _("Device %1$s is already in use"), (*dev)->name); return -1; } diff --git a/src/util/virutil.c b/src/util/virutil.c index ddc66001cb..40ca205595 100644 --- a/src/util/virutil.c +++ b/src/util/virutil.c @@ -173,7 +173,7 @@ virScaleInteger(unsigned long long *value, const char *= suffix, if (!suffix || !*suffix) { if (!scale) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("invalid scale %llu"), scale); + _("invalid scale %1$llu"), scale); return -1; } suffix =3D ""; @@ -189,7 +189,7 @@ virScaleInteger(unsigned long long *value, const char *= suffix, base =3D 1000; } else { virReportError(VIR_ERR_INVALID_ARG, - _("unknown suffix '%s'"), suffix); + _("unknown suffix '%1$s'"), suffix); return -1; } scale =3D 1; @@ -214,13 +214,13 @@ virScaleInteger(unsigned long long *value, const char= *suffix, break; default: virReportError(VIR_ERR_INVALID_ARG, - _("unknown suffix '%s'"), suffix); + _("unknown suffix '%1$s'"), suffix); return -1; } } =20 if (*value && *value > (limit / scale)) { - virReportError(VIR_ERR_OVERFLOW, _("value too large: %llu%s"), + virReportError(VIR_ERR_OVERFLOW, _("value too large: %1$llu%2$s"), *value, suffix); return -1; } @@ -575,7 +575,7 @@ virGetUserEnt(uid_t uid, char **name, gid_t *group, cha= r **dir, char **shell, bo goto cleanup; =20 virReportSystemError(rc, - _("Failed to find user record for uid '%u'"), + _("Failed to find user record for uid '%1$u'"= ), (unsigned int) uid); goto cleanup; } else if (pw =3D=3D NULL) { @@ -583,7 +583,7 @@ virGetUserEnt(uid_t uid, char **name, gid_t *group, cha= r **dir, char **shell, bo goto cleanup; =20 virReportError(VIR_ERR_SYSTEM_ERROR, - _("Failed to find user record for uid '%u'"), + _("Failed to find user record for uid '%1$u'"), (unsigned int) uid); goto cleanup; } @@ -640,11 +640,11 @@ static char *virGetGroupEnt(gid_t gid) if (rc !=3D 0 || gr =3D=3D NULL) { if (rc !=3D 0) { virReportSystemError(rc, - _("Failed to find group record for gid '%= u'"), + _("Failed to find group record for gid '%= 1$u'"), (unsigned int) gid); } else { virReportError(VIR_ERR_SYSTEM_ERROR, - _("Failed to find group record for gid '%u'"), + _("Failed to find group record for gid '%1$u'"), (unsigned int) gid); } =20 @@ -757,7 +757,7 @@ virGetUserID(const char *user, uid_t *uid) =20 if (virStrToLong_ui(user, NULL, 10, &uint_uid) < 0 || ((uid_t) uint_uid) !=3D uint_uid) { - virReportError(VIR_ERR_INVALID_ARG, _("Failed to parse user '%s'"), + virReportError(VIR_ERR_INVALID_ARG, _("Failed to parse user '%1$s'= "), user); return -1; } @@ -837,7 +837,7 @@ virGetGroupID(const char *group, gid_t *gid) =20 if (virStrToLong_ui(group, NULL, 10, &uint_gid) < 0 || ((gid_t) uint_gid) !=3D uint_gid) { - virReportError(VIR_ERR_INVALID_ARG, _("Failed to parse group '%s'"= ), + virReportError(VIR_ERR_INVALID_ARG, _("Failed to parse group '%1$s= '"), group); return -1; } @@ -950,7 +950,7 @@ virSetUIDGID(uid_t uid, gid_t gid, gid_t *groups G_GNUC= _UNUSED, { if (gid !=3D (gid_t)-1 && setregid(gid, gid) < 0) { virReportSystemError(errno, - _("cannot change to '%u' group"), + _("cannot change to '%1$u' group"), (unsigned int) gid); return -1; } @@ -965,7 +965,7 @@ virSetUIDGID(uid_t uid, gid_t gid, gid_t *groups G_GNUC= _UNUSED, =20 if (uid !=3D (uid_t)-1 && setreuid(uid, uid) < 0) { virReportSystemError(errno, - _("cannot change to uid to '%u'"), + _("cannot change to uid to '%1$u'"), (unsigned int) uid); return -1; } @@ -1161,7 +1161,7 @@ virSetUIDGIDWithCaps(uid_t uid, gid_t gid, gid_t *gro= ups, int ngroups, capng_clear(CAPNG_SELECT_CAPS); } else { virReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot apply process capabilities %d"), capn= g_ret); + _("cannot apply process capabilities %1$d"), ca= png_ret); return -1; } } @@ -1188,8 +1188,7 @@ virSetUIDGIDWithCaps(uid_t uid, gid_t gid, gid_t *gro= ups, int ngroups, if (capBits & (1ULL << i)) { if (prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_RAISE, i, 0, 0) < 0) { virReportSystemError(errno, - _("prctl failed to enable '%s' in the= " - "AMBIENT set"), + _("prctl failed to enable '%1$s' in t= he AMBIENT set"), capstr); return -1; } @@ -1215,7 +1214,7 @@ virSetUIDGIDWithCaps(uid_t uid, gid_t gid, gid_t *gro= ups, int ngroups, =20 if ((capng_ret =3D capng_apply(CAPNG_SELECT_CAPS)) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot apply process capabilities %d"), capng_re= t); + _("cannot apply process capabilities %1$d"), capng_= ret); return -1; } =20 @@ -1273,7 +1272,7 @@ virValidateWWN(const char *wwn) =20 if (i !=3D 16 || p[i]) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Malformed wwn: %s"), wwn); + _("Malformed wwn: %1$s"), wwn); return false; } =20 @@ -1308,7 +1307,7 @@ virParseOwnershipIds(const char *label, uid_t *uidPtr= , gid_t *gidPtr) sep =3D strchr(tmp_label, ':'); if (sep =3D=3D NULL) { virReportError(VIR_ERR_INVALID_ARG, - _("Failed to parse uid and gid from '%s'"), + _("Failed to parse uid and gid from '%1$s'"), label); goto cleanup; } diff --git a/src/util/virvhba.c b/src/util/virvhba.c index 5ceedc8076..73129ddd1f 100644 --- a/src/util/virvhba.c +++ b/src/util/virvhba.c @@ -237,7 +237,7 @@ virVHBAManageVport(const int parent_host, break; default: virReportError(VIR_ERR_OPERATION_INVALID, - _("Invalid vport operation (%d)"), operation); + _("Invalid vport operation (%1$d)"), operation); return -1; } =20 @@ -251,8 +251,7 @@ virVHBAManageVport(const int parent_host, =20 if (!virFileExists(operation_path)) { virReportError(VIR_ERR_OPERATION_INVALID, - _("vport operation '%s' is not supported " - "for host%d"), + _("vport operation '%1$s' is not supported for = host%2$d"), operation_file, parent_host); return -1; } @@ -268,7 +267,7 @@ virVHBAManageVport(const int parent_host, =20 if (virFileWriteStr(operation_path, vport_name, 0) < 0) { virReportSystemError(errno, - _("Write of '%s' to '%s' during vport create/= delete failed"), + _("Write of '%1$s' to '%2$s' during vport cre= ate/delete failed"), vport_name, operation_path); return -1; } diff --git a/src/util/virxml.c b/src/util/virxml.c index af4be4e443..1eaf81b6cc 100644 --- a/src/util/virxml.c +++ b/src/util/virxml.c @@ -276,7 +276,7 @@ virXMLCheckIllegalChars(const char *nodeName, char *c; if ((c =3D strpbrk(str, illegal))) { virReportError(VIR_ERR_XML_DETAIL, - _("invalid char in %s: %c"), nodeName, *c); + _("invalid char in %1$s: %2$c"), nodeName, *c); return -1; } return 0; @@ -322,7 +322,7 @@ virXMLPropStringRequired(xmlNodePtr node, =20 if (!ret) virReportError(VIR_ERR_XML_ERROR, - _("Missing required attribute '%s' in element '%s'= "), + _("Missing required attribute '%1$s' in element '%= 2$s'"), name, node->name); =20 return ret; @@ -345,7 +345,7 @@ virXMLNodeContentString(xmlNodePtr node) =20 if (node->type !=3D XML_ELEMENT_NODE) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("node '%s' has unexpected type %d"), + _("node '%1$s' has unexpected type %2$d"), node->name, node->type); return NULL; } @@ -354,7 +354,7 @@ virXMLNodeContentString(xmlNodePtr node) =20 if (!ret) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("node '%s' has unexpected NULL content. This coul= d be caused by malformed input, or a memory allocation failure"), + _("node '%1$s' has unexpected NULL content. This co= uld be caused by malformed input, or a memory allocation failure"), node->name); return NULL; } @@ -382,7 +382,7 @@ virXMLPropEnumInternal(xmlNodePtr node, return 0; =20 virReportError(VIR_ERR_XML_ERROR, - _("Missing required attribute '%s' in element '%s'"= ), + _("Missing required attribute '%1$s' in element '%2= $s'"), name, node->name); return -1; } @@ -391,7 +391,7 @@ virXMLPropEnumInternal(xmlNodePtr node, if (ret < 0 || ((flags & VIR_XML_PROP_NONZERO) && (ret =3D=3D 0))) { virReportError(VIR_ERR_XML_ERROR, - _("Invalid value for attribute '%s' in element '%s'= : '%s'."), + _("Invalid value for attribute '%1$s' in element '%= 2$s': '%3$s'."), name, node->name, NULLSTR(tmp)); return -1; } @@ -508,28 +508,28 @@ virXMLPropInt(xmlNodePtr node, return 0; =20 virReportError(VIR_ERR_XML_ERROR, - _("Missing required attribute '%s' in element '%s'"= ), + _("Missing required attribute '%1$s' in element '%2= $s'"), name, node->name); return -1; } =20 if (virStrToLong_i(tmp, NULL, base, &val) < 0) { virReportError(VIR_ERR_XML_ERROR, - _("Invalid value for attribute '%s' in element '%s'= : '%s'. Expected integer value"), + _("Invalid value for attribute '%1$s' in element '%= 2$s': '%3$s'. Expected integer value"), name, node->name, tmp); return -1; } =20 if ((flags & VIR_XML_PROP_NONNEGATIVE) && (val < 0)) { virReportError(VIR_ERR_XML_ERROR, - _("Invalid value for attribute '%s' in element '%s'= : '%s'. Expected non-negative value"), + _("Invalid value for attribute '%1$s' in element '%= 2$s': '%3$s'. Expected non-negative value"), name, node->name, tmp); return -1; } =20 if ((flags & VIR_XML_PROP_NONZERO) && (val =3D=3D 0)) { virReportError(VIR_ERR_XML_ERROR, - _("Invalid value for attribute '%s' in element '%s'= : Zero is not permitted"), + _("Invalid value for attribute '%1$s' in element '%= 2$s': Zero is not permitted"), name, node->name); return -1; } @@ -599,7 +599,7 @@ virXMLPropUIntDefault(xmlNodePtr node, return 0; =20 virReportError(VIR_ERR_XML_ERROR, - _("Missing required attribute '%s' in element '%s'"= ), + _("Missing required attribute '%1$s' in element '%2= $s'"), name, node->name); return -1; } @@ -608,14 +608,14 @@ virXMLPropUIntDefault(xmlNodePtr node, =20 if (ret < 0) { virReportError(VIR_ERR_XML_ERROR, - _("Invalid value for attribute '%s' in element '%s'= : '%s'. Expected non-negative integer value"), + _("Invalid value for attribute '%1$s' in element '%= 2$s': '%3$s'. Expected non-negative integer value"), name, node->name, tmp); return -1; } =20 if ((flags & VIR_XML_PROP_NONZERO) && (val =3D=3D 0)) { virReportError(VIR_ERR_XML_ERROR, - _("Invalid value for attribute '%s' in element '%s'= : Zero is not permitted"), + _("Invalid value for attribute '%1$s' in element '%= 2$s': Zero is not permitted"), name, node->name); return -1; } @@ -658,28 +658,28 @@ virXMLPropLongLong(xmlNodePtr node, return 0; =20 virReportError(VIR_ERR_XML_ERROR, - _("Missing required attribute '%s' in element '%s'"= ), + _("Missing required attribute '%1$s' in element '%2= $s'"), name, node->name); return -1; } =20 if (virStrToLong_ll(tmp, NULL, base, &val) < 0) { virReportError(VIR_ERR_XML_ERROR, - _("Invalid value for attribute '%s' in element '%s'= : '%s'. Expected long long integer value"), + _("Invalid value for attribute '%1$s' in element '%= 2$s': '%3$s'. Expected long long integer value"), name, node->name, tmp); return -1; } =20 if ((flags & VIR_XML_PROP_NONNEGATIVE) && (val < 0)) { virReportError(VIR_ERR_XML_ERROR, - _("Invalid value for attribute '%s' in element '%s'= : '%s'. Expected non-negative value"), + _("Invalid value for attribute '%1$s' in element '%= 2$s': '%3$s'. Expected non-negative value"), name, node->name, tmp); return -1; } =20 if ((flags & VIR_XML_PROP_NONZERO) && (val =3D=3D 0)) { virReportError(VIR_ERR_XML_ERROR, - _("Invalid value for attribute '%s' in element '%s'= : Zero is not permitted"), + _("Invalid value for attribute '%1$s' in element '%= 2$s': Zero is not permitted"), name, node->name); return -1; } @@ -722,7 +722,7 @@ virXMLPropULongLong(xmlNodePtr node, return 0; =20 virReportError(VIR_ERR_XML_ERROR, - _("Missing required attribute '%s' in element '%s'"= ), + _("Missing required attribute '%1$s' in element '%2= $s'"), name, node->name); return -1; } @@ -731,14 +731,14 @@ virXMLPropULongLong(xmlNodePtr node, =20 if (ret < 0) { virReportError(VIR_ERR_XML_ERROR, - _("Invalid value for attribute '%s' in element '%s'= : '%s'. Expected non-negative integer value"), + _("Invalid value for attribute '%1$s' in element '%= 2$s': '%3$s'. Expected non-negative integer value"), name, node->name, tmp); return -1; } =20 if ((flags & VIR_XML_PROP_NONZERO) && (val =3D=3D 0)) { virReportError(VIR_ERR_XML_ERROR, - _("Invalid value for attribute '%s' in element '%s'= : Zero is not permitted"), + _("Invalid value for attribute '%1$s' in element '%= 2$s': Zero is not permitted"), name, node->name); return -1; } @@ -803,14 +803,14 @@ virXMLPropUUID(xmlNodePtr node, return 0; =20 virReportError(VIR_ERR_XML_ERROR, - _("Missing required attribute '%s' in element '%s'"= ), + _("Missing required attribute '%1$s' in element '%2= $s'"), name, node->name); return -1; } =20 if (virUUIDParse(tmp, val) < 0) { virReportError(VIR_ERR_XML_ERROR, - _("Invalid value for attribute '%s' in element '%s'= : '%s'. Expected UUID"), + _("Invalid value for attribute '%1$s' in element '%= 2$s': '%3$s'. Expected UUID"), name, node->name, tmp); return -1; } @@ -965,7 +965,7 @@ virXPathNodeSet(const char *xpath, =20 if (obj->type !=3D XPATH_NODESET) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Incorrect xpath '%s'"), xpath); + _("Incorrect xpath '%1$s'"), xpath); return -1; } =20 @@ -1050,7 +1050,7 @@ catchXMLError(void *ctx, const char *msg G_GNUC_UNUSE= D, ...) =20 if (ctxt->lastError.file) { virGenericReportError(domcode, VIR_ERR_XML_DETAIL, - _("%s:%d: %s%s\n%s"), + _("%1$s:%2$d: %3$s%4$s\n%5$s"), ctxt->lastError.file, ctxt->lastError.line, ctxt->lastError.message, @@ -1058,7 +1058,7 @@ catchXMLError(void *ctx, const char *msg G_GNUC_UNUSE= D, ...) pointerstr); } else { virGenericReportError(domcode, VIR_ERR_XML_DETAIL, - _("at line %d: %s%s\n%s"), + _("at line %1$d: %2$s%3$s\n%4$s"), ctxt->lastError.line, ctxt->lastError.message, contextstr, @@ -1131,7 +1131,7 @@ virXMLParseHelper(int domcode, if (!xml) { if (virGetLastErrorCode() =3D=3D VIR_ERR_OK) { virGenericReportError(domcode, VIR_ERR_XML_ERROR, - _("failed to parse xml document '%s'"), + _("failed to parse xml document '%1$s'"), docname); } =20 @@ -1148,7 +1148,7 @@ virXMLParseHelper(int domcode, if (rootelement && !virXMLNodeNameEqual(rootnode, rootelement)) { virReportError(VIR_ERR_XML_ERROR, - _("expecting root element of '%s', not '%s'"), + _("expecting root element of '%1$s', not '%2$s'"), rootelement, rootnode->name); return NULL; } @@ -1250,14 +1250,14 @@ virXMLRewriteFile(int fd, if (data->warnCommand && virXMLEmitWarning(fd, data->warnName, data->warnCommand) < 0) { virReportSystemError(errno, - _("cannot write data to file '%s'"), + _("cannot write data to file '%1$s'"), path); return -1; } =20 if (safewrite(fd, data->xml, strlen(data->xml)) < 0) { virReportSystemError(errno, - _("cannot write data to file '%s'"), + _("cannot write data to file '%1$s'"), path); return -1; } @@ -1563,7 +1563,7 @@ virXMLValidatorInit(const char *schemafile) if (!(validator->rngParser =3D xmlRelaxNGNewParserCtxt(validator->schemafile))) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to create RNG parser for %s"), + _("Unable to create RNG parser for %1$s"), validator->schemafile); return NULL; } @@ -1575,7 +1575,7 @@ virXMLValidatorInit(const char *schemafile) =20 if (!(validator->rng =3D xmlRelaxNGParse(validator->rngParser))) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to parse RNG %s: %s"), + _("Unable to parse RNG %1$s: %2$s"), validator->schemafile, virBufferCurrentContent(&validator->buf)); return NULL; @@ -1583,7 +1583,7 @@ virXMLValidatorInit(const char *schemafile) =20 if (!(validator->rngValid =3D xmlRelaxNGNewValidCtxt(validator->rng)))= { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to create RNG validation context %s"), + _("Unable to create RNG validation context %1$s"), validator->schemafile); return NULL; } @@ -1603,7 +1603,7 @@ virXMLValidatorValidate(virXMLValidator *validator, { if (xmlRelaxNGValidateDoc(validator->rngValid, doc) !=3D 0) { virReportError(VIR_ERR_XML_INVALID_SCHEMA, - _("Unable to validate doc against %s\n%s"), + _("Unable to validate doc against %1$s\n%2$s"), validator->schemafile, virBufferCurrentContent(&validator->buf)); return -1; @@ -1823,7 +1823,7 @@ virXMLNamespaceRegister(xmlXPathContextPtr ctxt, BAD_CAST ns->prefix, BAD_CAST ns->uri) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to register xml namespace '%s'"), + _("Failed to register xml namespace '%1$s'"), ns->uri); return -1; } @@ -1876,7 +1876,7 @@ virParseScaledValue(const char *xpath, if (!required) return 0; virReportError(VIR_ERR_XML_ERROR, - _("missing element or attribute '%s'"), + _("missing element or attribute '%1$s'"), xpath); return -1; } @@ -1884,7 +1884,7 @@ virParseScaledValue(const char *xpath, =20 if (virStrToLong_ullp(bytes_str, NULL, 10, &bytes) < 0) { virReportError(VIR_ERR_XML_ERROR, - _("Invalid value '%s' for element or attribute '%s'= "), + _("Invalid value '%1$s' for element or attribute '%= 2$s'"), bytes_str, xpath); return -1; } --=20 2.39.2