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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
*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;
}
}
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);
}
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;
}
if (ioctl(fd, SIOCBRADDBR, brname) < 0) {
virReportSystemError(errno,
- _("Unable to create bridge %s"), brname);
+ _("Unable to create bridge %1$s"), brname);
return -1;
}
}
# endif
if (error < 0)
- virReportSystemError(-error, _("error creating bridge interface %s"),
+ virReportSystemError(-error, _("error creating bridge interface %1$s"),
brname);
return -1;
const virMacAddr *mac G_GNUC_UNUSED)
{
virReportSystemError(ENOSYS,
- _("Unable to create bridge %s"), brname);
+ _("Unable to create bridge %1$s"), brname);
return -1;
}
#endif
if (ioctl(fd, SIOCBRDELBR, brname) < 0) {
virReportSystemError(errno,
- _("Unable to delete bridge %s"), brname);
+ _("Unable to delete bridge %1$s"), brname);
return -1;
}
if (ioctl(s, SIOCIFDESTROY, &ifr) < 0) {
virReportSystemError(errno,
- _("Unable to remove bridge %s"),
+ _("Unable to remove bridge %1$s"),
brname);
return -1;
}
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
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;
}
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;
}
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
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;
}
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;
}
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
if (virNetDevBridgeCmd(brname, BRDGSFD, ¶m, sizeof(param)) < 0) {
virReportSystemError(errno,
- _("Unable to set STP delay on %s"), brname);
+ _("Unable to set STP delay on %1$s"), brname);
return -1;
}
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;
}
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;
}
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;
}
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;
}
{
virReportSystemError(ENOSYS,
- _("Unable to set STP on %s on this platform"),
+ _("Unable to set STP on %1$s on this platform"),
brname);
return -1;
}
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;
}
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;
}
}
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;
}
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 : "",
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;
}
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;
}
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;
}
*/
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;
}
}
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;
}
if (getifaddrs(&ifap) < 0) {
virReportSystemError(errno,
- _("Could not get interface list for '%s'"),
+ _("Could not get interface list for '%1$s'"),
ifname);
return -1;
}
}
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("no IP address found for interface '%s'"),
+ _("no IP address found for interface '%1$s'"),
ifname);
cleanup:
freeifaddrs(ifap);
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;
}
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;
}
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;
} 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;
}
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;
}
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;
}
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;
}
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;
}
/* 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;
}
/* 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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
}
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;
}
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;
}
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;
}
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;
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;
}
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;
}
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;
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;
}
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;
}
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;
}
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;
}
if ((*tapfd = open(dev_path, O_RDWR)) < 0) {
virReportSystemError(errno,
- _("Unable to open %s"),
+ _("Unable to open %1$s"),
dev_path);
goto cleanup;
}
if (ioctl(s, SIOCIFDESTROY, &ifr) < 0) {
virReportSystemError(errno,
- _("Unable to remove tap device %s"),
+ _("Unable to remove tap device %1$s"),
ifname);
goto cleanup;
}
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;
return 0;
}
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to delete veth device %s"), veth);
+ _("Failed to delete veth device %1$s"), veth);
return -1;
}
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;
}
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;
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;
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;
}
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;
}
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;
}
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;
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;
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;
}
}
} else {
virReportSystemError(errno,
- _("Error opening file %s"), LLDPAD_PID_FILE);
+ _("Error opening file %1$s"), LLDPAD_PID_FILE);
}
VIR_FORCE_CLOSE(fd);
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,
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;
}
/* 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;
break;
default:
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("operation type %d not supported"), virtPortOp);
+ _("operation type %1$d not supported"), virtPortOp);
return -1;
}
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:
}
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;
}
if (protocol >= MAX_LINKS) {
virReportSystemError(EINVAL,
- _("invalid protocol argument: %d"), protocol);
+ _("invalid protocol argument: %1$d"), protocol);
goto error;
}
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;
}
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;
}
{
if (protocol >= MAX_LINKS) {
virReportSystemError(EINVAL,
- _("invalid protocol argument: %d"), protocol);
+ _("invalid protocol argument: %1$d"), protocol);
return false;
}
if (protocol >= MAX_LINKS) {
virReportSystemError(EINVAL,
- _("invalid protocol argument: %d"), protocol);
+ _("invalid protocol argument: %1$d"), protocol);
return -EINVAL;
}
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;
}
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);
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;
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;
}
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;
}
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;
}
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 (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;
}
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;
}
continue;
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("NUMA node %zd is unavailable"), bit);
+ _("NUMA node %1$zd is unavailable"), bit);
return false;
}
return true;
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;
}
/* 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;
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;
}
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;
}
/* 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) {
} 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;
}
if (!virClassIsDerivedFrom(klass, virClassForObjectLockable())) {
virReportInvalidArg(klass,
- _("Class %s must derive from virObjectLockable"),
+ _("Class %1$s must derive from virObjectLockable"),
virClassName(klass));
return NULL;
}
if (!virClassIsDerivedFrom(klass, virClassForObjectRWLockable())) {
virReportInvalidArg(klass,
- _("Class %s must derive from virObjectRWLockable"),
+ _("Class %1$s must derive from virObjectRWLockable"),
virClassName(klass));
return NULL;
}
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;
}
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",
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;
}
*/
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;
}
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;
}
*/
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;
}
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;
}
/* 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;
}
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;
}
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;
}
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"));
*/
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);
}
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;
}
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;
}
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;
}
/* 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;
}
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;
}
{
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;
}
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;
}
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;
}
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;
}
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;
}
{
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);
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
}
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;
}
* 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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
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);
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);
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);
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);
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);
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;
}
_("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",
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;
}
*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;
}
/* 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;
}
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;
}
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;
}
}
{
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;
}
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;
}
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;
}
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;
}
char *
virProcessTranslateStatus(int status)
{
- return g_strdup_printf(_("invalid value %d"), status);
+ return g_strdup_printf(_("invalid value %1$d"), status);
}
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;
}
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;
}
}
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;
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;
}
}
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;
}
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;
}
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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__,
"%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);
}
}
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;
}
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;
}
if (sched_setscheduler(pid, pol, ¶m) < 0) {
virReportSystemError(errno,
- _("Cannot set scheduler parameters for pid %lld"),
+ _("Cannot set scheduler parameters for pid %1$lld"),
(long long) pid);
return -1;
}
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;
}
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;
}
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;
}
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;
}
} 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;
}
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;
}
{
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;
}
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;
}
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;
}
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) {
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;
}
!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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
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;
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;
}
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;
}
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;
}
{
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;
}
{
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;
}
if (g_mkdir_with_parents(path, 0777) < 0) {
virReportSystemError(errno,
- _("Cannot create resctrl directory '%s'"),
+ _("Cannot create resctrl directory '%1$s'"),
path);
return -1;
}
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;
}
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;
}
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;
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;
}
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;
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)
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;
}
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;
}
}
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;
}
if (unlink(file->basepath) < 0 &&
errno != ENOENT) {
virReportSystemError(errno,
- _("Unable to delete file %s"),
+ _("Unable to delete file %1$s"),
file->basepath);
return -1;
}
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;
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;
}
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;
}
if (unlink(file->basepath) < 0 &&
errno != ENOENT) {
virReportSystemError(errno,
- _("Unable to remove %s"),
+ _("Unable to remove %1$s"),
file->basepath);
goto cleanup;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
{
if (virSCSIDeviceListFind(list, dev)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Device %s already exists"),
+ _("Device %1$s already exists"),
dev->name);
return -1;
}
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;
}
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;
}
{
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;
}
*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;
}
{
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);
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;
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;
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;
if (res == NULL) {
virReportError(VIR_ERR_SYSTEM_ERROR,
- _("No socket addresses found for '%s'"),
+ _("No socket addresses found for '%1$s'"),
val);
return -1;
}
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;
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;
}
}
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:
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
*/
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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
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;
}
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;
}
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;
}
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;
}
/* 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;
}
/* 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;
}
if (!type) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("unexpected sysinfo type model %d"),
+ _("unexpected sysinfo type model %1$d"),
def->type);
return -1;
}
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; \
} \
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;
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;
}
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;
}
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);
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))) {
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;
}
error_bad_json:
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unexpected JSON format: %s"), outbuf);
+ _("Unexpected JSON format: %1$s"), outbuf);
return bitmap;
}
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);
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;
}
case VIR_TYPED_PARAM_INT:
if (virStrToLong_i(val, NULL, 10, ¶m->value.i) < 0) {
virReportError(VIR_ERR_INVALID_ARG,
- _("Invalid value for field '%s': expected int"),
+ _("Invalid value for field '%1$s': expected int"),
name);
return -1;
}
case VIR_TYPED_PARAM_UINT:
if (virStrToLong_ui(val, NULL, 10, ¶m->value.ui) < 0) {
virReportError(VIR_ERR_INVALID_ARG,
- _("Invalid value for field '%s': "
- "expected unsigned int"),
+ _("Invalid value for field '%1$s': expected unsigned int"),
name);
return -1;
}
case VIR_TYPED_PARAM_LLONG:
if (virStrToLong_ll(val, NULL, 10, ¶m->value.l) < 0) {
virReportError(VIR_ERR_INVALID_ARG,
- _("Invalid value for field '%s': "
- "expected long long"),
+ _("Invalid value for field '%1$s': expected long long"),
name);
return -1;
}
case VIR_TYPED_PARAM_ULLONG:
if (virStrToLong_ull(val, NULL, 10, ¶m->value.ul) < 0) {
virReportError(VIR_ERR_INVALID_ARG,
- _("Invalid value for field '%s': "
- "expected unsigned long long"),
+ _("Invalid value for field '%1$s': expected unsigned long long"),
name);
return -1;
}
case VIR_TYPED_PARAM_DOUBLE:
if (virStrToDouble(val, NULL, ¶m->value.d) < 0) {
virReportError(VIR_ERR_INVALID_ARG,
- _("Invalid value for field '%s': "
- "expected double"),
+ _("Invalid value for field '%1$s': expected double"),
name);
return -1;
}
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;
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;
}
#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)); \
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;
}
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;
}
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;
if (j == nkeys && i != nparams) {
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED,
- _("parameter '%s' not supported"),
+ _("parameter '%1$s' not supported"),
sorted[i].field);
goto cleanup;
}
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);
}
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;
}
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;
}
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;
}
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;
}
/* 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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
}
virReportError(VIR_ERR_INVALID_ARG,
- _("Missing URI parameter '%s'"), name);
+ _("Missing URI parameter '%1$s'"), name);
return NULL;
}
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;
}
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;
}
}
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;
}
}
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;
}
}
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;
}
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;
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;
{
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;
}
if (!suffix || !*suffix) {
if (!scale) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("invalid scale %llu"), scale);
+ _("invalid scale %1$llu"), scale);
return -1;
}
suffix = "";
base = 1000;
} else {
virReportError(VIR_ERR_INVALID_ARG,
- _("unknown suffix '%s'"), suffix);
+ _("unknown suffix '%1$s'"), suffix);
return -1;
}
scale = 1;
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;
}
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) {
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;
}
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);
}
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;
}
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;
}
{
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;
}
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;
}
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;
}
}
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;
}
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;
}
if (i != 16 || p[i]) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Malformed wwn: %s"), wwn);
+ _("Malformed wwn: %1$s"), wwn);
return false;
}
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;
}
break;
default:
virReportError(VIR_ERR_OPERATION_INVALID,
- _("Invalid vport operation (%d)"), operation);
+ _("Invalid vport operation (%1$d)"), operation);
return -1;
}
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;
}
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;
}
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;
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;
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;
}
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;
}
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 (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;
}
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;
}
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 (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;
}
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;
}
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 (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;
}
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;
}
if (obj->type != XPATH_NODESET) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Incorrect xpath '%s'"), xpath);
+ _("Incorrect xpath '%1$s'"), xpath);
return -1;
}
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,
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,
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);
}
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;
}
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;
}
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;
}
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;
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;
}
{
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;
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;
}
if (!required)
return 0;
virReportError(VIR_ERR_XML_ERROR,
- _("missing element or attribute '%s'"),
+ _("missing element or attribute '%1$s'"),
xpath);
return -1;
}
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;
}