From 4e532f2e3de864bf0e2d1ed239be3e2d1b8d6d8a Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Thu, 19 Jul 2012 14:32:27 +0100 Subject: [PATCH] qemu: Add missing "%s" before translation macros This patch cleans up some missing "%s" before translation macros, for strings which are const without format specifiers --- src/qemu/qemu_agent.c | 6 +++--- src/qemu/qemu_cgroup.c | 6 +++--- src/qemu/qemu_command.c | 10 +++++----- src/qemu/qemu_driver.c | 15 ++++++++------- src/qemu/qemu_hostdev.c | 4 ++-- src/qemu/qemu_hotplug.c | 26 +++++++++++++------------- src/qemu/qemu_migration.c | 4 ++-- src/qemu/qemu_monitor.c | 10 +++++----- src/qemu/qemu_process.c | 2 +- 9 files changed, 42 insertions(+), 41 deletions(-) diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c index 7a0381c2ac..07913c2c05 100644 --- a/src/qemu/qemu_agent.c +++ b/src/qemu/qemu_agent.c @@ -649,7 +649,7 @@ qemuAgentIO(int watch, int fd, int events, void *opaque) { if (!error && events & VIR_EVENT_HANDLE_HANGUP) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, + qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("End of file from monitor")); eof = 1; events &= ~VIR_EVENT_HANDLE_HANGUP; @@ -657,7 +657,7 @@ qemuAgentIO(int watch, int fd, int events, void *opaque) { if (!error && !eof && events & VIR_EVENT_HANDLE_ERROR) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, + qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid file descriptor while waiting for monitor")); eof = 1; events &= ~VIR_EVENT_HANDLE_ERROR; @@ -677,7 +677,7 @@ qemuAgentIO(int watch, int fd, int events, void *opaque) { } else { virErrorPtr err = virGetLastError(); if (!err) - qemuReportError(VIR_ERR_INTERNAL_ERROR, + qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Error while processing monitor IO")); virCopyLastError(&mon->lastError); virResetLastError(); diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c index e39f5e1499..fd3d72e244 100644 --- a/src/qemu/qemu_cgroup.c +++ b/src/qemu/qemu_cgroup.c @@ -310,7 +310,7 @@ int qemuSetupCgroup(struct qemud_driver *driver, goto cleanup; } } else { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, + qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Block I/O tuning is not available on this host")); goto cleanup; } @@ -387,7 +387,7 @@ int qemuSetupCgroup(struct qemud_driver *driver, goto cleanup; } } else { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, + qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("CPU tuning is not available on this host")); } } @@ -405,7 +405,7 @@ int qemuSetupCgroup(struct qemud_driver *driver, mask = virDomainCpuSetFormat(vm->def->numatune.memory.nodemask, VIR_DOMAIN_CPUMASK_LEN); if (!mask) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, + qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("failed to convert memory nodemask")); goto cleanup; } diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 401374063a..ced5be2428 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1616,7 +1616,7 @@ qemuAssignDevicePCISlots(virDomainDefPtr def, qemuDomainPCIAddressSetPtr addrs) continue; if (def->disks[i]->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, + qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("virtio only support device address type 'PCI'")); goto error; } @@ -3990,7 +3990,7 @@ qemuBuildCpuArgStr(const struct qemud_driver *driver, _("guest and host CPU are not compatible: %s"), compare_msg); } else { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, + qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("guest CPU is not compatible with host CPU")); } /* fall through */ @@ -5723,7 +5723,7 @@ qemuBuildCommandLine(virConnectPtr conn, if (def->graphics[0]->data.spice.tlsPort > 0) { if (!driver->spiceTLS) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, + qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("spice TLS port set in XML configuration," " but TLS is disabled in qemu.conf")); goto error; @@ -7432,7 +7432,7 @@ qemuParseCommandLineCPU(virDomainDefPtr dom, if (dom->clock.timers[i]->present != -1 && dom->clock.timers[i]->present != present) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, + qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("conflicting occurrences of kvmclock feature")); goto error; } @@ -8217,7 +8217,7 @@ virDomainDefPtr qemuParseCommandLine(virCapsPtr caps, } if (!first_rbd_disk) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, + qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("CEPH_ARGS was set without an rbd disk")); goto error; } diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 46000f4500..a606119557 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -5701,7 +5701,7 @@ qemuDomainUpdateDeviceConfig(virDomainDefPtr vmdef, orig = vmdef->disks[pos]; if (!(orig->device == VIR_DOMAIN_DISK_DEVICE_CDROM) && !(orig->device == VIR_DOMAIN_DISK_DEVICE_FLOPPY)) { - qemuReportError(VIR_ERR_INVALID_ARG, + qemuReportError(VIR_ERR_INVALID_ARG, "%s", _("this disk doesn't support update")); return -1; } @@ -6272,7 +6272,7 @@ qemuDomainSetBlkioParameters(virDomainPtr dom, if (flags & VIR_DOMAIN_AFFECT_LIVE) { if (!qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_BLKIO)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, + qemuReportError(VIR_ERR_OPERATION_INVALID, "%s", _("blkio cgroup isn't mounted")); goto cleanup; } @@ -6433,7 +6433,8 @@ qemuDomainGetBlkioParameters(virDomainPtr dom, if (flags & VIR_DOMAIN_AFFECT_LIVE) { if (!qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_BLKIO)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, _("blkio cgroup isn't mounted")); + qemuReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("blkio cgroup isn't mounted")); goto cleanup; } @@ -11214,7 +11215,7 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, || snap->def->state == VIR_DOMAIN_PAUSED) && (flags & (VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING | VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED))) { - qemuReportError(VIR_ERR_SNAPSHOT_REVERT_RISKY, + qemuReportError(VIR_ERR_SNAPSHOT_REVERT_RISKY, "%s", _("must respawn qemu to start inactive snapshot")); goto cleanup; } @@ -11860,7 +11861,7 @@ qemuDomainOpenConsole(virDomainPtr dom, (flags & VIR_DOMAIN_CONSOLE_FORCE) != 0); if (ret == 1) { - qemuReportError(VIR_ERR_OPERATION_FAILED, + qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", _("Active console session exists for this domain")); ret = -1; } @@ -12795,7 +12796,7 @@ getSumVcpuPercpuStats(virCgroupPtr group, int j; if (virCgroupForVcpu(group, i, &group_vcpu, 0) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, + qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("error accessing cgroup cpuacct for vcpu")); goto cleanup; } @@ -12806,7 +12807,7 @@ getSumVcpuPercpuStats(virCgroupPtr group, pos = buf; for (j = 0; j < num; j++) { if (virStrToLong_ull(pos, &pos, 10, &tmp) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, + qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("cpuacct parse error")); goto cleanup; } diff --git a/src/qemu/qemu_hostdev.c b/src/qemu/qemu_hostdev.c index 434aa02282..34de43eb5e 100644 --- a/src/qemu/qemu_hostdev.c +++ b/src/qemu/qemu_hostdev.c @@ -307,7 +307,7 @@ qemuDomainHostdevNetConfigReplace(virDomainHostdevDefPtr hostdev, isvf = qemuDomainHostdevIsVirtualFunction(hostdev); if (isvf <= 0) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, + qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Interface type hostdev is currently supported on" " SR-IOV Virtual Functions only")); return ret; @@ -345,7 +345,7 @@ qemuDomainHostdevNetConfigRestore(virDomainHostdevDefPtr hostdev, isvf = qemuDomainHostdevIsVirtualFunction(hostdev); if (isvf <= 0) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, + qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Interface type hostdev is currently supported on" " SR-IOV Virtual Functions only")); return ret; diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 5a9a6f74c8..7888ab04f7 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -335,7 +335,7 @@ int qemuDomainAttachPciControllerDevice(struct qemud_driver *driver, if (controller->type == VIR_DOMAIN_CONTROLLER_TYPE_USB && controller->model == -1 && !qemuCapsGet(priv->qemuCaps, QEMU_CAPS_PIIX3_USB_UHCI)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, + qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("USB controller hotplug unsupported in this QEMU binary")); goto cleanup; } @@ -820,7 +820,7 @@ int qemuDomainAttachNetDevice(virConnectPtr conn, /* set link state */ if (net->linkstate == VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOWN) { if (!net->info.alias) { - qemuReportError(VIR_ERR_OPERATION_FAILED, + qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", _("device alias not found: cannot set link state to down")); } else { qemuDomainObjEnterMonitorWithDriver(driver, vm); @@ -1291,7 +1291,7 @@ int qemuDomainChangeNetLinkState(struct qemud_driver *driver, VIR_DEBUG("dev: %s, state: %d", dev->info.alias, linkstate); if (!dev->info.alias) { - qemuReportError(VIR_ERR_OPERATION_FAILED, + qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", _("can't change link state: device alias not found")); return -1; } @@ -1321,13 +1321,13 @@ int qemuDomainChangeNet(struct qemud_driver *driver, int ret = 0; if (!olddev) { - qemuReportError(VIR_ERR_NO_SUPPORT, + qemuReportError(VIR_ERR_NO_SUPPORT, "%s", _("cannot find existing network device to modify")); return -1; } if (olddev->type != dev->type) { - qemuReportError(VIR_ERR_NO_SUPPORT, + qemuReportError(VIR_ERR_NO_SUPPORT, "%s", _("cannot change network interface type")); return -1; } @@ -1340,7 +1340,7 @@ int qemuDomainChangeNet(struct qemud_driver *driver, if (STRNEQ_NULLABLE(olddev->data.ethernet.dev, dev->data.ethernet.dev) || STRNEQ_NULLABLE(olddev->script, dev->script) || STRNEQ_NULLABLE(olddev->data.ethernet.ipaddr, dev->data.ethernet.ipaddr)) { - qemuReportError(VIR_ERR_NO_SUPPORT, + qemuReportError(VIR_ERR_NO_SUPPORT, "%s", _("cannot modify ethernet network device configuration")); return -1; } @@ -1351,7 +1351,7 @@ int qemuDomainChangeNet(struct qemud_driver *driver, case VIR_DOMAIN_NET_TYPE_MCAST: if (STRNEQ_NULLABLE(olddev->data.socket.address, dev->data.socket.address) || olddev->data.socket.port != dev->data.socket.port) { - qemuReportError(VIR_ERR_NO_SUPPORT, + qemuReportError(VIR_ERR_NO_SUPPORT, "%s", _("cannot modify network socket device configuration")); return -1; } @@ -1361,7 +1361,7 @@ int qemuDomainChangeNet(struct qemud_driver *driver, if (STRNEQ_NULLABLE(olddev->data.network.name, dev->data.network.name) || STRNEQ_NULLABLE(olddev->data.network.portgroup, dev->data.network.portgroup) || !virNetDevVPortProfileEqual(olddev->data.network.virtPortProfile, dev->data.network.virtPortProfile)) { - qemuReportError(VIR_ERR_NO_SUPPORT, + qemuReportError(VIR_ERR_NO_SUPPORT, "%s", _("cannot modify network device configuration")); return -1; } @@ -1372,7 +1372,7 @@ int qemuDomainChangeNet(struct qemud_driver *driver, /* allow changing brname, but not portprofile */ if (!virNetDevVPortProfileEqual(olddev->data.bridge.virtPortProfile, dev->data.bridge.virtPortProfile)) { - qemuReportError(VIR_ERR_NO_SUPPORT, + qemuReportError(VIR_ERR_NO_SUPPORT, "%s", _("cannot modify bridge network device configuration")); return -1; } @@ -1380,7 +1380,7 @@ int qemuDomainChangeNet(struct qemud_driver *driver, case VIR_DOMAIN_NET_TYPE_INTERNAL: if (STRNEQ_NULLABLE(olddev->data.internal.name, dev->data.internal.name)) { - qemuReportError(VIR_ERR_NO_SUPPORT, + qemuReportError(VIR_ERR_NO_SUPPORT, "%s", _("cannot modify internal network device configuration")); return -1; } @@ -1390,7 +1390,7 @@ int qemuDomainChangeNet(struct qemud_driver *driver, if (STRNEQ_NULLABLE(olddev->data.direct.linkdev, dev->data.direct.linkdev) || olddev->data.direct.mode != dev->data.direct.mode || !virNetDevVPortProfileEqual(olddev->data.direct.virtPortProfile, dev->data.direct.virtPortProfile)) { - qemuReportError(VIR_ERR_NO_SUPPORT, + qemuReportError(VIR_ERR_NO_SUPPORT, "%s", _("cannot modify direct network device configuration")); return -1; } @@ -1407,7 +1407,7 @@ int qemuDomainChangeNet(struct qemud_driver *driver, /* all other unmodifiable parameters */ if (STRNEQ_NULLABLE(olddev->model, dev->model) || STRNEQ_NULLABLE(olddev->filter, dev->filter)) { - qemuReportError(VIR_ERR_NO_SUPPORT, + qemuReportError(VIR_ERR_NO_SUPPORT, "%s", _("cannot modify network device configuration")); return -1; } @@ -1415,7 +1415,7 @@ int qemuDomainChangeNet(struct qemud_driver *driver, /* check if device name has been set, if no, retain the autogenerated one */ if (dev->ifname && STRNEQ_NULLABLE(olddev->ifname, dev->ifname)) { - qemuReportError(VIR_ERR_NO_SUPPORT, + qemuReportError(VIR_ERR_NO_SUPPORT, "%s", _("cannot modify network device configuration")); return -1; } diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index d176e7d84d..96bd822037 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -2240,7 +2240,7 @@ static int doPeer2PeerMigrate2(struct qemud_driver *driver, if (!(flags & VIR_MIGRATE_TUNNELLED) && (uri_out == NULL)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, + qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("domainMigratePrepare2 did not set uri")); cancelled = 1; goto finish; @@ -2378,7 +2378,7 @@ static int doPeer2PeerMigrate3(struct qemud_driver *driver, if (!(flags & VIR_MIGRATE_TUNNELLED) && (uri_out == NULL)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, + qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("domainMigratePrepare3 did not set uri")); cancelled = 1; goto finish; diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 42a5d6cbe8..2aacc71fd2 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -612,7 +612,7 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque) { if (!error && events & VIR_EVENT_HANDLE_HANGUP) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, + qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("End of file from monitor")); eof = 1; events &= ~VIR_EVENT_HANDLE_HANGUP; @@ -620,7 +620,7 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque) { if (!error && !eof && events & VIR_EVENT_HANDLE_ERROR) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, + qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid file descriptor while waiting for monitor")); eof = 1; events &= ~VIR_EVENT_HANDLE_ERROR; @@ -640,7 +640,7 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque) { } else { virErrorPtr err = virGetLastError(); if (!err) - qemuReportError(VIR_ERR_INTERNAL_ERROR, + qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Error while processing monitor IO")); virCopyLastError(&mon->lastError); virResetLastError(); @@ -813,7 +813,7 @@ void qemuMonitorClose(qemuMonitorPtr mon) if (mon->lastError.code == VIR_ERR_OK) { virErrorPtr err = virSaveLastError(); - qemuReportError(VIR_ERR_OPERATION_FAILED, + qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", _("Qemu monitor was closed")); virCopyLastError(&mon->lastError); if (err) { @@ -1275,7 +1275,7 @@ int qemuMonitorSetLink(qemuMonitorPtr mon, VIR_DEBUG("mon=%p, name=%p:%s, state=%u", mon, name, name, state); if (!mon || !name) { - qemuReportError(VIR_ERR_INVALID_ARG, + qemuReportError(VIR_ERR_INVALID_ARG, "%s", _("monitor || name must not be NULL")); return -1; } diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index b260a20199..3047baa261 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -1920,7 +1920,7 @@ qemuProcessSetLinkStates(virDomainObjPtr vm) VIR_DEBUG("Setting link state: %s", def->nets[i]->info.alias); if (!qemuCapsGet(priv->qemuCaps, QEMU_CAPS_NETDEV)) { - qemuReportError(VIR_ERR_NO_SUPPORT, + qemuReportError(VIR_ERR_NO_SUPPORT, "%s", _("Setting of link state is not supported by this qemu")); return -1; } -- GitLab