util: Update format strings in translated messages (part 3)

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Jiri Denemark 2023-03-09 15:13:48 +01:00
parent f0ed4de9ec
commit b32bbe1e60
41 changed files with 416 additions and 473 deletions

View File

@ -548,7 +548,7 @@ virNetDevBandwidthPlug(const char *brname,
char ifmacStr[VIR_MAC_STRING_BUFLEN];
if (id <= 2) {
virReportError(VIR_ERR_INTERNAL_ERROR, _("Invalid class ID %d"), id);
virReportError(VIR_ERR_INTERNAL_ERROR, _("Invalid class ID %1$d"), id);
return -1;
}
@ -556,8 +556,7 @@ virNetDevBandwidthPlug(const char *brname,
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 to set 'floor' on '%2$s'"),
brname, ifmacStr);
return -1;
}
@ -613,7 +612,7 @@ virNetDevBandwidthUnplug(const char *brname,
g_autofree char *qdisc_id = NULL;
if (id <= 2) {
virReportError(VIR_ERR_INTERNAL_ERROR, _("Invalid class ID %d"), id);
virReportError(VIR_ERR_INTERNAL_ERROR, _("Invalid class ID %1$d"), id);
return -1;
}

View File

@ -70,7 +70,7 @@ static int virNetDevBridgeCmd(const char *brname,
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 = 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 = (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,
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 = (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"), brname, paramname);
return -1;
}
@ -178,7 +178,7 @@ static int virNetDevBridgeGet(const char *brname,
*value = info.forward_delay;
} else {
virReportSystemError(EINVAL,
_("Unable to get bridge %s %s"), brname, paramname);
_("Unable to get bridge %1$s %2$s"), brname, paramname);
return -1;
}
}
@ -210,7 +210,7 @@ virNetDevBridgePortSet(const char *brname,
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 to %4$s"),
brname, ifname, paramname, valuestr);
}
@ -235,7 +235,7 @@ virNetDevBridgePortGet(const char *brname,
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,
if (ioctl(fd, SIOCBRADDBR, brname) < 0) {
virReportSystemError(errno,
_("Unable to create bridge %s"), brname);
_("Unable to create bridge %1$s"), brname);
return -1;
}
@ -441,7 +441,7 @@ virNetDevBridgeCreate(const char *brname,
}
# endif
if (error < 0)
virReportSystemError(-error, _("error creating bridge interface %s"),
virReportSystemError(-error, _("error creating bridge interface %1$s"),
brname);
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)
if (ioctl(fd, SIOCBRDELBR, brname) < 0) {
virReportSystemError(errno,
_("Unable to delete bridge %s"), brname);
_("Unable to delete bridge %1$s"), brname);
return -1;
}
@ -568,7 +568,7 @@ virNetDevBridgeDelete(const char *brname)
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,
if (!(ifr.ifr_ifindex = if_nametoindex(ifname))) {
virReportSystemError(ENODEV,
_("Unable to get interface index for %s"), ifname);
_("Unable to get interface index for %1$s"), ifname);
return -1;
}
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"), brname, ifname);
return -1;
}
@ -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;
}
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"), brname, ifname);
return -1;
}
@ -644,7 +644,7 @@ int virNetDevBridgeAddPort(const char *brname,
const char *ifname)
{
virReportSystemError(ENOSYS,
_("Unable to add bridge %s port %s"), brname, ifname);
_("Unable to add bridge %1$s port %2$s"), brname, ifname);
return -1;
}
#endif
@ -670,14 +670,14 @@ int virNetDevBridgeRemovePort(const char *brname,
if (!(ifr.ifr_ifindex = if_nametoindex(ifname))) {
virReportSystemError(ENODEV,
_("Unable to get interface index for %s"), ifname);
_("Unable to get interface index for %1$s"), ifname);
return -1;
}
if (ioctl(fd, SIOCBRDELIF, &ifr) < 0) {
virReportSystemError(errno,
_("Unable to remove bridge %s port %s"), brname, ifname);
_("Unable to remove bridge %1$s port %2$s"), brname, ifname);
return -1;
}
@ -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;
}
if (virNetDevBridgeCmd(brname, BRDGDEL, &req, sizeof(req)) < 0) {
virReportSystemError(errno,
_("Unable to remove bridge %s port %s"), brname, ifname);
_("Unable to remove bridge %1$s port %2$s"), brname, ifname);
return -1;
}
@ -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"), brname, ifname);
return -1;
}
#endif
@ -823,7 +823,7 @@ int virNetDevBridgeSetSTPDelay(const char *brname,
if (virNetDevBridgeCmd(brname, BRDGSFD, &param, sizeof(param)) < 0) {
virReportSystemError(errno,
_("Unable to set STP delay on %s"), brname);
_("Unable to set STP delay on %1$s"), brname);
return -1;
}
@ -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 platform"),
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 platform"),
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 platform"),
brname);
return -1;
}
@ -877,7 +877,7 @@ int virNetDevBridgeSetSTP(const char *brname,
{
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"), ifname);
_("error adding fdb entry for %1$s"), ifname);
return -1;
}
}

View File

@ -181,7 +181,7 @@ virNetDevIPAddrAdd(const char *ifname,
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,
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,
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;
}
@ -352,7 +352,7 @@ virNetDevIPRouteAdd(const char *ifname,
return -1;
if ((errCode = virNetlinkGetErrorCode(resp, recvbuflen)) < 0) {
virReportSystemError(errCode, _("Error adding route to %s"), ifname);
virReportSystemError(errCode, _("Error adding route to %1$s"), ifname);
return -1;
}
@ -538,8 +538,8 @@ virNetDevIPCheckIPv6Forwarding(void)
if ((len = 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_ROUTE);
_("Unable to read %1$s for ipv6 forwarding checks"),
PROC_NET_IPV6_ROUTE);
return false;
}
@ -592,10 +592,8 @@ virNetDevIPCheckIPv6Forwarding(void)
*/
if (ret == 1 || (ret == 0 && all_accept_ra == 1)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Check the host setup: interface %s has kernel "
"autoconfigured IPv6 routes and enabling forwarding "
" without accept_ra set to 2 will cause the kernel "
"to flush them, breaking networking."), iface_val);
_("Check the host setup: interface %1$s has kernel autoconfigured IPv6 routes and enabling forwarding without accept_ra set to 2 will cause the kernel to flush them, breaking networking."),
iface_val);
return false;
}
}
@ -638,7 +636,7 @@ virNetDevGetIPv4AddressIoctl(const char *ifname,
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,
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,
}
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 = 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 = virNetDevIPRouteGetPrefix(route)) < 0) {
ipStr = virSocketAddrFormat(&route->address);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to determine prefix for route with destination '%s'"),
_("Failed to determine prefix for route with destination '%1$s'"),
NULLSTR(ipStr));
return -1;
}

View File

@ -113,7 +113,7 @@ virNetDevMacVLanCreate(const char *ifname,
char macstr[VIR_MAC_STRING_BUFLEN];
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;
}

View File

@ -49,7 +49,7 @@ virNetDevMidonetBindPort(const char *ifname,
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 *virtualport)
if (virCommandRun(cmd, NULL) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to unbind the virtual port %s from Midonet"),
_("Unable to unbind the virtual port %1$s from Midonet"),
virtportuuid);
return -1;
}

View File

@ -185,7 +185,7 @@ int virNetDevOpenvswitchAddPort(const char *brname, const char *ifname,
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
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;
}
@ -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 interface %1$s"),
ifname);
return -1;
}
@ -276,8 +276,8 @@ int virNetDevOpenvswitchSetMigrateData(char *migrate, const 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 interface %1$s"),
ifname);
return -1;
}
@ -443,8 +443,8 @@ virNetDevOpenvswitchInterfaceGetMaster(const char *ifname, char **master)
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 interface %1$s"),
ifname);
return -1;
}
@ -614,7 +614,7 @@ int virNetDevOpenvswitchUpdateVlan(const char *ifname,
if (virCommandRun(cmd, NULL) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to set vlan configuration on port %s"), ifname);
_("Unable to set vlan configuration on port %1$s"), ifname);
return -1;
}
@ -730,7 +730,7 @@ virNetDevOpenvswitchInterfaceClearRxQos(const char *ifname)
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;
}
@ -806,10 +806,10 @@ virNetDevOpenvswitchInterfaceSetTxQos(const char *ifname,
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 on port %s"), ifname);
_("Unable to create and set qos configuration on port %1$s"), ifname);
}
return -1;
}
@ -829,7 +829,7 @@ virNetDevOpenvswitchInterfaceSetTxQos(const char *ifname,
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 *ifname,
if (virCommandRun(cmd, NULL) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to set vlan configuration on port %s"), ifname);
_("Unable to set vlan configuration on port %1$s"), ifname);
return -1;
}

View File

@ -105,7 +105,7 @@ virNetDevTapGetRealDeviceName(char *ifname G_GNUC_UNUSED)
if ((ifindex = if_nametoindex(ifname)) == 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_UNUSED)
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_UNUSED)
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 = 0; i < tapfdSize; i++) {
if ((fd = 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);
goto cleanup;
}
@ -225,7 +225,7 @@ int virNetDevTapCreate(char **ifname,
if (virStrcpyStatic(ifr.ifr_name, *ifname) < 0) {
virReportSystemError(ERANGE,
_("Network interface name '%s' is too long"),
_("Network interface name '%1$s' is too long"),
*ifname);
goto cleanup;
@ -233,7 +233,7 @@ int virNetDevTapCreate(char **ifname,
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 persistent"),
_("Unable to set tap device %1$s to persistent"),
NULLSTR(*ifname));
goto cleanup;
}
@ -281,7 +281,7 @@ int virNetDevTapDelete(const char *ifname,
if ((fd = 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,
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,
if ((*tapfd = 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,
if (ioctl(s, SIOCIFDESTROY, &ifr) < 0) {
virReportSystemError(errno,
_("Unable to remove tap device %s"),
_("Unable to remove tap device %1$s"),
ifname);
goto cleanup;
}

View File

@ -42,7 +42,7 @@ virNetDevVethCreateInternal(const char *veth1, const char *veth2)
if (virNetlinkNewLink(veth1, "veth", &data, &error) < 0) {
if (error != 0) {
virReportSystemError(-error,
_("unable to create %s <-> %s veth pair"),
_("unable to create %1$s <-> %2$s veth pair"),
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;
}

View File

@ -205,7 +205,7 @@ virNetDevVPortProfileCheckComplete(virNetDevVPortProfile *virtport,
if (missing) {
virReportError(VIR_ERR_XML_ERROR,
_("missing %s in <virtualport type='%s'>"), missing,
_("missing %1$s in <virtualport type='%2$s'>"), missing,
virNetDevVPortTypeToString(virtport->virtPortType));
return -1;
}
@ -262,7 +262,7 @@ virNetDevVPortProfileCheckNoExtras(const virNetDevVPortProfile *virtport)
if (extra) {
virReportError(VIR_ERR_XML_ERROR,
_("extra %s unsupported in <virtualport type='%s'>"),
_("extra %1$s unsupported in <virtualport type='%2$s'>"),
extra,
virNetDevVPortTypeToString(virtport->virtPortType));
return -1;
@ -290,8 +290,7 @@ virNetDevVPortProfileMerge(virNetDevVPortProfile *orig,
if (otype != VIR_NETDEV_VPORT_PROFILE_NONE &&
otype != mods->virtPortType) {
virReportError(VIR_ERR_XML_ERROR,
_("attempt to merge virtualports "
"with mismatched types (%s and %s)"),
_("attempt to merge virtualports with mismatched 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 != mods->managerID)) {
virReportError(VIR_ERR_XML_ERROR,
_("attempt to merge virtualports "
"with mismatched managerids (%d and %d)"),
_("attempt to merge virtualports with mismatched 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 != mods->typeID)) {
virReportError(VIR_ERR_XML_ERROR,
_("attempt to merge virtualports "
"with mismatched typeids (%d and %d)"),
_("attempt to merge virtualports with mismatched 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 != mods->typeIDVersion)) {
virReportError(VIR_ERR_XML_ERROR,
_("attempt to merge virtualports with "
"mismatched typeidversions (%d and %d)"),
_("attempt to merge virtualports with mismatched 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];
virReportError(VIR_ERR_XML_ERROR,
_("attempt to merge virtualports with "
"mismatched instanceids ('%s' and '%s')"),
_("attempt to merge virtualports with mismatched 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];
virReportError(VIR_ERR_XML_ERROR,
_("attempt to merge virtualports with "
"mismatched interfaceids ('%s' and '%s')"),
_("attempt to merge virtualports with mismatched 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 mismatched 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);
}
VIR_FORCE_CLOSE(fd);
@ -577,7 +570,7 @@ virNetDevVPortProfileGetStatus(struct nlattr **tb, int32_t vf,
virUUIDFormat(instanceId, instanceIdStr);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not find vf/instanceId %u/%s in netlink response"),
_("Could not find vf/instanceId %1$u/%2$s in netlink response"),
vf, instanceIdStr);
/* go through all the entries again. This seems tedious,
@ -811,7 +804,7 @@ virNetDevVPortProfileOpSetLink(const char *ifname, int ifindex,
if (err->error) {
virReportSystemError(-err->error,
_("error during virtual port configuration of ifindex %d"),
_("error during virtual port configuration of ifindex %1$d"),
ifindex);
goto cleanup;
}
@ -977,8 +970,7 @@ virNetDevVPortProfileOpCommon(const char *ifname, int ifindex,
/* keep trying... */
} else {
virReportSystemError(EINVAL,
_("error %d during port-profile setlink on "
"interface %s (%d)"),
_("error %1$d during port-profile setlink on interface %2$s (%3$d)"),
status, ifname, ifindex);
rc = -1;
break;
@ -1079,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;
}
@ -1188,7 +1180,7 @@ virNetDevVPortProfileOp8021Qbh(const char *ifname,
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 = -1;
break;
default:

View File

@ -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 protocol %1$d"),
protocol);
goto error;
}
@ -255,7 +255,7 @@ virNetlinkSendRequest(struct nl_msg *nl_msg, uint32_t src_pid,
if (protocol >= MAX_LINKS) {
virReportSystemError(EINVAL,
_("invalid protocol argument: %d"), protocol);
_("invalid protocol argument: %1$d"), protocol);
goto error;
}
@ -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, virNetlinkTalkFallback 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 >= MAX_LINKS) {
virReportSystemError(EINVAL,
_("invalid protocol argument: %d"), protocol);
_("invalid protocol argument: %1$d"), protocol);
return false;
}
@ -1003,7 +1003,7 @@ virNetlinkEventServiceStart(unsigned int protocol, unsigned int groups)
if (protocol >= MAX_LINKS) {
virReportSystemError(EINVAL,
_("invalid protocol argument: %d"), protocol);
_("invalid protocol argument: %1$d"), protocol);
return -EINVAL;
}

View File

@ -66,7 +66,7 @@ static int virNodeSuspendSetNodeWakeup(unsigned long long alarmTime)
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;
}

View File

@ -112,7 +112,7 @@ virNumaSetupMemoryPolicy(virDomainNumatuneMemMode mode,
while ((bit = virBitmapNextSetBit(nodeset, bit)) >= 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);
@ -530,16 +530,16 @@ virNumaGetHugePageInfoPath(char **path,
if (node != -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;
@ -600,7 +600,7 @@ virNumaGetHugePageInfo(int node,
if (virStrToLong_ull(buf, &end, 10, page_avail) < 0 ||
*end != '\n') {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to parse: %s"),
_("unable to parse: %1$s"),
buf);
return -1;
}
@ -619,7 +619,7 @@ virNumaGetHugePageInfo(int node,
if (virStrToLong_ull(buf, &end, 10, page_free) < 0 ||
*end != '\n') {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to parse: %s"),
_("unable to parse: %1$s"),
buf);
return -1;
}
@ -771,7 +771,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;
}
@ -864,7 +864,7 @@ virNumaSetPagePoolSize(int node,
if (virStrToLong_ull(nr_buf, &end, 10, &nr_count) < 0 ||
*end != '\n') {
virReportError(VIR_ERR_OPERATION_FAILED,
_("invalid number '%s' in '%s'"),
_("invalid number '%1$s' in '%2$s'"),
nr_buf, nr_path);
return -1;
}
@ -895,7 +895,7 @@ virNumaSetPagePoolSize(int node,
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;
}
@ -908,14 +908,14 @@ virNumaSetPagePoolSize(int node,
if (virStrToLong_ull(nr_buf, &end, 10, &nr_count) < 0 ||
*end != '\n') {
virReportError(VIR_ERR_OPERATION_FAILED,
_("invalid number '%s' in '%s'"),
_("invalid number '%1$s' in '%2$s'"),
nr_buf, nr_path);
return -1;
}
if (nr_count != page_count) {
virReportError(VIR_ERR_OPERATION_FAILED,
_("Unable to allocate %llu pages. Allocated only %llu"),
_("Unable to allocate %1$llu pages. Allocated only %2$llu"),
page_count, nr_count);
return -1;
}
@ -976,7 +976,7 @@ virNumaNodesetIsAvailable(virBitmap *nodeset)
continue;
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("NUMA node %zd is unavailable"), bit);
_("NUMA node %1$zd is unavailable"), bit);
return false;
}
return true;
@ -1036,7 +1036,7 @@ virNumaCPUSetToNodeset(virBitmap *cpuset,
if (node < 0) {
virReportSystemError(errno,
_("Unable to get NUMA node of cpu %zd"),
_("Unable to get NUMA node of cpu %1$zd"),
pos);
return -1;
}
@ -1087,7 +1087,7 @@ virNumaNodesetToCPUset(virBitmap *nodeset,
/* Error is reported for cases other than non-existent NUMA node. */
if (rc == -2) {
virReportError(VIR_ERR_OPERATION_FAILED,
_("NUMA node %zu is not available"),
_("NUMA node %1$zu is not available"),
i);
}
return -1;

View File

@ -185,7 +185,7 @@ virNVMeDeviceListAdd(virNVMeDeviceList *list,
if ((tmp = virNVMeDeviceListLookup(list, dev))) {
g_autofree char *addrStr = virPCIDeviceAddressAsString(&tmp->address);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("NVMe device %s namespace %u is already on the list"),
_("NVMe device %1$s namespace %2$u is already on the list"),
NULLSTR(addrStr), tmp->namespace);
return -1;
}
@ -209,7 +209,7 @@ virNVMeDeviceListDel(virNVMeDeviceList *list,
if ((idx = virNVMeDeviceListLookupIndex(list, dev)) < 0) {
g_autofree char *addrStr = virPCIDeviceAddressAsString(&dev->address);
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 = virPCIDeviceAddressAsString(&d->address);
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) {

View File

@ -181,7 +181,7 @@ virClassNew(virClass *parent,
} else if (objectSize <= parentSize ||
parentSize != (parent ? parent->objectSize : 0)) {
virReportInvalidArg(objectSize,
_("object size %zu of %s is not larger than parent class %zu"),
_("object size %1$zu of %2$s is not larger than parent class %3$zu"),
objectSize, name, parent->objectSize);
return NULL;
}
@ -266,7 +266,7 @@ virObjectLockableNew(virClass *klass)
if (!virClassIsDerivedFrom(klass, virClassForObjectLockable())) {
virReportInvalidArg(klass,
_("Class %s must derive from virObjectLockable"),
_("Class %1$s must derive from virObjectLockable"),
virClassName(klass));
return NULL;
}
@ -292,7 +292,7 @@ virObjectRWLockableNew(virClass *klass)
if (!virClassIsDerivedFrom(klass, virClassForObjectRWLockable())) {
virReportInvalidArg(klass,
_("Class %s must derive from virObjectRWLockable"),
_("Class %1$s must derive from virObjectRWLockable"),
virClassName(klass));
return NULL;
}

View File

@ -252,13 +252,13 @@ virPCIDeviceGetDriverPathAndName(virPCIDevice *dev, char **path, char **name)
if (virFileIsLink(drvlink) != 1) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Invalid device %s driver file %s is not a symlink"),
_("Invalid device %1$s driver file %2$s is not a symlink"),
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 *device_class)
id_str[8] = '\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 = virPCIDeviceBusContainsActiveDevices(dev, inactiveDevs))) {
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,
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)
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,
if (hdrType != 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 PCI endpoint devices can be reset"),
dev->name);
return -1;
}
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;
}
@ -1071,7 +1070,7 @@ virPCIDeviceReset(virPCIDevice *dev,
if (ret < 0) {
virErrorPtr err = 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: administratively prohibited"),
drvname);
} else {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to load PCI stub module %s"),
_("Failed to load PCI stub module %1$s"),
drvname);
}
@ -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' from %2$s"),
dev->name, driver);
return -1;
}
@ -1175,7 +1173,7 @@ int virPCIDeviceRebind(virPCIDevice *dev)
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,
if (virFileWriteStr(path, driverName, 0) < 0) {
virReportSystemError(errno,
_("Failed to add driver '%s' to driver_override "
" interface of PCI device '%s'"),
_("Failed to add driver '%1$s' to driver_override 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 == 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 = virPCIStubDriverTypeToString(dev->stubDriver))) {
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,
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;
}
@ -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;
}
@ -1370,24 +1367,21 @@ virPCIDeviceAddressIsValid(virPCIDeviceAddress *addr,
if (addr->bus > 0xFF) {
if (report)
virReportError(VIR_ERR_XML_ERROR,
_("Invalid PCI address bus='0x%x', "
"must be <= 0xFF"),
_("Invalid PCI address bus='0x%1$x', must be <= 0xFF"),
addr->bus);
return false;
}
if (addr->slot > 0x1F) {
if (report)
virReportError(VIR_ERR_XML_ERROR,
_("Invalid PCI address slot='0x%x', "
"must be <= 0x1F"),
_("Invalid PCI address slot='0x%1$x', must be <= 0x1F"),
addr->slot);
return false;
}
if (addr->function > 7) {
if (report)
virReportError(VIR_ERR_XML_ERROR,
_("Invalid PCI address function=0x%x, "
"must be <= 7"),
_("Invalid PCI address function=0x%1$x, must be <= 7"),
addr->function);
return false;
}
@ -1468,7 +1462,7 @@ virPCIDeviceNew(const virPCIDeviceAddress *address)
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)
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]) >= 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(virPCIDeviceAddress *orig,
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(virPCIDeviceAddress *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 symlink %2$s"),
devName, devPath);
return -1;
}
@ -2003,8 +1997,7 @@ virPCIDeviceAddressGetIOMMUGroupNum(virPCIDeviceAddress *addr)
groupNumStr = 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)
if (virFileIsLink(devPath) != 1) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Invalid device %s iommu_group file %s is not a symlink"),
_("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 symlink %2$s"),
dev->name, devPath);
return NULL;
}
@ -2119,7 +2112,7 @@ virPCIDeviceIsBehindSwitchLackingACS(virPCIDevice *dev)
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 and cannot be assigned"),
dev->name);
return 0;
}
@ -2192,7 +2184,7 @@ logStrToLong_ui(char const *s,
ret = virStrToLong_ui(s, end_ptr, base, result);
if (ret != 0)
VIR_ERROR(_("Failed to convert '%s' to unsigned int"), s);
VIR_ERROR(_("Failed to convert '%1$s' to unsigned int"), s);
return ret;
}
@ -2282,7 +2274,7 @@ virPCIGetDeviceAddressFromSysfsLink(const char *device_link)
device_path = virFileCanonicalizePath(device_link);
if (device_path == 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 *device_link)
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,
if (!(fnc.addr = virPCIGetDeviceAddressFromSysfsLink(device_link))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to get SRIOV function from device link '%s'"),
_("Failed to get SRIOV function from device link '%1$s'"),
device_link);
return -1;
}
@ -2434,8 +2426,8 @@ virPCIGetVirtualFunctionIndex(const char *pf_sysfs_device_link,
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;
}
@ -2582,7 +2574,7 @@ virPCIGetNetName(const char *device_link_sysfs_path,
}
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not find any network device under PCI device at %s"),
_("Could not find any network device under PCI device at %1$s"),
device_link_sysfs_path);
return -1;
}
@ -2635,7 +2627,7 @@ virPCIGetVirtualFunctionInfo(const char *vf_sysfs_device_path,
* PF device is bound to a network driver
*/
virReportError(VIR_ERR_INTERNAL_ERROR,
_("The PF device for VF %s has no network device name"),
_("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)
vpdPath = 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 have a VPD"),
virPCIDeviceGetName(dev));
return NULL;
}
if ((fd = open(vpdPath, O_RDONLY)) < 0) {
virReportSystemError(-fd, _("Failed to open a VPD file '%s'"), vpdPath);
virReportSystemError(-fd, _("Failed to open a VPD file '%1$s'"), vpdPath);
return NULL;
}
res = virPCIVPDParse(fd);
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;
}
@ -2854,7 +2846,7 @@ virPCIDeviceGetLinkCapSta(virPCIDevice *dev,
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 *hdrType)
type &= PCI_HEADER_TYPE_MASK;
if (type >= 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;
}

View File

@ -214,7 +214,7 @@ virPerfEventEnable(virPerf *perf,
type == VIR_PERF_EVENT_MBMT ||
type == 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 = 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;
}
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,
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;
}

View File

@ -378,7 +378,7 @@ int virPidFileAcquirePathFull(const char *path,
if ((fd = 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,
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;
}

View File

@ -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",

View File

@ -147,7 +147,7 @@ virPortAllocatorBindToPort(bool *used,
addr = (struct sockaddr*)&addr4;
addrlen = sizeof(addr4);
} else {
virReportError(VIR_ERR_INTERNAL_ERROR, _("Unknown family %d"), family);
virReportError(VIR_ERR_INTERNAL_ERROR, _("Unknown family %1$d"), family);
return -1;
}
@ -176,7 +176,7 @@ virPortAllocatorBindToPort(bool *used,
*used = true;
ret = 0;
} else {
virReportSystemError(errno, _("Unable to bind to port %d"), port);
virReportSystemError(errno, _("Unable to bind to port %1$d"), port);
}
goto cleanup;
}
@ -224,7 +224,7 @@ virPortAllocatorAcquire(const virPortAllocatorRange *range,
/* 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 = i;
@ -234,7 +234,7 @@ virPortAllocatorAcquire(const virPortAllocatorRange *range,
}
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;
}
}

View File

@ -97,13 +97,13 @@ virProcessTranslateStatus(int status)
{
char *buf;
if (WIFEXITED(status)) {
buf = g_strdup_printf(_("exit status %d"),
buf = g_strdup_printf(_("exit status %1$d"),
WEXITSTATUS(status));
} else if (WIFSIGNALED(status)) {
buf = g_strdup_printf(_("fatal signal %d"),
buf = g_strdup_printf(_("fatal signal %1$d"),
WTERMSIG(status));
} else {
buf = g_strdup_printf(_("invalid value %d"), status);
buf = g_strdup_printf(_("invalid value %1$d"), status);
}
return buf;
}
@ -200,7 +200,7 @@ virProcessWait(pid_t pid, int *exitstatus, bool raw)
if (pid <= 0) {
if (pid != -1)
virReportSystemError(EINVAL, _("unable to wait for process %lld"),
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 == EINTR);
if (ret == -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 = 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);
}
@ -256,7 +256,7 @@ virProcessAbort(pid_t pid)
int
virProcessWait(pid_t pid, int *exitstatus G_GNUC_UNUSED, bool raw G_GNUC_UNUSED)
{
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, unsigned int extradelay, boo
if (rc < 0) {
if (errno != ESRCH) {
virReportSystemError(errno,
_("Failed to terminate process %lld with 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, unsigned int extradelay, boo
}
virReportSystemError(EBUSY,
_("Failed to terminate process %lld with SIG%s"),
_("Failed to terminate process %1$lld with SIG%2$s"),
(long long)pid, signame);
return 0;
@ -486,7 +486,7 @@ int virProcessSetAffinity(pid_t pid, virBitmap *map, bool 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)
if (sched_getaffinity(pid, masklen, mask) < 0) {
virReportSystemError(errno,
_("cannot get CPU affinity of process %d"), pid);
_("cannot get CPU affinity of process %1$d"), pid);
goto cleanup;
}
@ -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) != 0) {
virReportSystemError(errno,
_("cannot get CPU affinity of process %d"), pid);
_("cannot get CPU affinity of process %1$d"), pid);
return NULL;
}
@ -927,8 +927,7 @@ virProcessSetMaxMemLock(pid_t pid, unsigned long long bytes)
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$lld to %2$llu"),
(long long int)pid, bytes);
return -1;
}
@ -969,8 +968,7 @@ virProcessGetMaxMemLock(pid_t pid,
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 procs)
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 to %2$u"),
(long long int)pid, procs);
return -1;
}
@ -1061,8 +1058,7 @@ virProcessSetMaxFiles(pid_t pid, unsigned int files)
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 process %1$lld to %2$u"),
(long long int)pid, files);
return -1;
}
@ -1098,8 +1094,7 @@ virProcessSetMaxCoreSize(pid_t pid, unsigned long long bytes)
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,
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;
}
starttime_str = 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));
virReportError(VIR_ERR_INTERNAL_ERROR,
_("child reported (status=%d): %s"),
_("child reported (status=%1$d): %2$s"),
status, NULLSTR(bin->data.message));
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=%d)"),
_("child didn't write error (status=%1$d)"),
status);
}
}
@ -1599,7 +1594,7 @@ virProcessSetScheduler(pid_t pid,
if (pol < 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Scheduler '%s' is not supported on this platform"),
_("Scheduler '%1$s' is not supported on this platform"),
virProcessSchedPolicyTypeToString(policy));
return -1;
}
@ -1624,7 +1619,7 @@ virProcessSetScheduler(pid_t pid,
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,
if (sched_setscheduler(pid, pol, &param) < 0) {
virReportSystemError(errno,
_("Cannot set scheduler parameters for pid %lld"),
_("Cannot set scheduler parameters for pid %1$lld"),
(long long) pid);
return -1;
}
@ -1827,7 +1822,7 @@ virProcessGetSchedInfo(unsigned long long *cpuWait,
line = 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,
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;
}

View File

@ -111,7 +111,7 @@ virRandomBytes(unsigned char *buf,
if ((rv = 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;
}

View File

@ -614,7 +614,7 @@ virResctrlGetCacheInfo(virResctrlInfo *resctrl,
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 != 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 match expected size %3$llu"),
level, i_type->size, size);
goto error;
}
@ -966,7 +965,7 @@ virResctrlInfoGetMonitorPrefix(virResctrlInfo *resctrl,
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 *alloc,
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,
if (*resctrlid) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Attempt to overwrite resctrlid='%s' with id='%s'"),
_("Attempt to overwrite resctrlid='%1$s' with id='%2$s'"),
*resctrlid, id);
return -1;
}
@ -1421,19 +1419,19 @@ virResctrlAllocParseProcessMemoryBandwidth(virResctrlInfo *resctrl,
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 <= id) {
@ -1576,7 +1574,7 @@ virResctrlAllocParseProcessCache(virResctrlInfo *resctrl,
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;
}
@ -1589,8 +1587,7 @@ virResctrlAllocParseProcessCache(virResctrlInfo *resctrl,
!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,
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 = 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)
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,
if (cache >= 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 = 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;
}
if (*size == 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 possible, specify size smaller than %1$llu"),
i_type->size);
return -1;
}
@ -1938,16 +1933,14 @@ virResctrlAllocFindUnused(virResctrlAlloc *alloc,
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;
}
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,
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 for level %2$u cache %3$u scope type '%4$s'"),
*size, level, cache,
virCacheTypeToString(type));
return -1;
@ -2028,25 +2019,21 @@ virResctrlAllocMemoryBandwidth(virResctrlInfo *resctrl,
if (*(mem_bw_alloc->bandwidths[i]) % mem_bw_info->bandwidth_granularity) {
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,
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,
if (!f_type) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Cache level %d does not support tuning for "
"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 resctrl "
"parentpath='%s' prefix='%s'"), parentpath, prefix);
_("Resctrl ID must be set before determining resctrl parentpath='%1$s' prefix='%2$s'"),
parentpath, prefix);
return NULL;
}
@ -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)
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,
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) != 0 && errno != ENOENT) {
ret = -errno;
VIR_ERROR(_("Unable to remove %s (%d)"), alloc->path, errno);
VIR_ERROR(_("Unable to remove %1$s (%2$d)"), alloc->path, errno);
}
return ret;
@ -2438,7 +2424,7 @@ virResctrlMonitorDeterminePath(virResctrlMonitor *monitor,
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=%s", monitor->path);
if (rmdir(monitor->path) != 0 && errno != ENOENT) {
ret = -errno;
VIR_ERROR(_("Unable to remove %s (%d)"), monitor->path, errno);
VIR_ERROR(_("Unable to remove %1$s (%2$d)"), monitor->path, errno);
}
return ret;
@ -2627,7 +2613,7 @@ virResctrlMonitorGetStats(virResctrlMonitor *monitor,
ent->d_name, resources[i]);
if (rv == -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)

View File

@ -106,21 +106,21 @@ virRotatingFileWriterEntryNew(const char *path,
if ((entry->fd = open(path, O_CREAT|O_APPEND|O_WRONLY|O_CLOEXEC, mode)) < 0) {
virReportSystemError(errno,
_("Unable to open file: %s"), path);
_("Unable to open file: %1$s"), path);
goto error;
}
entry->pos = lseek(entry->fd, 0, SEEK_END);
if (entry->pos == (off_t)-1) {
virReportSystemError(errno,
_("Unable to determine current file offset: %s"),
_("Unable to determine current file offset: %1$s"),
path);
goto error;
}
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 = open(path, O_RDONLY|O_CLOEXEC)) < 0) {
if (errno != 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 != -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 != 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 != 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,
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,
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 *file)
if (unlink(file->basepath) < 0 &&
errno != ENOENT) {
virReportSystemError(errno,
_("Unable to remove %s"),
_("Unable to remove %1$s"),
file->basepath);
goto cleanup;
}
@ -386,7 +386,7 @@ virRotatingFileWriterRollover(virRotatingFileWriter *file)
if (rename(thispath, nextpath) < 0 &&
errno != 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) != 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 = lseek(entry->fd, offset, SEEK_SET);
if (ret == (off_t)-1) {
virReportSystemError(errno,
_("Unable to seek to inode %llu offset %llu"),
_("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 = lseek(file->entries[0]->fd, offset, SEEK_SET);
if (ret == (off_t)-1) {
virReportSystemError(errno,
_("Unable to seek to inode %llu offset %llu"),
_("Unable to seek to inode %1$llu offset %2$llu"),
(unsigned long long)inode, (unsigned long long)offset);
return -1;
}
@ -576,7 +576,7 @@ virRotatingFileReaderConsume(virRotatingFileReader *file,
got = 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;
}

View File

@ -93,7 +93,7 @@ virSCSIDeviceGetAdapterId(const char *adapter,
NULL, 0, adapter_id) == 0)
return 0;
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Cannot parse adapter '%s'"), adapter);
_("Cannot parse adapter '%1$s'"), adapter);
return -1;
}
@ -195,7 +195,7 @@ virSCSIDeviceNew(const char *sysfs_prefix,
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;
}

View File

@ -176,14 +176,14 @@ virSCSIHostGetNumber(const char *adapter_name,
adapter_name += 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;
}
if (virStrToLong_ui(adapter_name, NULL, 10, result) == -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 = virSCSIHostFindByPCI(NULL, parentaddr, unique_id))) {
virReportError(VIR_ERR_XML_ERROR,
_("Failed to find scsi_host using PCI '%s' "
"and unique_id='%u'"),
_("Failed to find scsi_host using PCI '%1$s' and unique_id='%2$u'"),
parentaddr, unique_id);
return NULL;
}

View File

@ -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 = open(VHOST_SCSI_DEVICE, O_RDWR);
if (*vhostfd < 0) {
virReportSystemError(errno, _("Failed to open %s"), VHOST_SCSI_DEVICE);
virReportSystemError(errno, _("Failed to open %1$s"), VHOST_SCSI_DEVICE);
return -1;
}
@ -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);

View File

@ -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 = VIR_SECRET_LOOKUP_TYPE_UUID;
@ -165,8 +165,7 @@ virSecretGetSecretString(virConnectPtr conn,
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 expected '%3$s' type"),
uuidstr, virSecretUsageTypeToString(sec->usageType),
virSecretUsageTypeToString(secretUsageType));
return -1;

View File

@ -107,7 +107,7 @@ virSocketAddrParseInternal(struct addrinfo **res,
if ((err = getaddrinfo(val, NULL, &hints, res)) != 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));
return -1;
@ -137,7 +137,7 @@ int virSocketAddrParse(virSocketAddr *addr, const char *val, int family)
if (res == 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 == 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)
if ((err = getaddrinfo(NULL, service, &hints, &res)) != 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)
}
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));
cleanup:
@ -484,7 +484,7 @@ virSocketAddrFormatFull(const virSocketAddr *addr,
port, sizeof(port),
NI_NUMERICHOST | NI_NUMERICSERV)) != 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, virSocketAddr *end,
if (start == NULL || end == NULL) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("NULL argument - %p %p"), start, end);
_("NULL argument - %1$p %2$p"), start, end);
return -1;
}
@ -882,7 +882,7 @@ virSocketAddrGetRange(virSocketAddr *start, virSocketAddr *end,
if (VIR_SOCKET_ADDR_FAMILY(start) != 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, virSocketAddr *end,
if (VIR_SOCKET_ADDR_FAMILY(start) != VIR_SOCKET_ADDR_FAMILY(network)) {
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,7 +905,7 @@ virSocketAddrGetRange(virSocketAddr *start, virSocketAddr *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 checking range %3$s - %4$s"),
prefix, netStr, startStr, endStr);
return -1;
}
@ -915,8 +914,7 @@ virSocketAddrGetRange(virSocketAddr *start, virSocketAddr *end,
if (virSocketAddrCheckNetmask(start, network, &netmask) <= 0 ||
virSocketAddrCheckNetmask(end, network, &netmask) <= 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 network %3$s/%4$d"),
startStr, endStr, netStr, prefix);
return -1;
}
@ -927,8 +925,7 @@ virSocketAddrGetRange(virSocketAddr *start, virSocketAddr *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;
}
@ -942,16 +939,14 @@ virSocketAddrGetRange(virSocketAddr *start, virSocketAddr *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;
}
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;
}
@ -964,8 +959,7 @@ virSocketAddrGetRange(virSocketAddr *start, virSocketAddr *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;
}
@ -976,7 +970,7 @@ virSocketAddrGetRange(virSocketAddr *start, virSocketAddr *end,
for (i = 0; i < 2; i++) {
if (t1[i] != 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;
}
@ -984,7 +978,7 @@ virSocketAddrGetRange(virSocketAddr *start, virSocketAddr *end,
ret = (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;
}
@ -995,8 +989,7 @@ virSocketAddrGetRange(virSocketAddr *start, virSocketAddr *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;
}
@ -1007,7 +1000,7 @@ virSocketAddrGetRange(virSocketAddr *start, virSocketAddr *end,
for (i = 0; i < 7; i++) {
if (t1[i] != 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;
}
@ -1015,15 +1008,14 @@ virSocketAddrGetRange(virSocketAddr *start, virSocketAddr *end,
ret = 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;
}

View File

@ -90,7 +90,7 @@ int virStorageFileGetSCSIKey(const char *path,
bool ignoreError)
{
if (!ignoreError)
virReportSystemError(ENOSYS, _("Unable to get SCSI key for %s"), path);
virReportSystemError(ENOSYS, _("Unable to get SCSI key for %1$s"), path);
return -1;
}
#endif

View File

@ -598,13 +598,13 @@ virStringSearch(const char *str,
regex = 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;
}
if (g_regex_get_capture_count(regex) != 1) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Regular expression '%s' must have exactly 1 match group, not %d"),
_("Regular expression '%1$s' must have exactly 1 match group, not %2$d"),
regexp, g_regex_get_capture_count(regex));
goto cleanup;
}
@ -982,13 +982,13 @@ virStringParsePort(const char *str,
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;
}
if (p > UINT16_MAX) {
virReportError(VIR_ERR_INVALID_ARG,
_("port '%s' out of range"), str);
_("port '%1$s' out of range"), str);
return -1;
}

View File

@ -319,7 +319,7 @@ virSysinfoReadPPC(void)
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;
}
@ -445,7 +445,7 @@ virSysinfoReadARM(void)
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;
}
@ -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;
}
@ -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;
}
@ -1537,7 +1537,7 @@ virSysinfoFormat(virBuffer *buf, virSysinfoDef *def)
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 source %3$s"), \
desc, NULLSTR(dst->name), NULLSTR(src->name)); \
return false; \
} \
@ -1680,7 +1680,7 @@ bool virSysinfoIsEqual(virSysinfoDef *src,
if (src->type != 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,
if (src->nbaseBoard != dst->nbaseBoard) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Target sysinfo base board count '%zu' does not match source '%zu'"),
_("Target sysinfo base board count '%1$zu' does not match source '%2$zu'"),
dst->nbaseBoard, src->nbaseBoard);
return false;
}

View File

@ -766,7 +766,7 @@ virSystemdActivationInitFromNames(virSystemdActivation *act,
if (g_strv_length(fdnamelistptr) != 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;
}

View File

@ -69,7 +69,7 @@ virThreadJobSetWorker(const char *worker)
if (virThreadLocalSet(&virThreadJobWorker, (void *) worker) < 0)
virReportSystemError(errno,
_("cannot set worker name to %s"),
_("cannot set worker name to %1$s"),
worker);
VIR_DEBUG("Thread %llu is running worker %s", virThreadSelfID(), worker);
@ -86,7 +86,7 @@ virThreadJobSet(const char *caller)
if (virThreadLocalSet(&virThreadJobName, (void *) caller) < 0)
virReportSystemError(errno,
_("cannot set current job to %s"),
_("cannot set current job to %1$s"),
caller);
if ((worker = virThreadLocalGet(&virThreadJobWorker))) {

View File

@ -72,7 +72,7 @@ virTPMCreateCancelPath(const char *devpath)
if (!(dev = strrchr(devpath, '/'))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("TPM device path %s is invalid"), devpath);
_("TPM device path %1$s is invalid"), devpath);
return NULL;
}
@ -243,7 +243,7 @@ virTPMExecGetCaps(virCommand *cmd,
error_bad_json:
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unexpected JSON format: %s"), outbuf);
_("Unexpected JSON format: %1$s"), outbuf);
return bitmap;
}
@ -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 in $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 = g_steal_pointer(&path);

View File

@ -35,13 +35,13 @@ virTypedParameterAssignFromStr(virTypedParameterPtr param,
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;
}
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 long"),
name);
return -1;
}
@ -51,7 +51,7 @@ virTypedParameterAssignFromStr(virTypedParameterPtr param,
case VIR_TYPED_PARAM_INT:
if (virStrToLong_i(val, NULL, 10, &param->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, &param->value.ui) < 0) {
virReportError(VIR_ERR_INVALID_ARG,
_("Invalid value for field '%s': "
"expected unsigned int"),
_("Invalid value for field '%1$s': expected unsigned int"),
name);
return -1;
}
@ -68,8 +67,7 @@ virTypedParameterAssignFromStr(virTypedParameterPtr param,
case VIR_TYPED_PARAM_LLONG:
if (virStrToLong_ll(val, NULL, 10, &param->value.l) < 0) {
virReportError(VIR_ERR_INVALID_ARG,
_("Invalid value for field '%s': "
"expected long long"),
_("Invalid value for field '%1$s': expected long long"),
name);
return -1;
}
@ -77,8 +75,7 @@ virTypedParameterAssignFromStr(virTypedParameterPtr param,
case VIR_TYPED_PARAM_ULLONG:
if (virStrToLong_ull(val, NULL, 10, &param->value.ul) < 0) {
virReportError(VIR_ERR_INVALID_ARG,
_("Invalid value for field '%s': "
"expected unsigned long long"),
_("Invalid value for field '%1$s': expected unsigned long long"),
name);
return -1;
}
@ -86,8 +83,7 @@ virTypedParameterAssignFromStr(virTypedParameterPtr param,
case VIR_TYPED_PARAM_DOUBLE:
if (virStrToDouble(val, NULL, &param->value.d) < 0) {
virReportError(VIR_ERR_INVALID_ARG,
_("Invalid value for field '%s': "
"expected double"),
_("Invalid value for field '%1$s': expected double"),
name);
return -1;
}
@ -99,7 +95,7 @@ virTypedParameterAssignFromStr(virTypedParameterPtr param,
param->value.b = false;
} else {
virReportError(VIR_ERR_INVALID_ARG,
_("Invalid boolean value for field '%s'"), name);
_("Invalid boolean value for field '%1$s'"), name);
return -1;
}
break;
@ -108,7 +104,7 @@ virTypedParameterAssignFromStr(virTypedParameterPtr param,
break;
default:
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unexpected type %d for field %s"), type, name);
_("unexpected type %1$d for field %2$s"), type, name);
return -1;
}
@ -154,8 +150,7 @@ virTypedParamsGet(virTypedParameterPtr params,
#define VIR_TYPED_PARAM_CHECK_TYPE(check_type) \
do { if (param->type != 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)); \

View File

@ -81,7 +81,7 @@ virTypedParamsValidate(virTypedParameterPtr params, int nparams, ...)
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;
}
@ -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 = 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, ...)
if (j == nkeys && i != 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);
}
@ -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, const char *name,
int ret = -1;
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 long"),
name);
return -1;
}
@ -322,7 +321,7 @@ virTypedParamsReplaceString(virTypedParameterPtr *params,
if (param) {
if (param->type != 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 _virTypedParameterRemote *remote_params,
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 _virTypedParameterRemote *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 _virTypedParameterRemote *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 _virTypedParameterRemote *remote_params,
param->value.s = g_strdup(remote_param->value.remote_typed_param_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,
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 = g_strdup(param->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;
}

View File

@ -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;
}
@ -302,16 +302,15 @@ virURIFindAliasMatch(char *const*aliases, const char *alias,
if (!(offset = strchr(*aliases, '='))) {
virReportError(VIR_ERR_CONF_SYNTAX,
_("Malformed 'uri_aliases' config entry '%s', "
"expected 'alias=uri://host/path'"), *aliases);
_("Malformed 'uri_aliases' config entry '%1$s', expected 'alias=uri://host/path'"),
*aliases);
return -1;
}
safe = 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)
}
virReportError(VIR_ERR_INVALID_ARG,
_("Missing URI parameter '%s'"), name);
_("Missing URI parameter '%1$s'"), name);
return NULL;
}

View File

@ -95,7 +95,7 @@ static int virUSBSysReadFile(const char *f_name, const char *d_name,
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;
}
@ -145,7 +145,7 @@ virUSBDeviceSearch(unsigned int vendor,
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,
}
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Did not find USB device %04x:%04x"), vendor, product);
_("Did not find USB device %1$04x:%2$04x"), vendor, product);
return -1;
}
@ -249,7 +249,7 @@ virUSBDeviceFindByBus(unsigned int bus,
}
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,
}
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 device:%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) >= 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) >= 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;
}

View File

@ -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 = "";
@ -189,7 +189,7 @@ virScaleInteger(unsigned long long *value, const char *suffix,
base = 1000;
} else {
virReportError(VIR_ERR_INVALID_ARG,
_("unknown suffix '%s'"), suffix);
_("unknown suffix '%1$s'"), suffix);
return -1;
}
scale = 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;
}
}
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, char **dir, char **shell, bo
goto cleanup;
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 == NULL) {
@ -583,7 +583,7 @@ virGetUserEnt(uid_t uid, char **name, gid_t *group, char **dir, char **shell, bo
goto cleanup;
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 != 0 || gr == NULL) {
if (rc != 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);
}
@ -757,7 +757,7 @@ virGetUserID(const char *user, uid_t *uid)
if (virStrToLong_ui(user, NULL, 10, &uint_uid) < 0 ||
((uid_t) uint_uid) != 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)
if (virStrToLong_ui(group, NULL, 10, &uint_gid) < 0 ||
((gid_t) uint_gid) != 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 != (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,
if (uid != (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 *groups, int ngroups,
capng_clear(CAPNG_SELECT_CAPS);
} else {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot apply process capabilities %d"), capng_ret);
_("cannot apply process capabilities %1$d"), capng_ret);
return -1;
}
}
@ -1188,8 +1188,7 @@ virSetUIDGIDWithCaps(uid_t uid, gid_t gid, gid_t *groups, 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 the AMBIENT set"),
capstr);
return -1;
}
@ -1215,7 +1214,7 @@ virSetUIDGIDWithCaps(uid_t uid, gid_t gid, gid_t *groups, int ngroups,
if ((capng_ret = capng_apply(CAPNG_SELECT_CAPS)) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot apply process capabilities %d"), capng_ret);
_("cannot apply process capabilities %1$d"), capng_ret);
return -1;
}
@ -1273,7 +1272,7 @@ virValidateWWN(const char *wwn)
if (i != 16 || p[i]) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Malformed wwn: %s"), wwn);
_("Malformed wwn: %1$s"), wwn);
return false;
}
@ -1308,7 +1307,7 @@ virParseOwnershipIds(const char *label, uid_t *uidPtr, gid_t *gidPtr)
sep = strchr(tmp_label, ':');
if (sep == 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;
}

View File

@ -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;
}
@ -251,8 +251,7 @@ virVHBAManageVport(const int parent_host,
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,
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 create/delete failed"),
vport_name, operation_path);
return -1;
}

View File

@ -276,7 +276,7 @@ virXMLCheckIllegalChars(const char *nodeName,
char *c;
if ((c = 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,
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);
return ret;
@ -345,7 +345,7 @@ virXMLNodeContentString(xmlNodePtr node)
if (node->type != 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)
if (!ret) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("node '%s' has unexpected NULL content. This could be caused by malformed input, or a memory allocation failure"),
_("node '%1$s' has unexpected NULL content. This could be caused by malformed input, or a memory allocation failure"),
node->name);
return NULL;
}
@ -382,7 +382,7 @@ virXMLPropEnumInternal(xmlNodePtr node,
return 0;
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 == 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;
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;
}
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;
}
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;
}
if ((flags & VIR_XML_PROP_NONZERO) && (val == 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;
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,
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;
}
if ((flags & VIR_XML_PROP_NONZERO) && (val == 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;
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;
}
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;
}
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;
}
if ((flags & VIR_XML_PROP_NONZERO) && (val == 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;
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,
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;
}
if ((flags & VIR_XML_PROP_NONZERO) && (val == 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;
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;
}
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,
if (obj->type != XPATH_NODESET) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Incorrect xpath '%s'"), xpath);
_("Incorrect xpath '%1$s'"), xpath);
return -1;
}
@ -1050,7 +1050,7 @@ catchXMLError(void *ctx, const char *msg G_GNUC_UNUSED, ...)
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_UNUSED, ...)
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() == VIR_ERR_OK) {
virGenericReportError(domcode, VIR_ERR_XML_ERROR,
_("failed to parse xml document '%s'"),
_("failed to parse xml document '%1$s'"),
docname);
}
@ -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;
}
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 =
xmlRelaxNGNewParserCtxt(validator->schemafile))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to create RelaxNG parser for schema '%s'"),
_("Unable to create RelaxNG parser for schema '%1$s'"),
validator->schemafile);
return NULL;
}
@ -1575,7 +1575,7 @@ virXMLValidatorInit(const char *schemafile)
if (!(validator->rng = xmlRelaxNGParse(validator->rngParser))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to parse RelaxNG schema '%s': %s"),
_("Unable to parse RelaxNG schema '%1$s': %2$s"),
validator->schemafile,
virBufferCurrentContent(&validator->buf));
return NULL;
@ -1583,7 +1583,7 @@ virXMLValidatorInit(const char *schemafile)
if (!(validator->rngValid = xmlRelaxNGNewValidCtxt(validator->rng))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to create RelaxNG validation context for schema '%s'"),
_("Unable to create RelaxNG validation context for schema '%1$s'"),
validator->schemafile);
return NULL;
}
@ -1603,7 +1603,7 @@ virXMLValidatorValidate(virXMLValidator *validator,
{
if (xmlRelaxNGValidateDoc(validator->rngValid, doc) != 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,
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;
}