interface: Update format strings in translated messages

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Jiri Denemark 2023-03-09 11:53:48 +01:00
parent 1d279b0abd
commit be664663fa
2 changed files with 76 additions and 74 deletions

View File

@ -117,7 +117,7 @@ netcfStateInitialize(bool privileged,
} }
if (g_mkdir_with_parents(driver->stateDir, S_IRWXU) < 0) { 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); driver->stateDir);
goto error; goto error;
} }
@ -299,12 +299,12 @@ static struct netcf_if *interfaceDriverGetNetcfIF(struct netcf *ncf, virInterfac
int errcode = ncf_error(ncf, &errmsg, &details); int errcode = ncf_error(ncf, &errmsg, &details);
if (errcode != NETCF_NOERROR) { if (errcode != NETCF_NOERROR) {
virReportError(netcf_to_vir_err(errcode), virReportError(netcf_to_vir_err(errcode),
_("couldn't find interface named '%s': %s%s%s"), _("couldn't find interface named '%1$s': %2$s%3$s%4$s"),
ifinfo->name, errmsg, details ? " - " : "", ifinfo->name, errmsg, details ? " - " : "",
NULLSTR_EMPTY(details)); NULLSTR_EMPTY(details));
} else { } else {
virReportError(VIR_ERR_NO_INTERFACE, virReportError(VIR_ERR_NO_INTERFACE,
_("couldn't find interface named '%s'"), _("couldn't find interface named '%1$s'"),
ifinfo->name); ifinfo->name);
} }
} }
@ -323,7 +323,7 @@ netcfInterfaceObjIsActive(struct netcf_if *iface,
const char *errmsg, *details; const char *errmsg, *details;
int errcode = ncf_error(driver->netcf, &errmsg, &details); int errcode = ncf_error(driver->netcf, &errmsg, &details);
virReportError(netcf_to_vir_err(errcode), virReportError(netcf_to_vir_err(errcode),
_("failed to get status of interface %s: %s%s%s"), _("failed to get status of interface %1$s: %2$s%3$s%4$s"),
ncf_if_name(iface), errmsg, details ? " - " : "", ncf_if_name(iface), errmsg, details ? " - " : "",
NULLSTR_EMPTY(details)); NULLSTR_EMPTY(details));
goto cleanup; goto cleanup;
@ -355,7 +355,7 @@ static int netcfConnectNumOfInterfacesImpl(virConnectPtr conn,
const char *errmsg, *details; const char *errmsg, *details;
int errcode = ncf_error(driver->netcf, &errmsg, &details); int errcode = ncf_error(driver->netcf, &errmsg, &details);
virReportError(netcf_to_vir_err(errcode), virReportError(netcf_to_vir_err(errcode),
_("failed to get number of host interfaces: %s%s%s"), _("failed to get number of host interfaces: %1$s%2$s%3$s"),
errmsg, details ? " - " : "", errmsg, details ? " - " : "",
NULLSTR_EMPTY(details)); NULLSTR_EMPTY(details));
goto cleanup; goto cleanup;
@ -372,7 +372,7 @@ static int netcfConnectNumOfInterfacesImpl(virConnectPtr conn,
const char *errmsg, *details; const char *errmsg, *details;
int errcode = ncf_error(driver->netcf, &errmsg, &details); int errcode = ncf_error(driver->netcf, &errmsg, &details);
virReportError(netcf_to_vir_err(errcode), virReportError(netcf_to_vir_err(errcode),
_("failed to list host interfaces: %s%s%s"), _("failed to list host interfaces: %1$s%2$s%3$s"),
errmsg, details ? " - " : "", errmsg, details ? " - " : "",
NULLSTR_EMPTY(details)); NULLSTR_EMPTY(details));
goto cleanup; goto cleanup;
@ -388,7 +388,7 @@ static int netcfConnectNumOfInterfacesImpl(virConnectPtr conn,
int errcode = ncf_error(driver->netcf, &errmsg, &details); int errcode = ncf_error(driver->netcf, &errmsg, &details);
if (errcode != NETCF_NOERROR) { if (errcode != NETCF_NOERROR) {
virReportError(netcf_to_vir_err(errcode), virReportError(netcf_to_vir_err(errcode),
_("couldn't find interface named '%s': %s%s%s"), _("couldn't find interface named '%1$s': %2$s%3$s%4$s"),
names[i], errmsg, names[i], errmsg,
details ? " - " : "", NULLSTR_EMPTY(details)); details ? " - " : "", NULLSTR_EMPTY(details));
goto cleanup; goto cleanup;
@ -441,7 +441,7 @@ static int netcfConnectListInterfacesImpl(virConnectPtr conn,
const char *errmsg, *details; const char *errmsg, *details;
int errcode = ncf_error(driver->netcf, &errmsg, &details); int errcode = ncf_error(driver->netcf, &errmsg, &details);
virReportError(netcf_to_vir_err(errcode), virReportError(netcf_to_vir_err(errcode),
_("failed to get number of host interfaces: %s%s%s"), _("failed to get number of host interfaces: %1$s%2$s%3$s"),
errmsg, details ? " - " : "", errmsg, details ? " - " : "",
NULLSTR_EMPTY(details)); NULLSTR_EMPTY(details));
goto cleanup; goto cleanup;
@ -458,7 +458,7 @@ static int netcfConnectListInterfacesImpl(virConnectPtr conn,
const char *errmsg, *details; const char *errmsg, *details;
int errcode = ncf_error(driver->netcf, &errmsg, &details); int errcode = ncf_error(driver->netcf, &errmsg, &details);
virReportError(netcf_to_vir_err(errcode), virReportError(netcf_to_vir_err(errcode),
_("failed to list host interfaces: %s%s%s"), _("failed to list host interfaces: %1$s%2$s%3$s"),
errmsg, details ? " - " : "", errmsg, details ? " - " : "",
NULLSTR_EMPTY(details)); NULLSTR_EMPTY(details));
goto cleanup; goto cleanup;
@ -479,7 +479,7 @@ static int netcfConnectListInterfacesImpl(virConnectPtr conn,
int errcode = ncf_error(driver->netcf, &errmsg, &details); int errcode = ncf_error(driver->netcf, &errmsg, &details);
if (errcode != NETCF_NOERROR) { if (errcode != NETCF_NOERROR) {
virReportError(netcf_to_vir_err(errcode), virReportError(netcf_to_vir_err(errcode),
_("couldn't find interface named '%s': %s%s%s"), _("couldn't find interface named '%1$s': %2$s%3$s%4$s"),
allnames[i], errmsg, allnames[i], errmsg,
details ? " - " : "", NULLSTR_EMPTY(details)); details ? " - " : "", NULLSTR_EMPTY(details));
goto cleanup; goto cleanup;
@ -624,7 +624,7 @@ netcfConnectListAllInterfaces(virConnectPtr conn,
int errcode = ncf_error(driver->netcf, &errmsg, &details); int errcode = ncf_error(driver->netcf, &errmsg, &details);
virReportError(netcf_to_vir_err(errcode), virReportError(netcf_to_vir_err(errcode),
_("failed to get number of host interfaces: %s%s%s"), _("failed to get number of host interfaces: %1$s%2$s%3$s"),
errmsg, details ? " - " : "", errmsg, details ? " - " : "",
NULLSTR_EMPTY(details)); NULLSTR_EMPTY(details));
goto cleanup; goto cleanup;
@ -643,7 +643,7 @@ netcfConnectListAllInterfaces(virConnectPtr conn,
int errcode = ncf_error(driver->netcf, &errmsg, &details); int errcode = ncf_error(driver->netcf, &errmsg, &details);
virReportError(netcf_to_vir_err(errcode), virReportError(netcf_to_vir_err(errcode),
_("failed to list host interfaces: %s%s%s"), _("failed to list host interfaces: %1$s%2$s%3$s"),
errmsg, details ? " - " : "", errmsg, details ? " - " : "",
NULLSTR_EMPTY(details)); NULLSTR_EMPTY(details));
goto cleanup; goto cleanup;
@ -661,7 +661,7 @@ netcfConnectListAllInterfaces(virConnectPtr conn,
int errcode = ncf_error(driver->netcf, &errmsg, &details); int errcode = ncf_error(driver->netcf, &errmsg, &details);
if (errcode != NETCF_NOERROR) { if (errcode != NETCF_NOERROR) {
virReportError(netcf_to_vir_err(errcode), virReportError(netcf_to_vir_err(errcode),
_("couldn't find interface named '%s': %s%s%s"), _("couldn't find interface named '%1$s': %2$s%3$s%4$s"),
names[i], errmsg, names[i], errmsg,
details ? " - " : "", NULLSTR_EMPTY(details)); details ? " - " : "", NULLSTR_EMPTY(details));
goto cleanup; goto cleanup;
@ -735,12 +735,12 @@ static virInterfacePtr netcfInterfaceLookupByName(virConnectPtr conn,
int errcode = ncf_error(driver->netcf, &errmsg, &details); int errcode = ncf_error(driver->netcf, &errmsg, &details);
if (errcode != NETCF_NOERROR) { if (errcode != NETCF_NOERROR) {
virReportError(netcf_to_vir_err(errcode), virReportError(netcf_to_vir_err(errcode),
_("couldn't find interface named '%s': %s%s%s"), _("couldn't find interface named '%1$s': %2$s%3$s%4$s"),
name, errmsg, name, errmsg,
details ? " - " : "", NULLSTR_EMPTY(details)); details ? " - " : "", NULLSTR_EMPTY(details));
} else { } else {
virReportError(VIR_ERR_NO_INTERFACE, virReportError(VIR_ERR_NO_INTERFACE,
_("couldn't find interface named '%s'"), name); _("couldn't find interface named '%1$s'"), name);
} }
goto cleanup; goto cleanup;
} }
@ -773,14 +773,14 @@ static virInterfacePtr netcfInterfaceLookupByMACString(virConnectPtr conn,
const char *errmsg, *details; const char *errmsg, *details;
int errcode = ncf_error(driver->netcf, &errmsg, &details); int errcode = ncf_error(driver->netcf, &errmsg, &details);
virReportError(netcf_to_vir_err(errcode), virReportError(netcf_to_vir_err(errcode),
_("couldn't find interface with MAC address '%s': %s%s%s"), _("couldn't find interface with MAC address '%1$s': %2$s%3$s%4$s"),
macstr, errmsg, details ? " - " : "", macstr, errmsg, details ? " - " : "",
NULLSTR_EMPTY(details)); NULLSTR_EMPTY(details));
goto cleanup; goto cleanup;
} }
if (niface == 0) { if (niface == 0) {
virReportError(VIR_ERR_NO_INTERFACE, virReportError(VIR_ERR_NO_INTERFACE,
_("couldn't find interface with MAC address '%s'"), _("couldn't find interface with MAC address '%1$s'"),
macstr); macstr);
goto cleanup; goto cleanup;
} }
@ -834,7 +834,7 @@ static char *netcfInterfaceGetXMLDesc(virInterfacePtr ifinfo,
const char *errmsg, *details; const char *errmsg, *details;
int errcode = ncf_error(driver->netcf, &errmsg, &details); int errcode = ncf_error(driver->netcf, &errmsg, &details);
virReportError(netcf_to_vir_err(errcode), virReportError(netcf_to_vir_err(errcode),
_("could not get interface XML description: %s%s%s"), _("could not get interface XML description: %1$s%2$s%3$s"),
errmsg, details ? " - " : "", errmsg, details ? " - " : "",
NULLSTR_EMPTY(details)); NULLSTR_EMPTY(details));
goto cleanup; goto cleanup;
@ -893,7 +893,7 @@ static virInterfacePtr netcfInterfaceDefineXML(virConnectPtr conn,
const char *errmsg, *details; const char *errmsg, *details;
int errcode = ncf_error(driver->netcf, &errmsg, &details); int errcode = ncf_error(driver->netcf, &errmsg, &details);
virReportError(netcf_to_vir_err(errcode), virReportError(netcf_to_vir_err(errcode),
_("could not get interface XML description: %s%s%s"), _("could not get interface XML description: %1$s%2$s%3$s"),
errmsg, details ? " - " : "", errmsg, details ? " - " : "",
NULLSTR_EMPTY(details)); NULLSTR_EMPTY(details));
goto cleanup; goto cleanup;
@ -932,7 +932,7 @@ static int netcfInterfaceUndefine(virInterfacePtr ifinfo)
const char *errmsg, *details; const char *errmsg, *details;
int errcode = ncf_error(driver->netcf, &errmsg, &details); int errcode = ncf_error(driver->netcf, &errmsg, &details);
virReportError(netcf_to_vir_err(errcode), virReportError(netcf_to_vir_err(errcode),
_("failed to undefine interface %s: %s%s%s"), _("failed to undefine interface %1$s: %2$s%3$s%4$s"),
ifinfo->name, errmsg, details ? " - " : "", ifinfo->name, errmsg, details ? " - " : "",
NULLSTR_EMPTY(details)); NULLSTR_EMPTY(details));
goto cleanup; goto cleanup;
@ -981,7 +981,7 @@ static int netcfInterfaceCreate(virInterfacePtr ifinfo,
const char *errmsg, *details; const char *errmsg, *details;
int errcode = ncf_error(driver->netcf, &errmsg, &details); int errcode = ncf_error(driver->netcf, &errmsg, &details);
virReportError(netcf_to_vir_err(errcode), virReportError(netcf_to_vir_err(errcode),
_("failed to create (start) interface %s: %s%s%s"), _("failed to create (start) interface %1$s: %2$s%3$s%4$s"),
ifinfo->name, errmsg, details ? " - " : "", ifinfo->name, errmsg, details ? " - " : "",
NULLSTR_EMPTY(details)); NULLSTR_EMPTY(details));
goto cleanup; goto cleanup;
@ -1030,7 +1030,7 @@ static int netcfInterfaceDestroy(virInterfacePtr ifinfo,
const char *errmsg, *details; const char *errmsg, *details;
int errcode = ncf_error(driver->netcf, &errmsg, &details); int errcode = ncf_error(driver->netcf, &errmsg, &details);
virReportError(netcf_to_vir_err(errcode), virReportError(netcf_to_vir_err(errcode),
_("failed to destroy (stop) interface %s: %s%s%s"), _("failed to destroy (stop) interface %1$s: %2$s%3$s%4$s"),
ifinfo->name, errmsg, details ? " - " : "", ifinfo->name, errmsg, details ? " - " : "",
NULLSTR_EMPTY(details)); NULLSTR_EMPTY(details));
goto cleanup; goto cleanup;
@ -1086,7 +1086,7 @@ static int netcfInterfaceChangeBegin(virConnectPtr conn, unsigned int flags)
const char *errmsg, *details; const char *errmsg, *details;
int errcode = ncf_error(driver->netcf, &errmsg, &details); int errcode = ncf_error(driver->netcf, &errmsg, &details);
virReportError(netcf_to_vir_err(errcode), virReportError(netcf_to_vir_err(errcode),
_("failed to begin transaction: %s%s%s"), _("failed to begin transaction: %1$s%2$s%3$s"),
errmsg, details ? " - " : "", errmsg, details ? " - " : "",
NULLSTR_EMPTY(details)); NULLSTR_EMPTY(details));
} }
@ -1110,7 +1110,7 @@ static int netcfInterfaceChangeCommit(virConnectPtr conn, unsigned int flags)
const char *errmsg, *details; const char *errmsg, *details;
int errcode = ncf_error(driver->netcf, &errmsg, &details); int errcode = ncf_error(driver->netcf, &errmsg, &details);
virReportError(netcf_to_vir_err(errcode), virReportError(netcf_to_vir_err(errcode),
_("failed to commit transaction: %s%s%s"), _("failed to commit transaction: %1$s%2$s%3$s"),
errmsg, details ? " - " : "", errmsg, details ? " - " : "",
NULLSTR_EMPTY(details)); NULLSTR_EMPTY(details));
} }
@ -1134,7 +1134,7 @@ static int netcfInterfaceChangeRollback(virConnectPtr conn, unsigned int flags)
const char *errmsg, *details; const char *errmsg, *details;
int errcode = ncf_error(driver->netcf, &errmsg, &details); int errcode = ncf_error(driver->netcf, &errmsg, &details);
virReportError(netcf_to_vir_err(errcode), virReportError(netcf_to_vir_err(errcode),
_("failed to rollback transaction: %s%s%s"), _("failed to rollback transaction: %1$s%2$s%3$s"),
errmsg, details ? " - " : "", errmsg, details ? " - " : "",
NULLSTR_EMPTY(details)); NULLSTR_EMPTY(details));
} }

View File

@ -148,7 +148,7 @@ udevNumOfInterfacesByStatus(virConnectPtr conn, virUdevStatus status,
if (!enumerate) { if (!enumerate) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to get number of %s interfaces on host"), _("failed to get number of %1$s interfaces on host"),
virUdevStatusString(status)); virUdevStatusString(status));
count = -1; count = -1;
goto cleanup; goto cleanup;
@ -200,7 +200,7 @@ udevListInterfacesByStatus(virConnectPtr conn,
if (!enumerate) { if (!enumerate) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to get list of %s interfaces on host"), _("failed to get list of %1$s interfaces on host"),
virUdevStatusString(status)); virUdevStatusString(status));
udev_unref(udev); udev_unref(udev);
return -1; return -1;
@ -314,7 +314,7 @@ udevConnectListAllInterfaces(virConnectPtr conn,
if (!enumerate) { if (!enumerate) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to get list of %s interfaces on host"), _("failed to get list of %1$s interfaces on host"),
virUdevStatusString(status)); virUdevStatusString(status));
goto cleanup; goto cleanup;
} }
@ -414,7 +414,7 @@ udevInterfaceLookupByName(virConnectPtr conn, const char *name)
dev = udev_device_new_from_subsystem_sysname(udev, "net", name); dev = udev_device_new_from_subsystem_sysname(udev, "net", name);
if (!dev) { if (!dev) {
virReportError(VIR_ERR_NO_INTERFACE, virReportError(VIR_ERR_NO_INTERFACE,
_("couldn't find interface named '%s'"), _("couldn't find interface named '%1$s'"),
name); name);
goto cleanup; goto cleanup;
} }
@ -448,7 +448,7 @@ udevInterfaceLookupByMACString(virConnectPtr conn, const char *macstr)
if (!enumerate) { if (!enumerate) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to lookup interface with MAC address '%s'"), _("failed to lookup interface with MAC address '%1$s'"),
macstr); macstr);
goto cleanup; goto cleanup;
} }
@ -465,7 +465,7 @@ udevInterfaceLookupByMACString(virConnectPtr conn, const char *macstr)
/* Check that we got something back */ /* Check that we got something back */
if (!dev_entry) { if (!dev_entry) {
virReportError(VIR_ERR_NO_INTERFACE, virReportError(VIR_ERR_NO_INTERFACE,
_("couldn't find interface with MAC address '%s'"), _("couldn't find interface with MAC address '%1$s'"),
macstr); macstr);
goto cleanup; goto cleanup;
} }
@ -473,7 +473,7 @@ udevInterfaceLookupByMACString(virConnectPtr conn, const char *macstr)
/* Check that we didn't get multiple items back */ /* Check that we didn't get multiple items back */
if (udev_list_entry_get_next(dev_entry)) { if (udev_list_entry_get_next(dev_entry)) {
virReportError(VIR_ERR_MULTIPLE_INTERFACES, virReportError(VIR_ERR_MULTIPLE_INTERFACES,
_("the MAC address '%s' matches multiple interfaces"), _("the MAC address '%1$s' matches multiple interfaces"),
macstr); macstr);
goto cleanup; goto cleanup;
} }
@ -568,12 +568,12 @@ udevGetIfaceDefBond(struct udev *udev,
tmp_str = udev_device_get_sysattr_value(dev, "bonding/downdelay"); tmp_str = udev_device_get_sysattr_value(dev, "bonding/downdelay");
if (!tmp_str) { if (!tmp_str) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not retrieve 'bonding/downdelay' for '%s'"), name); _("Could not retrieve 'bonding/downdelay' for '%1$s'"), name);
goto error; goto error;
} }
if (virStrToLong_i(tmp_str, NULL, 10, &tmp_int) < 0) { if (virStrToLong_i(tmp_str, NULL, 10, &tmp_int) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not parse 'bonding/downdelay' '%s' for '%s'"), _("Could not parse 'bonding/downdelay' '%1$s' for '%2$s'"),
tmp_str, name); tmp_str, name);
goto error; goto error;
} }
@ -582,12 +582,12 @@ udevGetIfaceDefBond(struct udev *udev,
tmp_str = udev_device_get_sysattr_value(dev, "bonding/updelay"); tmp_str = udev_device_get_sysattr_value(dev, "bonding/updelay");
if (!tmp_str) { if (!tmp_str) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not retrieve 'bonding/updelay' for '%s'"), name); _("Could not retrieve 'bonding/updelay' for '%1$s'"), name);
goto error; goto error;
} }
if (virStrToLong_i(tmp_str, NULL, 10, &tmp_int) < 0) { if (virStrToLong_i(tmp_str, NULL, 10, &tmp_int) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not parse 'bonding/updelay' '%s' for '%s'"), _("Could not parse 'bonding/updelay' '%1$s' for '%2$s'"),
tmp_str, name); tmp_str, name);
goto error; goto error;
} }
@ -596,12 +596,12 @@ udevGetIfaceDefBond(struct udev *udev,
tmp_str = udev_device_get_sysattr_value(dev, "bonding/miimon"); tmp_str = udev_device_get_sysattr_value(dev, "bonding/miimon");
if (!tmp_str) { if (!tmp_str) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not retrieve 'bonding/miimon' for '%s'"), name); _("Could not retrieve 'bonding/miimon' for '%1$s'"), name);
goto error; goto error;
} }
if (virStrToLong_i(tmp_str, NULL, 10, &tmp_int) < 0) { if (virStrToLong_i(tmp_str, NULL, 10, &tmp_int) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not parse 'bonding/miimon' '%s' for '%s'"), _("Could not parse 'bonding/miimon' '%1$s' for '%2$s'"),
tmp_str, name); tmp_str, name);
goto error; goto error;
} }
@ -610,12 +610,12 @@ udevGetIfaceDefBond(struct udev *udev,
tmp_str = udev_device_get_sysattr_value(dev, "bonding/arp_interval"); tmp_str = udev_device_get_sysattr_value(dev, "bonding/arp_interval");
if (!tmp_str) { if (!tmp_str) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not retrieve 'bonding/arp_interval' for '%s'"), name); _("Could not retrieve 'bonding/arp_interval' for '%1$s'"), name);
goto error; goto error;
} }
if (virStrToLong_i(tmp_str, NULL, 10, &tmp_int) < 0) { if (virStrToLong_i(tmp_str, NULL, 10, &tmp_int) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not parse 'bonding/arp_interval' '%s' for '%s'"), _("Could not parse 'bonding/arp_interval' '%1$s' for '%2$s'"),
tmp_str, name); tmp_str, name);
goto error; goto error;
} }
@ -629,24 +629,24 @@ udevGetIfaceDefBond(struct udev *udev,
tmp_str = udev_device_get_sysattr_value(dev, "bonding/mode"); tmp_str = udev_device_get_sysattr_value(dev, "bonding/mode");
if (!tmp_str) { if (!tmp_str) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not retrieve 'bonding/mode' for '%s'"), name); _("Could not retrieve 'bonding/mode' for '%1$s'"), name);
goto error; goto error;
} }
tmp_str = strchr(tmp_str, ' '); tmp_str = strchr(tmp_str, ' ');
if (!tmp_str) { if (!tmp_str) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Invalid format for 'bonding/mode' for '%s'"), name); _("Invalid format for 'bonding/mode' for '%1$s'"), name);
goto error; goto error;
} }
if (strlen(tmp_str) < 2) { if (strlen(tmp_str) < 2) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to find correct value in 'bonding/mode' for '%s'"), _("Unable to find correct value in 'bonding/mode' for '%1$s'"),
name); name);
goto error; goto error;
} }
if (virStrToLong_i(tmp_str + 1, NULL, 10, &tmp_int) < 0) { if (virStrToLong_i(tmp_str + 1, NULL, 10, &tmp_int) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not parse 'bonding/mode' '%s' for '%s'"), _("Could not parse 'bonding/mode' '%1$s' for '%2$s'"),
tmp_str, name); tmp_str, name);
goto error; goto error;
} }
@ -659,24 +659,24 @@ udevGetIfaceDefBond(struct udev *udev,
tmp_str = udev_device_get_sysattr_value(dev, "bonding/arp_validate"); tmp_str = udev_device_get_sysattr_value(dev, "bonding/arp_validate");
if (!tmp_str) { if (!tmp_str) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not retrieve 'bonding/arp_validate' for '%s'"), name); _("Could not retrieve 'bonding/arp_validate' for '%1$s'"), name);
goto error; goto error;
} }
tmp_str = strchr(tmp_str, ' '); tmp_str = strchr(tmp_str, ' ');
if (!tmp_str) { if (!tmp_str) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Invalid format for 'bonding/arp_validate' for '%s'"), name); _("Invalid format for 'bonding/arp_validate' for '%1$s'"), name);
goto error; goto error;
} }
if (strlen(tmp_str) < 2) { if (strlen(tmp_str) < 2) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to find correct value in 'bonding/arp_validate' " _("Unable to find correct value in 'bonding/arp_validate' for '%1$s'"),
"for '%s'"), name); name);
goto error; goto error;
} }
if (virStrToLong_i(tmp_str + 1, NULL, 10, &tmp_int) < 0) { if (virStrToLong_i(tmp_str + 1, NULL, 10, &tmp_int) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not parse 'bonding/arp_validate' '%s' for '%s'"), _("Could not parse 'bonding/arp_validate' '%1$s' for '%2$s'"),
tmp_str, name); tmp_str, name);
goto error; goto error;
} }
@ -686,12 +686,12 @@ udevGetIfaceDefBond(struct udev *udev,
tmp_str = udev_device_get_sysattr_value(dev, "bonding/use_carrier"); tmp_str = udev_device_get_sysattr_value(dev, "bonding/use_carrier");
if (!tmp_str) { if (!tmp_str) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not retrieve 'bonding/use_carrier' for '%s'"), name); _("Could not retrieve 'bonding/use_carrier' for '%1$s'"), name);
goto error; goto error;
} }
if (virStrToLong_i(tmp_str, NULL, 10, &tmp_int) < 0) { if (virStrToLong_i(tmp_str, NULL, 10, &tmp_int) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not parse 'bonding/use_carrier' '%s' for '%s'"), _("Could not parse 'bonding/use_carrier' '%1$s' for '%2$s'"),
tmp_str, name); tmp_str, name);
goto error; goto error;
} }
@ -711,7 +711,7 @@ udevGetIfaceDefBond(struct udev *udev,
tmp_str = udev_device_get_sysattr_value(dev, "bonding/arp_ip_target"); tmp_str = udev_device_get_sysattr_value(dev, "bonding/arp_ip_target");
if (!tmp_str) { if (!tmp_str) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not retrieve 'bonding/arp_ip_target' for '%s'"), name); _("Could not retrieve 'bonding/arp_ip_target' for '%1$s'"), name);
goto error; goto error;
} }
ifacedef->data.bond.target = g_strdup(tmp_str); ifacedef->data.bond.target = g_strdup(tmp_str);
@ -723,7 +723,7 @@ udevGetIfaceDefBond(struct udev *udev,
if (slave_count < 0) { if (slave_count < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("Could not get slaves of bond '%s'"), name); _("Could not get slaves of bond '%1$s'"), name);
goto error; goto error;
} }
@ -739,8 +739,8 @@ udevGetIfaceDefBond(struct udev *udev,
tmp_str = strchr(slave_list[i]->d_name, '_'); tmp_str = strchr(slave_list[i]->d_name, '_');
if (!tmp_str || strlen(tmp_str) < 2) { if (!tmp_str || strlen(tmp_str) < 2) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Invalid enslaved interface name '%s' seen for " _("Invalid enslaved interface name '%1$s' seen for bond '%2$s'"),
"bond '%s'"), slave_list[i]->d_name, name); slave_list[i]->d_name, name);
goto error; goto error;
} }
/* go past the _ */ /* go past the _ */
@ -750,8 +750,8 @@ udevGetIfaceDefBond(struct udev *udev,
udevGetIfaceDef(udev, tmp_str); udevGetIfaceDef(udev, tmp_str);
if (!ifacedef->data.bond.itf[i]) { if (!ifacedef->data.bond.itf[i]) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not get interface information for '%s', which is " _("Could not get interface information for '%1$s', which is a enslaved in bond '%2$s'"),
"a enslaved in bond '%s'"), slave_list[i]->d_name, name); slave_list[i]->d_name, name);
goto error; goto error;
} }
VIR_FREE(slave_list[i]); VIR_FREE(slave_list[i]);
@ -791,7 +791,8 @@ udevGetIfaceDefBridge(struct udev *udev,
tmp_str = udev_device_get_sysattr_value(dev, "bridge/forward_delay"); tmp_str = udev_device_get_sysattr_value(dev, "bridge/forward_delay");
if (!tmp_str) { if (!tmp_str) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not retrieve 'bridge/forward_delay' for '%s'"), name); _("Could not retrieve 'bridge/forward_delay' for '%1$s'"),
name);
goto error; goto error;
} }
@ -801,14 +802,15 @@ udevGetIfaceDefBridge(struct udev *udev,
tmp_str = udev_device_get_sysattr_value(dev, "bridge/stp_state"); tmp_str = udev_device_get_sysattr_value(dev, "bridge/stp_state");
if (!tmp_str) { if (!tmp_str) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not retrieve 'bridge/stp_state' for '%s'"), name); _("Could not retrieve 'bridge/stp_state' for '%1$s'"),
name);
goto error; goto error;
} }
if (virStrToLong_i(tmp_str, NULL, 10, &stp) < 0) { if (virStrToLong_i(tmp_str, NULL, 10, &stp) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not parse 'bridge/stp_state' '%s' for '%s'"), _("Could not parse 'bridge/stp_state' '%1$s' for '%2$s'"),
tmp_str, name); tmp_str, name);
goto error; goto error;
} }
@ -820,8 +822,8 @@ udevGetIfaceDefBridge(struct udev *udev,
break; break;
default: default:
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Invalid STP state value %d received for '%s'. Must be " _("Invalid STP state value %1$d received for '%2$s'. Must be -1, 0, or 1."),
"-1, 0, or 1."), stp, name); stp, name);
goto error; goto error;
} }
@ -837,7 +839,7 @@ udevGetIfaceDefBridge(struct udev *udev,
if (member_count < 0) { if (member_count < 0) {
virReportSystemError(errno, virReportSystemError(errno,
_("Could not get members of bridge '%s'"), _("Could not get members of bridge '%1$s'"),
name); name);
goto error; goto error;
} }
@ -852,8 +854,8 @@ udevGetIfaceDefBridge(struct udev *udev,
udevGetIfaceDef(udev, member_list[i]->d_name); udevGetIfaceDef(udev, member_list[i]->d_name);
if (!ifacedef->data.bridge.itf[i]) { if (!ifacedef->data.bridge.itf[i]) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not get interface information for '%s', which is " _("Could not get interface information for '%1$s', which is a member of bridge '%2$s'"),
"a member of bridge '%s'"), member_list[i]->d_name, name); member_list[i]->d_name, name);
goto error; goto error;
} }
VIR_FREE(member_list[i]); VIR_FREE(member_list[i]);
@ -893,7 +895,7 @@ udevGetIfaceDefVlan(struct udev *udev G_GNUC_UNUSED,
if ((vid_pos = strstr(buf, vid_prefix)) == NULL) { if ((vid_pos = strstr(buf, vid_prefix)) == NULL) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to find the VID for the VLAN device '%s'"), _("failed to find the VID for the VLAN device '%1$s'"),
name); name);
return -1; return -1;
} }
@ -902,14 +904,14 @@ udevGetIfaceDefVlan(struct udev *udev G_GNUC_UNUSED,
if ((vid_len = strspn(vid_pos, "0123456789")) == 0 || if ((vid_len = strspn(vid_pos, "0123456789")) == 0 ||
!g_ascii_isspace(vid_pos[vid_len])) { !g_ascii_isspace(vid_pos[vid_len])) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to find the VID for the VLAN device '%s'"), _("failed to find the VID for the VLAN device '%1$s'"),
name); name);
return -1; return -1;
} }
if ((dev_pos = strstr(vid_pos + vid_len, dev_prefix)) == NULL) { if ((dev_pos = strstr(vid_pos + vid_len, dev_prefix)) == NULL) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to find the real device for the VLAN device '%s'"), _("failed to find the real device for the VLAN device '%1$s'"),
name); name);
return -1; return -1;
} }
@ -917,7 +919,7 @@ udevGetIfaceDefVlan(struct udev *udev G_GNUC_UNUSED,
if ((dev_len = strcspn(dev_pos, "\n")) == 0) { if ((dev_len = strcspn(dev_pos, "\n")) == 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to find the real device for the VLAN device '%s'"), _("failed to find the real device for the VLAN device '%1$s'"),
name); name);
return -1; return -1;
} }
@ -949,7 +951,7 @@ udevGetIfaceDef(struct udev *udev, const char *name)
dev = udev_device_new_from_subsystem_sysname(udev, "net", name); dev = udev_device_new_from_subsystem_sysname(udev, "net", name);
if (!dev) { if (!dev) {
virReportError(VIR_ERR_NO_INTERFACE, virReportError(VIR_ERR_NO_INTERFACE,
_("couldn't find interface named '%s'"), name); _("couldn't find interface named '%1$s'"), name);
goto error; goto error;
} }
@ -964,7 +966,7 @@ udevGetIfaceDef(struct udev *udev, const char *name)
mtu_str = udev_device_get_sysattr_value(dev, "mtu"); mtu_str = udev_device_get_sysattr_value(dev, "mtu");
if (virStrToLong_ui(mtu_str, NULL, 10, &mtu) < 0) { if (virStrToLong_ui(mtu_str, NULL, 10, &mtu) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not parse MTU value '%s'"), mtu_str); _("Could not parse MTU value '%1$s'"), mtu_str);
goto error; goto error;
} }
ifacedef->mtu = mtu; ifacedef->mtu = mtu;
@ -1075,7 +1077,7 @@ udevInterfaceIsActive(virInterfacePtr ifinfo)
ifinfo->name); ifinfo->name);
if (!dev) { if (!dev) {
virReportError(VIR_ERR_NO_INTERFACE, virReportError(VIR_ERR_NO_INTERFACE,
_("couldn't find interface named '%s'"), _("couldn't find interface named '%1$s'"),
ifinfo->name); ifinfo->name);
goto cleanup; goto cleanup;
} }
@ -1130,7 +1132,7 @@ udevStateInitialize(bool privileged,
} }
if (g_mkdir_with_parents(driver->stateDir, S_IRWXU) < 0) { 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); driver->stateDir);
goto cleanup; goto cleanup;
} }