Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/bhyve/bhyve_command.c | 18 ++++++++--------
src/bhyve/bhyve_domain.c | 2 +-
src/bhyve/bhyve_driver.c | 38 ++++++++++++++++-----------------
src/bhyve/bhyve_firmware.c | 4 ++--
src/bhyve/bhyve_monitor.c | 6 +++---
src/bhyve/bhyve_parse_command.c | 17 +++++++--------
src/bhyve/bhyve_process.c | 20 ++++++++---------
7 files changed, 52 insertions(+), 53 deletions(-)
diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c
index 1c0f2e2bfb..563651336e 100644
--- a/src/bhyve/bhyve_command.c
+++ b/src/bhyve/bhyve_command.c
@@ -74,7 +74,7 @@ bhyveBuildNetArgStr(const virDomainDef *def,
brname = g_strdup(virDomainNetGetActualBridgeName(net));
} else {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Network type %d is not supported"),
+ _("Network type %1$d is not supported"),
virDomainNetGetActualType(net));
goto cleanup;
}
@@ -553,7 +553,7 @@ bhyveBuildSoundArgStr(const virDomainDef *def G_GNUC_UNUSED,
case VIR_DOMAIN_AUDIO_TYPE_FILE:
case VIR_DOMAIN_AUDIO_TYPE_DBUS:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("unsupported audio backend '%s'"),
+ _("unsupported audio backend '%1$s'"),
virDomainAudioTypeTypeToString(audio->type));
return -1;
case VIR_DOMAIN_AUDIO_TYPE_LAST:
@@ -589,7 +589,7 @@ bhyveBuildFSArgStr(const virDomainDef *def G_GNUC_UNUSED,
case VIR_DOMAIN_FS_TYPE_VOLUME:
case VIR_DOMAIN_FS_TYPE_LAST:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("unsupported filesystem type '%s'"),
+ _("unsupported filesystem type '%1$s'"),
virDomainFSTypeToString(fs->type));
return -1;
}
@@ -606,7 +606,7 @@ bhyveBuildFSArgStr(const virDomainDef *def G_GNUC_UNUSED,
case VIR_DOMAIN_FS_DRIVER_TYPE_PLOOP:
case VIR_DOMAIN_FS_DRIVER_TYPE_LAST:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("unsupported filesystem driver '%s'"),
+ _("unsupported filesystem driver '%1$s'"),
virDomainFSDriverTypeToString(fs->fsdriver));
return -1;
}
@@ -620,7 +620,7 @@ bhyveBuildFSArgStr(const virDomainDef *def G_GNUC_UNUSED,
case VIR_DOMAIN_FS_ACCESSMODE_DEFAULT:
case VIR_DOMAIN_FS_ACCESSMODE_LAST:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("unsupported filesystem accessmode '%s'"),
+ _("unsupported filesystem accessmode '%1$s'"),
virDomainFSAccessModeTypeToString(fs->accessmode));
return -1;
}
@@ -723,7 +723,7 @@ virBhyveProcessBuildBhyveCmd(struct _bhyveConn *driver, virDomainDef
*def,
break;
default:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("unsupported clock offset '%s'"),
+ _("unsupported clock offset '%1$s'"),
virDomainClockOffsetTypeToString(def->clock.offset));
return NULL;
}
@@ -874,7 +874,7 @@ virBhyveProcessBuildCustomLoaderCmd(virDomainDef *def)
if (def->os.bootloaderArgs == NULL) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Custom loader requires explicit %s configuration"),
+ _("Custom loader requires explicit %1$s
configuration"),
"bootloader_args");
return NULL;
}
@@ -1059,7 +1059,7 @@ virBhyveGetBootDisk(virDomainDef *def)
case VIR_DOMAIN_BOOT_LAST:
default:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Cannot boot from device %s"),
+ _("Cannot boot from device %1$s"),
virDomainBootTypeToString(def->os.bootDevs[0]));
return NULL;
}
@@ -1080,7 +1080,7 @@ virBhyveGetBootDisk(virDomainDef *def)
if (match == NULL) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Cannot find boot device of requested type %s"),
+ _("Cannot find boot device of requested type
%1$s"),
virDomainBootTypeToString(def->os.bootDevs[0]));
return NULL;
}
diff --git a/src/bhyve/bhyve_domain.c b/src/bhyve/bhyve_domain.c
index a1d1ebc706..a8b1f97790 100644
--- a/src/bhyve/bhyve_domain.c
+++ b/src/bhyve/bhyve_domain.c
@@ -114,7 +114,7 @@ bhyveDomainDiskDefAssignAddress(struct _bhyveConn *driver,
if (idx < 0) {
virReportError(VIR_ERR_XML_ERROR,
- _("Unknown disk name '%s' and no address
specified"),
+ _("Unknown disk name '%1$s' and no address
specified"),
def->dst);
return -1;
}
diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c
index e7d9c2adf3..9ece06447d 100644
--- a/src/bhyve/bhyve_driver.c
+++ b/src/bhyve/bhyve_driver.c
@@ -83,7 +83,7 @@ bhyveAutostartDomain(virDomainObj *vm, void *opaque)
VIR_DOMAIN_RUNNING_BOOTED, 0);
if (ret < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to autostart VM '%s': %s"),
+ _("Failed to autostart VM '%1$s': %2$s"),
vm->def->name, virGetLastErrorMessage());
}
}
@@ -153,7 +153,7 @@ bhyveDomObjFromDomain(virDomainPtr domain)
if (!vm) {
virUUIDFormat(domain->uuid, uuidstr);
virReportError(VIR_ERR_NO_DOMAIN,
- _("no domain with matching uuid '%s' (%s)"),
+ _("no domain with matching uuid '%1$s'
(%2$s)"),
uuidstr, domain->name);
return NULL;
}
@@ -183,7 +183,7 @@ bhyveConnectOpen(virConnectPtr conn,
if (STRNEQ(conn->uri->path, "/system")) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unexpected bhyve URI path '%s', try
bhyve:///system"),
+ _("Unexpected bhyve URI path '%1$s', try
bhyve:///system"),
conn->uri->path);
return VIR_DRV_OPEN_ERROR;
}
@@ -257,7 +257,7 @@ bhyveConnectGetVersion(virConnectPtr conn, unsigned long *version)
if (virStringParseVersion(version, ver.release, true) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unknown release: %s"), ver.release);
+ _("Unknown release: %1$s"), ver.release);
return -1;
}
@@ -369,21 +369,21 @@ bhyveDomainSetAutostart(virDomainPtr domain, int autostart)
if (autostart) {
if (g_mkdir_with_parents(BHYVE_AUTOSTART_DIR, 0777) < 0) {
virReportSystemError(errno,
- _("cannot create autostart directory
%s"),
+ _("cannot create autostart directory
%1$s"),
BHYVE_AUTOSTART_DIR);
goto cleanup;
}
if (symlink(configFile, autostartLink) < 0) {
virReportSystemError(errno,
- _("Failed to create symlink '%s' to
'%s'"),
+ _("Failed to create symlink '%1$s' to
'%2$s'"),
autostartLink, configFile);
goto cleanup;
}
} else {
if (unlink(autostartLink) < 0 && errno != ENOENT && errno
!= ENOTDIR) {
virReportSystemError(errno,
- _("Failed to delete symlink
'%s'"),
+ _("Failed to delete symlink
'%1$s'"),
autostartLink);
goto cleanup;
}
@@ -669,7 +669,7 @@ bhyveConnectDomainXMLToNative(virConnectPtr conn,
if (STRNEQ(format, BHYVE_CONFIG_FORMAT_ARGV)) {
virReportError(VIR_ERR_INVALID_ARG,
- _("Unsupported config type %s"), format);
+ _("Unsupported config type %1$s"), format);
return NULL;
}
@@ -742,7 +742,7 @@ bhyveDomainLookupByUUID(virConnectPtr conn,
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(uuid, uuidstr);
virReportError(VIR_ERR_NO_DOMAIN,
- _("No domain with matching uuid '%s'"),
uuidstr);
+ _("No domain with matching uuid '%1$s'"),
uuidstr);
goto cleanup;
}
@@ -767,7 +767,7 @@ static virDomainPtr bhyveDomainLookupByName(virConnectPtr conn,
if (!vm) {
virReportError(VIR_ERR_NO_DOMAIN,
- _("no domain with matching name '%s'"), name);
+ _("no domain with matching name '%1$s'"),
name);
goto cleanup;
}
@@ -793,7 +793,7 @@ bhyveDomainLookupByID(virConnectPtr conn,
if (!vm) {
virReportError(VIR_ERR_NO_DOMAIN,
- _("No domain with matching ID '%d'"), id);
+ _("No domain with matching ID '%1$d'"), id);
goto cleanup;
}
@@ -1234,14 +1234,14 @@ bhyveStateInitialize(bool privileged,
if (g_mkdir_with_parents(BHYVE_LOG_DIR, 0777) < 0) {
virReportSystemError(errno,
- _("Failed to mkdir %s"),
+ _("Failed to mkdir %1$s"),
BHYVE_LOG_DIR);
goto cleanup;
}
if (g_mkdir_with_parents(BHYVE_STATE_DIR, 0777) < 0) {
virReportSystemError(errno,
- _("Failed to mkdir %s"),
+ _("Failed to mkdir %1$s"),
BHYVE_STATE_DIR);
goto cleanup;
}
@@ -1309,7 +1309,7 @@ bhyveConnectGetMaxVcpus(virConnectPtr conn,
if (!type || STRCASEEQ(type, "bhyve"))
return 16;
- virReportError(VIR_ERR_INVALID_ARG, _("unknown type '%s'"), type);
+ virReportError(VIR_ERR_INVALID_ARG, _("unknown type '%1$s'"),
type);
return -1;
}
@@ -1543,7 +1543,7 @@ bhyveConnectDomainXMLFromNative(virConnectPtr conn,
if (STRNEQ(nativeFormat, BHYVE_CONFIG_FORMAT_ARGV)) {
virReportError(VIR_ERR_INVALID_ARG,
- _("unsupported config type %s"), nativeFormat);
+ _("unsupported config type %1$s"), nativeFormat);
return NULL;
}
@@ -1576,28 +1576,28 @@ bhyveConnectGetDomainCapabilities(virConnectPtr conn,
if (virttype_str &&
(virttype = virDomainVirtTypeFromString(virttype_str)) < 0) {
virReportError(VIR_ERR_INVALID_ARG,
- _("unknown virttype: %s"),
+ _("unknown virttype: %1$s"),
virttype_str);
goto cleanup;
}
if (virttype != VIR_DOMAIN_VIRT_BHYVE) {
virReportError(VIR_ERR_INVALID_ARG,
- _("unknown virttype: %s"),
+ _("unknown virttype: %1$s"),
virttype_str);
goto cleanup;
}
if (arch_str && (arch = virArchFromString(arch_str)) == VIR_ARCH_NONE) {
virReportError(VIR_ERR_INVALID_ARG,
- _("unknown architecture: %s"),
+ _("unknown architecture: %1$s"),
arch_str);
goto cleanup;
}
if (!ARCH_IS_X86(arch)) {
virReportError(VIR_ERR_NO_SUPPORT,
- _("unsupported architecture: %s"),
+ _("unsupported architecture: %1$s"),
virArchToString(arch));
goto cleanup;
}
diff --git a/src/bhyve/bhyve_firmware.c b/src/bhyve/bhyve_firmware.c
index ff131efa41..57ab9c7a82 100644
--- a/src/bhyve/bhyve_firmware.c
+++ b/src/bhyve/bhyve_firmware.c
@@ -69,7 +69,7 @@ bhyveFirmwareFillDomain(bhyveConn *driver,
if (!matching_firmware) {
if (!first_found) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("no firmwares found in %s"),
+ _("no firmwares found in %1$s"),
firmware_dir);
return -1;
} else {
@@ -82,7 +82,7 @@ bhyveFirmwareFillDomain(bhyveConn *driver,
if (def->os.loader->format != VIR_STORAGE_FILE_RAW) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Unsupported loader format '%s'"),
+ _("Unsupported loader format '%1$s'"),
virStorageFileFormatTypeToString(def->os.loader->format));
return -1;
}
diff --git a/src/bhyve/bhyve_monitor.c b/src/bhyve/bhyve_monitor.c
index ae602b5c39..8cf4b41ca3 100644
--- a/src/bhyve/bhyve_monitor.c
+++ b/src/bhyve/bhyve_monitor.c
@@ -120,7 +120,7 @@ bhyveMonitorIO(int watch, int kq, int events G_GNUC_UNUSED, void
*opaque)
if (watch != mon->watch || kq != mon->kq) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("event from unexpected fd %d!=%d / watch %d!=%d"),
+ _("event from unexpected fd %1$d!=%2$d / watch
%3$d!=%4$d"),
mon->kq, kq, mon->watch, watch);
return;
}
@@ -142,7 +142,7 @@ bhyveMonitorIO(int watch, int kq, int events G_GNUC_UNUSED, void
*opaque)
if (kev.filter == EVFILT_PROC && (kev.fflags & NOTE_EXIT) != 0) {
if ((pid_t)kev.ident != vm->pid) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("event from unexpected proc %ju!=%ju"),
+ _("event from unexpected proc %1$ju!=%2$ju"),
(uintmax_t)vm->pid, (uintmax_t)kev.ident);
return;
}
@@ -151,7 +151,7 @@ bhyveMonitorIO(int watch, int kq, int events G_GNUC_UNUSED, void
*opaque)
status = kev.data;
if (WIFSIGNALED(status) && WCOREDUMP(status)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Guest %s got signal %d and crashed"),
+ _("Guest %1$s got signal %2$d and crashed"),
name, WTERMSIG(status));
virBhyveProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_CRASHED);
} else if (WIFEXITED(status)) {
diff --git a/src/bhyve/bhyve_parse_command.c b/src/bhyve/bhyve_parse_command.c
index 2a5959ba1d..394e043c45 100644
--- a/src/bhyve/bhyve_parse_command.c
+++ b/src/bhyve/bhyve_parse_command.c
@@ -281,8 +281,8 @@ bhyveParseBhyveLPCArg(virDomainDef *def,
if (!STRPREFIX(param, "/dev/nmdm")) {
virReportError(VIR_ERR_OPERATION_FAILED,
- _("Failed to set com port %s: does not start with "
- "'/dev/nmdm'."), type);
+ _("Failed to set com port %1$s: does not start with
'/dev/nmdm'."),
+ type);
goto error;
}
@@ -301,8 +301,7 @@ bhyveParseBhyveLPCArg(virDomainDef *def,
break;
default:
virReportError(VIR_ERR_OPERATION_FAILED,
- _("Failed to set slave for %s: last letter not
"
- "'A' or 'B'"),
+ _("Failed to set slave for %1$s: last letter not
'A' or 'B'"),
NULLSTR(chr->source->data.nmdm.master));
goto error;
}
@@ -314,8 +313,8 @@ bhyveParseBhyveLPCArg(virDomainDef *def,
break;
default:
virReportError(VIR_ERR_OPERATION_FAILED,
- _("Failed to parse %s: only com1 and com2"
- " supported."), type);
+ _("Failed to parse %1$s: only com1 and com2
supported."),
+ type);
goto error;
break;
}
@@ -515,7 +514,7 @@ bhyveParsePCINet(virDomainDef *def,
if (virMacAddrParse(mac, &net->mac) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("unable to parse mac address '%s'"),
+ _("unable to parse mac address '%1$s'"),
mac);
goto cleanup;
}
@@ -716,7 +715,7 @@ bhyveParseBhyvePCIArg(virDomainDef *def,
#define CONSUME_ARG(var) \
if ((opti + 1) == argc) { \
- virReportError(VIR_ERR_INVALID_ARG, _("Missing argument for
'%s'"), \
+ virReportError(VIR_ERR_INVALID_ARG, _("Missing argument for
'%1$s'"), \
argv[opti]); \
return -1; \
} \
@@ -800,7 +799,7 @@ bhyveParseBhyveCommandLine(virDomainDef *def,
CONSUME_ARG(arg);
if (virUUIDParse(arg, def->uuid) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Cannot parse UUID '%s'"), arg);
+ _("Cannot parse UUID '%1$s'"), arg);
return -1;
}
break;
diff --git a/src/bhyve/bhyve_process.c b/src/bhyve/bhyve_process.c
index eee0c4bf1d..5b0fd7658a 100644
--- a/src/bhyve/bhyve_process.c
+++ b/src/bhyve/bhyve_process.c
@@ -129,7 +129,7 @@ virBhyveProcessStartImpl(struct _bhyveConn *driver,
if ((logfd = open(logfile, O_WRONLY | O_APPEND | O_CREAT,
S_IRUSR | S_IWUSR)) < 0) {
virReportSystemError(errno,
- _("Failed to open '%s'"),
+ _("Failed to open '%1$s'"),
logfile);
goto cleanup;
}
@@ -145,7 +145,7 @@ virBhyveProcessStartImpl(struct _bhyveConn *driver,
if (unlink(driver->pidfile) < 0 &&
errno != ENOENT) {
virReportSystemError(errno,
- _("Cannot remove state PID file %s"),
+ _("Cannot remove state PID file %1$s"),
driver->pidfile);
goto cleanup;
}
@@ -180,7 +180,7 @@ virBhyveProcessStartImpl(struct _bhyveConn *driver,
rc = virFileWriteStr(devmap_file, devicemap, 0644);
if (rc) {
virReportSystemError(errno,
- _("Cannot write device.map
'%s'"),
+ _("Cannot write device.map
'%1$s'"),
devmap_file);
goto cleanup;
}
@@ -204,7 +204,7 @@ virBhyveProcessStartImpl(struct _bhyveConn *driver,
if (virPidFileReadPath(driver->pidfile, &vm->pid) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Domain %s didn't show up"),
vm->def->name);
+ _("Domain %1$s didn't show up"),
vm->def->name);
goto cleanup;
}
@@ -225,7 +225,7 @@ virBhyveProcessStartImpl(struct _bhyveConn *driver,
if (devicemap != NULL) {
rc = unlink(devmap_file);
if (rc < 0 && errno != ENOENT)
- virReportSystemError(errno, _("cannot unlink file '%s'"),
+ virReportSystemError(errno, _("cannot unlink file
'%1$s'"),
devmap_file);
}
@@ -293,7 +293,7 @@ virBhyveProcessStop(struct _bhyveConn *driver,
if (vm->pid == 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Invalid PID %d for VM"),
+ _("Invalid PID %1$d for VM"),
(int)vm->pid);
return -1;
}
@@ -343,7 +343,7 @@ virBhyveProcessShutdown(virDomainObj *vm)
{
if (vm->pid == 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Invalid PID %d for VM"),
+ _("Invalid PID %1$d for VM"),
(int)vm->pid);
return -1;
}
@@ -386,7 +386,7 @@ virBhyveGetDomainTotalCpuStats(virDomainObj *vm,
if ((kd = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, errbuf)) == NULL) {
virReportError(VIR_ERR_SYSTEM_ERROR,
- _("Unable to get kvm descriptor: %s"),
+ _("Unable to get kvm descriptor: %1$s"),
errbuf);
return -1;
@@ -395,7 +395,7 @@ virBhyveGetDomainTotalCpuStats(virDomainObj *vm,
kp = kvm_getprocs(kd, KERN_PROC_PID, vm->pid, &nprocs);
if (kp == NULL || nprocs != 1) {
virReportError(VIR_ERR_SYSTEM_ERROR,
- _("Unable to obtain information about pid: %d"),
+ _("Unable to obtain information about pid: %1$d"),
(int)vm->pid);
goto cleanup;
}
@@ -485,7 +485,7 @@ virBhyveProcessReconnectAll(struct _bhyveConn *driver)
if ((kd = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, errbuf)) == NULL) {
virReportError(VIR_ERR_SYSTEM_ERROR,
- _("Unable to get kvm descriptor: %s"),
+ _("Unable to get kvm descriptor: %1$s"),
errbuf);
return;
--
2.39.2