mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-07-07 18:35:46 +00:00
util: Move error messages onto a single line
Error messages are exempt from the 80 columns rule. Move them onto one line. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
67a89930c0
commit
c34d9cb9ce
@ -444,9 +444,7 @@ virCgroupV2DevicesCreateMap(size_t size)
|
|||||||
if (mapfd < 0) {
|
if (mapfd < 0) {
|
||||||
if (errno == EPERM) {
|
if (errno == EPERM) {
|
||||||
virReportSystemError(errno, "%s",
|
virReportSystemError(errno, "%s",
|
||||||
_("failed to initialize device BPF map; "
|
_("failed to initialize device BPF map; locked memory limit for libvirtd probably needs to be raised"));
|
||||||
"locked memory limit for libvirtd probably "
|
|
||||||
"needs to be raised"));
|
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
virReportSystemError(errno, "%s",
|
virReportSystemError(errno, "%s",
|
||||||
@ -595,8 +593,7 @@ int
|
|||||||
virCgroupV2DevicesDetectProg(virCgroup *group G_GNUC_UNUSED)
|
virCgroupV2DevicesDetectProg(virCgroup *group G_GNUC_UNUSED)
|
||||||
{
|
{
|
||||||
virReportSystemError(ENOSYS, "%s",
|
virReportSystemError(ENOSYS, "%s",
|
||||||
_("cgroups v2 BPF devices not supported "
|
_("cgroups v2 BPF devices not supported with this kernel"));
|
||||||
"with this kernel"));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -605,8 +602,7 @@ int
|
|||||||
virCgroupV2DevicesCreateProg(virCgroup *group G_GNUC_UNUSED)
|
virCgroupV2DevicesCreateProg(virCgroup *group G_GNUC_UNUSED)
|
||||||
{
|
{
|
||||||
virReportSystemError(ENOSYS, "%s",
|
virReportSystemError(ENOSYS, "%s",
|
||||||
_("cgroups v2 BPF devices not supported "
|
_("cgroups v2 BPF devices not supported with this kernel"));
|
||||||
"with this kernel"));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -615,8 +611,7 @@ int
|
|||||||
virCgroupV2DevicesPrepareProg(virCgroup *group G_GNUC_UNUSED)
|
virCgroupV2DevicesPrepareProg(virCgroup *group G_GNUC_UNUSED)
|
||||||
{
|
{
|
||||||
virReportSystemError(ENOSYS, "%s",
|
virReportSystemError(ENOSYS, "%s",
|
||||||
_("cgroups v2 BPF devices not supported "
|
_("cgroups v2 BPF devices not supported with this kernel"));
|
||||||
"with this kernel"));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2691,8 +2691,7 @@ virCommandRunAsync(virCommand *cmd, pid_t *pid)
|
|||||||
virCommandDoAsyncIOHelper,
|
virCommandDoAsyncIOHelper,
|
||||||
"cmd-async-io", false, cmd) < 0) {
|
"cmd-async-io", false, cmd) < 0) {
|
||||||
virReportSystemError(errno, "%s",
|
virReportSystemError(errno, "%s",
|
||||||
_("Unable to create thread "
|
_("Unable to create thread to process command's IO"));
|
||||||
"to process command's IO"));
|
|
||||||
VIR_FREE(cmd->asyncioThread);
|
VIR_FREE(cmd->asyncioThread);
|
||||||
virCommandAbort(cmd);
|
virCommandAbort(cmd);
|
||||||
ret = -1;
|
ret = -1;
|
||||||
|
@ -1094,8 +1094,7 @@ virFileNBDLoadDriver(void)
|
|||||||
{
|
{
|
||||||
if (virKModIsProhibited(NBD_DRIVER)) {
|
if (virKModIsProhibited(NBD_DRIVER)) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("Failed to load nbd module: "
|
_("Failed to load nbd module: administratively prohibited"));
|
||||||
"administratively prohibited"));
|
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
g_autofree char *errbuf = NULL;
|
g_autofree char *errbuf = NULL;
|
||||||
|
@ -892,8 +892,7 @@ virHostCPUStatsAssign(virNodeCPUStatsPtr param,
|
|||||||
{
|
{
|
||||||
if (virStrcpyStatic(param->field, name) < 0) {
|
if (virStrcpyStatic(param->field, name) < 0) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("kernel cpu time field is too long"
|
"%s", _("kernel cpu time field is too long for the destination"));
|
||||||
" for the destination"));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
param->value = value;
|
param->value = value;
|
||||||
|
@ -392,8 +392,7 @@ virHostMemSetParameters(virTypedParameterPtr params G_GNUC_UNUSED,
|
|||||||
virCheckFlags(0, -1);
|
virCheckFlags(0, -1);
|
||||||
|
|
||||||
virReportError(VIR_ERR_NO_SUPPORT, "%s",
|
virReportError(VIR_ERR_NO_SUPPORT, "%s",
|
||||||
_("node set memory parameters not implemented"
|
_("node set memory parameters not implemented on this platform"));
|
||||||
" on this platform"));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -586,8 +585,7 @@ virHostMemGetParameters(virTypedParameterPtr params G_GNUC_UNUSED,
|
|||||||
virCheckFlags(VIR_TYPED_PARAM_STRING_OKAY, -1);
|
virCheckFlags(VIR_TYPED_PARAM_STRING_OKAY, -1);
|
||||||
|
|
||||||
virReportError(VIR_ERR_NO_SUPPORT, "%s",
|
virReportError(VIR_ERR_NO_SUPPORT, "%s",
|
||||||
_("node get memory parameters not implemented"
|
_("node get memory parameters not implemented on this platform"));
|
||||||
" on this platform"));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -1938,8 +1938,7 @@ virJSONValueObjectDeflattenWorker(const char *key,
|
|||||||
} else {
|
} else {
|
||||||
if (!virJSONValueIsObject(existobj)) {
|
if (!virJSONValueIsObject(existobj)) {
|
||||||
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("mixing nested objects and values is forbidden in "
|
_("mixing nested objects and values is forbidden in JSON deflattening"));
|
||||||
"JSON deflattening"));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -167,8 +167,7 @@ virMediatedDeviceNew(const char *uuidstr G_GNUC_UNUSED,
|
|||||||
virMediatedDeviceModelType model G_GNUC_UNUSED)
|
virMediatedDeviceModelType model G_GNUC_UNUSED)
|
||||||
{
|
{
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("mediated devices are not supported on non-linux "
|
_("mediated devices are not supported on non-linux platforms"));
|
||||||
"platforms"));
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -182,8 +182,7 @@ virNetDevSetupControl(const char *ifname G_GNUC_UNUSED,
|
|||||||
void *ifr G_GNUC_UNUSED)
|
void *ifr G_GNUC_UNUSED)
|
||||||
{
|
{
|
||||||
virReportSystemError(ENOSYS, "%s",
|
virReportSystemError(ENOSYS, "%s",
|
||||||
_("Network device configuration is not supported "
|
_("Network device configuration is not supported on this platform"));
|
||||||
"on this platform"));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#endif /* WITH_STRUCT_IFREQ */
|
#endif /* WITH_STRUCT_IFREQ */
|
||||||
@ -2248,8 +2247,7 @@ virNetDevSetNetConfig(const char *linkdev, int vf,
|
|||||||
if (vlan) {
|
if (vlan) {
|
||||||
if (vlan->nTags != 1 || vlan->trunk) {
|
if (vlan->nTags != 1 || vlan->trunk) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
_("vlan trunking is not supported "
|
_("vlan trunking is not supported by SR-IOV network devices"));
|
||||||
"by SR-IOV network devices"));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2651,8 +2649,7 @@ int virNetDevAddMulti(const char *ifname G_GNUC_UNUSED,
|
|||||||
virMacAddr *macaddr G_GNUC_UNUSED)
|
virMacAddr *macaddr G_GNUC_UNUSED)
|
||||||
{
|
{
|
||||||
virReportSystemError(ENOSYS, "%s",
|
virReportSystemError(ENOSYS, "%s",
|
||||||
_("Unable to add address to interface "
|
_("Unable to add address to interface multicast list on this platform"));
|
||||||
"multicast list on this platform"));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -2696,8 +2693,7 @@ int virNetDevDelMulti(const char *ifname G_GNUC_UNUSED,
|
|||||||
virMacAddr *macaddr G_GNUC_UNUSED)
|
virMacAddr *macaddr G_GNUC_UNUSED)
|
||||||
{
|
{
|
||||||
virReportSystemError(ENOSYS, "%s",
|
virReportSystemError(ENOSYS, "%s",
|
||||||
_("Unable to delete address from interface "
|
_("Unable to delete address from interface multicast list on this platform"));
|
||||||
"multicast list on this platform"));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -208,15 +208,13 @@ virNetDevBandwidthSet(const char *ifname,
|
|||||||
|
|
||||||
if (geteuid() != 0) {
|
if (geteuid() != 0) {
|
||||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||||
_("Network bandwidth tuning is not available"
|
_("Network bandwidth tuning is not available in session mode"));
|
||||||
" in session mode"));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ifname) {
|
if (!ifname) {
|
||||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||||
_("Unable to set bandwidth for interface because "
|
_("Unable to set bandwidth for interface because device name is unknown"));
|
||||||
"device name is unknown"));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -894,15 +894,13 @@ virNetDevOpenvswitchInterfaceSetQos(const char *ifname,
|
|||||||
|
|
||||||
if (geteuid() != 0) {
|
if (geteuid() != 0) {
|
||||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||||
_("Network bandwidth tuning is not available"
|
_("Network bandwidth tuning is not available in session mode"));
|
||||||
" in session mode"));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ifname) {
|
if (!ifname) {
|
||||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||||
_("Unable to set bandwidth for interface because "
|
_("Unable to set bandwidth for interface because device name is unknown"));
|
||||||
"device name is unknown"));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -530,8 +530,7 @@ virNetDevVPortProfileGetStatus(struct nlattr **tb, int32_t vf,
|
|||||||
|
|
||||||
if (nla_type(tb_vf_ports) != IFLA_VF_PORT) {
|
if (nla_type(tb_vf_ports) != IFLA_VF_PORT) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("error while iterating over "
|
_("error while iterating over IFLA_VF_PORTS part"));
|
||||||
"IFLA_VF_PORTS part"));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -584,8 +583,7 @@ virNetDevVPortProfileGetStatus(struct nlattr **tb, int32_t vf,
|
|||||||
if (nla_parse_nested(tb_port, IFLA_PORT_MAX, tb_vf_ports,
|
if (nla_parse_nested(tb_port, IFLA_PORT_MAX, tb_vf_ports,
|
||||||
ifla_port_policy)) {
|
ifla_port_policy)) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("error parsing IFLA_VF_PORT "
|
_("error parsing IFLA_VF_PORT during error reporting"));
|
||||||
"during error reporting"));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (tb_port[IFLA_PORT_INSTANCE_UUID]) {
|
if (tb_port[IFLA_PORT_INSTANCE_UUID]) {
|
||||||
|
@ -225,8 +225,7 @@ virNetlinkCreateSocket(int protocol)
|
|||||||
|
|
||||||
if (virNetlinkSetBufferSize(nlhandle, 131702, 0) < 0) {
|
if (virNetlinkSetBufferSize(nlhandle, 131702, 0) < 0) {
|
||||||
virReportSystemError(errno, "%s",
|
virReportSystemError(errno, "%s",
|
||||||
_("cannot set netlink socket buffer "
|
_("cannot set netlink socket buffer size to 128k"));
|
||||||
"size to 128k"));
|
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
nl_socket_enable_msg_peek(nlhandle);
|
nl_socket_enable_msg_peek(nlhandle);
|
||||||
|
@ -69,8 +69,7 @@ virNumaGetAutoPlacementAdvice(unsigned short vcpus,
|
|||||||
|
|
||||||
if (virCommandRun(cmd, NULL) < 0) {
|
if (virCommandRun(cmd, NULL) < 0) {
|
||||||
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
|
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
|
||||||
_("Failed to query numad for the "
|
_("Failed to query numad for the advisory nodeset"));
|
||||||
"advisory nodeset"));
|
|
||||||
VIR_FREE(output);
|
VIR_FREE(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -149,8 +148,7 @@ virNumaSetupMemoryPolicy(virDomainNumatuneMemMode mode,
|
|||||||
|
|
||||||
if (!has_preferred_many && nnodes != 1) {
|
if (!has_preferred_many && nnodes != 1) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("NUMA memory tuning in 'preferred' mode "
|
"%s", _("NUMA memory tuning in 'preferred' mode only supports single node"));
|
||||||
"only supports single node"));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1454,8 +1454,7 @@ virPCIDeviceAddressIsValid(virPCIDeviceAddress *addr,
|
|||||||
if (virPCIDeviceAddressIsEmpty(addr)) {
|
if (virPCIDeviceAddressIsEmpty(addr)) {
|
||||||
if (report)
|
if (report)
|
||||||
virReportError(VIR_ERR_XML_ERROR, "%s",
|
virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||||
_("Invalid PCI address 0000:00:00, at least "
|
_("Invalid PCI address 0000:00:00, at least one of domain, bus, or slot must be > 0"));
|
||||||
"one of domain, bus, or slot must be > 0"));
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -1638,15 +1638,13 @@ virProcessSetScheduler(pid_t pid,
|
|||||||
|
|
||||||
if ((min = sched_get_priority_min(pol)) < 0) {
|
if ((min = sched_get_priority_min(pol)) < 0) {
|
||||||
virReportSystemError(errno, "%s",
|
virReportSystemError(errno, "%s",
|
||||||
_("Cannot get minimum scheduler "
|
_("Cannot get minimum scheduler priority value"));
|
||||||
"priority value"));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((max = sched_get_priority_max(pol)) < 0) {
|
if ((max = sched_get_priority_max(pol)) < 0) {
|
||||||
virReportSystemError(errno, "%s",
|
virReportSystemError(errno, "%s",
|
||||||
_("Cannot get maximum scheduler "
|
_("Cannot get maximum scheduler priority value"));
|
||||||
"priority value"));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1681,8 +1679,7 @@ virProcessSetScheduler(pid_t pid G_GNUC_UNUSED,
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
virReportSystemError(ENOSYS, "%s",
|
virReportSystemError(ENOSYS, "%s",
|
||||||
_("Process CPU scheduling is not supported "
|
_("Process CPU scheduling is not supported on this platform"));
|
||||||
"on this platform"));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -207,8 +207,7 @@ virQEMUBuildCommandLineJSONRecurse(const char *key,
|
|||||||
case VIR_JSON_TYPE_ARRAY:
|
case VIR_JSON_TYPE_ARRAY:
|
||||||
if (nested) {
|
if (nested) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("nested JSON array to commandline conversion is "
|
_("nested JSON array to commandline conversion is not supported"));
|
||||||
"not supported"));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -496,8 +496,7 @@ static int
|
|||||||
virResctrlLock(void)
|
virResctrlLock(void)
|
||||||
{
|
{
|
||||||
virReportSystemError(ENOSYS, "%s",
|
virReportSystemError(ENOSYS, "%s",
|
||||||
_("resctrl locking is not supported "
|
_("resctrl locking is not supported on this platform"));
|
||||||
"on this platform"));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -506,8 +505,7 @@ static int
|
|||||||
virResctrlUnlock(int fd G_GNUC_UNUSED)
|
virResctrlUnlock(int fd G_GNUC_UNUSED)
|
||||||
{
|
{
|
||||||
virReportSystemError(ENOSYS, "%s",
|
virReportSystemError(ENOSYS, "%s",
|
||||||
_("resctrl locking is not supported "
|
_("resctrl locking is not supported on this platform"));
|
||||||
"on this platform"));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1468,8 +1466,7 @@ virResctrlAllocParseMemoryBandwidthLine(virResctrlInfo *resctrl,
|
|||||||
!resctrl->membw_info->min_bandwidth ||
|
!resctrl->membw_info->min_bandwidth ||
|
||||||
!resctrl->membw_info->bandwidth_granularity) {
|
!resctrl->membw_info->bandwidth_granularity) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("Missing or inconsistent resctrl info for "
|
_("Missing or inconsistent resctrl info for memory bandwidth allocation"));
|
||||||
"memory bandwidth allocation"));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -429,8 +429,7 @@ virThreadPoolSetParameters(virThreadPool *pool,
|
|||||||
if ((maxWorkers == 0 && pool->maxWorkers > 0) ||
|
if ((maxWorkers == 0 && pool->maxWorkers > 0) ||
|
||||||
(maxWorkers > 0 && pool->maxWorkers == 0)) {
|
(maxWorkers > 0 && pool->maxWorkers == 0)) {
|
||||||
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("maxWorkers must not be switched from zero to non-zero"
|
_("maxWorkers must not be switched from zero to non-zero and vice versa"));
|
||||||
" and vice versa"));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user