if (ifkey == NULL || strlen(ifkey) != VIR_IFKEY_LEN - 1) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("virNWFilterSnoopReqNew called with invalid "
- "key \"%s\" (%zu)"),
+ _("virNWFilterSnoopReqNew called with invalid key \"%1$s\" (%2$zu)"),
NULLSTR_EMPTY(ifkey),
ifkey ? strlen(ifkey) : 0);
return NULL;
pcap_set_immediate_mode(handle, 1) < 0 ||
pcap_activate(handle) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("setup of pcap handle failed: %s"),
+ _("setup of pcap handle failed: %1$s"),
pcap_geterr(handle));
goto cleanup;
}
if (pcap_compile(handle, &fp, ext_filter, 1, PCAP_NETMASK_UNKNOWN) != 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("pcap_compile: %s"), pcap_geterr(handle));
+ _("pcap_compile: %1$s"), pcap_geterr(handle));
goto cleanup;
}
if (pcap_setfilter(handle, &fp) != 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("pcap_setfilter: %s"), pcap_geterr(handle));
+ _("pcap_setfilter: %1$s"), pcap_geterr(handle));
goto cleanup_freecode;
}
if (pcap_setdirection(handle, dir) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("pcap_setdirection: %s"),
+ _("pcap_setdirection: %1$s"),
pcap_geterr(handle));
goto cleanup_freecode;
}
req->jobCompletionStatus = -1;
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Instantiation of rules failed on "
- "interface '%s'"), req->binding->portdevname);
+ _("Instantiation of rules failed on interface '%1$s'"),
+ req->binding->portdevname);
}
ignore_value(!!g_atomic_int_dec_and_test(job->qCtr));
}
/* protect req->binding->portdevname */
VIR_WITH_MUTEX_LOCK_GUARD(&req->lock) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("interface '%s' failing; reopening"),
+ _("interface '%1$s' failing; reopening"),
req->binding->portdevname);
if (req->binding->portdevname)
pcapConf[i].handle =
pcapConf[i].dir,
&pcapConf[i].qCtr) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Job submission failed on "
- "interface '%s'"), req->binding->portdevname);
+ _("Job submission failed on interface '%1$s'"),
+ req->binding->portdevname);
error = true;
break;
}
req->binding->portdevname,
req->ifkey) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("virNWFilterDHCPSnoopReq ifname map failed"
- " on interface \"%s\" key \"%s\""), binding->portdevname,
+ _("virNWFilterDHCPSnoopReq ifname map failed on interface \"%1$s\" key \"%2$s\""),
+ binding->portdevname,
ifkey);
goto exit_snoopunlock;
}
if (isnewreq &&
virHashAddEntry(virNWFilterSnoopState.snoopReqs, ifkey, req) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("virNWFilterDHCPSnoopReq req add failed on"
- " interface \"%s\" ifkey \"%s\""), binding->portdevname,
+ _("virNWFilterDHCPSnoopReq req add failed on interface \"%1$s\" ifkey \"%2$s\""),
+ binding->portdevname,
ifkey);
goto exit_rem_ifnametokey;
}
if (virThreadCreateFull(&thread, false, virNWFilterDHCPSnoopThread,
"dhcp-snoop", false, req) != 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("virNWFilterDHCPSnoopReq virThreadCreate "
- "failed on interface '%s'"), binding->portdevname);
+ _("virNWFilterDHCPSnoopReq virThreadCreate failed on interface '%1$s'"),
+ binding->portdevname);
goto exit_snoopreq_unlock;
}
req->threadkey = virNWFilterSnoopActivate(req);
if (!req->threadkey) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Activation of snoop request failed on "
- "interface '%s'"), req->binding->portdevname);
+ _("Activation of snoop request failed on interface '%1$s'"),
+ req->binding->portdevname);
goto exit_snoopreq_unlock;
}
if (virNWFilterSnoopReqRestore(req) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Restoring of leases failed on "
- "interface '%s'"), req->binding->portdevname);
+ _("Restoring of leases failed on interface '%1$s'"),
+ req->binding->portdevname);
goto exit_snoop_cancel;
}
int tfd;
if (g_mkdir_with_parents(LEASEFILE_DIR, 0700) < 0) {
- virReportError(errno, _("mkdir(\"%s\")"), LEASEFILE_DIR);
+ virReportError(errno, _("mkdir(\"%1$s\")"), LEASEFILE_DIR);
return;
}
if (unlink(TMPLEASEFILE) < 0 && errno != ENOENT)
- virReportSystemError(errno, _("unlink(\"%s\")"), TMPLEASEFILE);
+ virReportSystemError(errno, _("unlink(\"%1$s\")"), TMPLEASEFILE);
/* lease file loaded, delete old one */
tfd = open(TMPLEASEFILE, O_CREAT|O_RDWR|O_TRUNC|O_EXCL, 0644);
if (tfd < 0) {
- virReportSystemError(errno, _("open(\"%s\")"), TMPLEASEFILE);
+ virReportSystemError(errno, _("open(\"%1$s\")"), TMPLEASEFILE);
return;
}
}
if (VIR_CLOSE(tfd) < 0) {
- virReportSystemError(errno, _("unable to close %s"), TMPLEASEFILE);
+ virReportSystemError(errno, _("unable to close %1$s"), TMPLEASEFILE);
/* assuming the old lease file is still better, skip the renaming */
goto cleanup;
}
if (rename(TMPLEASEFILE, LEASEFILE) < 0) {
- virReportSystemError(errno, _("rename(\"%s\", \"%s\")"),
+ virReportSystemError(errno, _("rename(\"%1$s\", \"%2$s\")"),
TMPLEASEFILE, LEASEFILE);
unlink(TMPLEASEFILE);
}
if (line[strlen(line)-1] != '\n') {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("virNWFilterSnoopLeaseFileLoad lease file "
- "line %d corrupt"), ln);
+ _("virNWFilterSnoopLeaseFileLoad lease file line %1$d corrupt"),
+ ln);
break;
}
ln++;
if (sscanf(line, "%llu %54s %15s %15s",
&timeout, ifkey, ipstr, srvstr) < 4) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("virNWFilterSnoopLeaseFileLoad lease file "
- "line %d corrupt"), ln);
+ _("virNWFilterSnoopLeaseFileLoad lease file line %1$d corrupt"),
+ ln);
break;
}
ipl.timeout = timeout;
if (tmp < 0) {
virNWFilterSnoopReqPut(req);
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("virNWFilterSnoopLeaseFileLoad req add"
- " failed on interface \"%s\""), ifkey);
+ _("virNWFilterSnoopLeaseFileLoad req add failed on interface \"%1$s\""),
+ ifkey);
continue;
}
}
if (virSocketAddrParseIPv4(&ipl.ipAddress, ipstr) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("line %d corrupt ipaddr \"%s\""),
+ _("line %1$d corrupt ipaddr \"%2$s\""),
ln, ipstr);
virNWFilterSnoopReqPut(req);
continue;
req = virNWFilterSnoopReqGetByIFKey(ifkey);
if (!req) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("ifkey \"%s\" has no req"), ifkey);
+ _("ifkey \"%1$s\" has no req"), ifkey);
return;
}
driver->stateDir = g_strdup(RUNSTATEDIR "/libvirt/nwfilter");
if (g_mkdir_with_parents(driver->stateDir, S_IRWXU) < 0) {
- virReportSystemError(errno, _("cannot create state directory '%s'"),
+ virReportSystemError(errno, _("cannot create state directory '%1$s'"),
driver->stateDir);
goto error;
}
driver->configDir = g_strdup(SYSCONFDIR "/libvirt/nwfilter");
if (g_mkdir_with_parents(driver->configDir, S_IRWXU) < 0) {
- virReportSystemError(errno, _("cannot create config directory '%s'"),
+ virReportSystemError(errno, _("cannot create config directory '%1$s'"),
driver->configDir);
goto error;
}
driver->bindingDir = g_strdup(RUNSTATEDIR "/libvirt/nwfilter-binding");
if (g_mkdir_with_parents(driver->bindingDir, S_IRWXU) < 0) {
- virReportSystemError(errno, _("cannot create config directory '%s'"),
+ virReportSystemError(errno, _("cannot create config directory '%1$s'"),
driver->bindingDir);
goto error;
}
if (STRNEQ(conn->uri->path, "/system")) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("unexpected nwfilter URI path '%s', try nwfilter:///system"),
+ _("unexpected nwfilter URI path '%1$s', try nwfilter:///system"),
conn->uri->path);
return VIR_DRV_OPEN_ERROR;
}
if (!(obj = virNWFilterObjListFindByUUID(driver->nwfilters, uuid))) {
virUUIDFormat(uuid, uuidstr);
virReportError(VIR_ERR_NO_NWFILTER,
- _("no nwfilter with matching uuid '%s'"), uuidstr);
+ _("no nwfilter with matching uuid '%1$s'"), uuidstr);
}
return obj;
}
if (!obj) {
virReportError(VIR_ERR_NO_NWFILTER,
- _("no nwfilter with matching name '%s'"), name);
+ _("no nwfilter with matching name '%1$s'"), name);
return NULL;
}
def = virNWFilterObjGetDef(obj);
portdev);
if (!obj) {
virReportError(VIR_ERR_NO_NWFILTER_BINDING,
- _("no nwfilter binding for port dev '%s'"), portdev);
+ _("no nwfilter binding for port dev '%1$s'"), portdev);
goto cleanup;
}
binding->portdev);
if (!obj) {
virReportError(VIR_ERR_NO_NWFILTER_BINDING,
- _("no nwfilter binding for port dev '%s'"), binding->portdev);
+ _("no nwfilter binding for port dev '%1$s'"), binding->portdev);
goto cleanup;
}
obj = virNWFilterBindingObjListFindByPortDev(driver->bindings, binding->portdev);
if (!obj) {
virReportError(VIR_ERR_NO_NWFILTER_BINDING,
- _("no nwfilter binding for port dev '%s'"), binding->portdev);
+ _("no nwfilter binding for port dev '%1$s'"), binding->portdev);
return -1;
}
varName = virNWFilterVarAccessGetVarName(item->varAccess);
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Buffer too small to print variable "
- "'%s' into"), varName);
+ _("Buffer too small to print variable '%1$s' into"),
+ varName);
return -1;
}
case DATATYPE_STRINGCOPY:
case DATATYPE_BOOLEAN:
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Cannot print data type %x"), item->datatype);
+ _("Cannot print data type %1$x"), item->datatype);
return -1;
case DATATYPE_LAST:
default:
default:
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unexpected protocol %d"),
+ _("Unexpected protocol %1$d"),
rule->prtclType);
return -1;
}
if (reverse &&
HAS_ENTRY_ITEM(&rule->p.stpHdrFilter.ethHdr.dataSrcMACAddr)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("STP filtering in %s direction with "
- "source MAC address set is not supported"),
+ _("STP filtering in %1$s direction with source MAC address set is not supported"),
virNWFilterRuleDirectionTypeToString(
VIR_NWFILTER_RULE_DIRECTION_INOUT));
return -1;
default:
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unexpected rule protocol %d"),
+ _("Unexpected rule protocol %1$d"),
rule->prtclType);
return -1;
}
if (buffer[0] == '0') {
char msg[256];
g_snprintf(msg, sizeof(msg),
- _("To enable ip%stables filtering for the VM do "
- "'echo 1 > %s'"),
+ _("To enable ip%1$stables filtering for the VM do 'echo 1 > %2$s'"),
isIPv6 ? "6" : "",
pathname);
VIR_WARN("%s", msg);