halt='avoid using 'devname' as FreeBSD exports the symbol' \
$(_sc_search_regexp)
+sc_prohibit_system_error_with_vir_err:
+ @prohibit='\bvirReportSystemError *\(VIR_ERR_' \
+ halt='do not use virReportSystemError with VIR_ERR_* error codes' \
+ $(_sc_search_regexp)
+
# We don't use this feature of maint.mk.
prev_version_file = /dev/null
VIR_DEBUG("Enable user namespace");
cflags |= CLONE_NEWUSER;
} else {
- virReportSystemError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("Kernel doesn't support user namespace"));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("Kernel doesn't support user namespace"));
VIR_FREE(stack);
return -1;
}
/* Ensure that we can multiply by 1024 without overflowing. */
if (barrier > ULLONG_MAX / 1024 ||
limit > ULLONG_MAX / 1024) {
- virReportSystemError(VIR_ERR_OVERFLOW, "%s",
- _("Unable to parse quota"));
+ virReportError(VIR_ERR_OVERFLOW, "%s",
+ _("Unable to parse quota"));
goto error;
}
fs->space_soft_limit = barrier * 1024; /* unit is bytes */
case VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH:
if (virNetDevOpenvswitchGetMigrateData(&mig->net[i].portdata,
netptr->ifname) != 0) {
- virReportSystemError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to run command to get OVS port data for "
- "interface %s"), netptr->ifname);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to run command to get OVS port data for "
+ "interface %s"), netptr->ifname);
goto error;
}
break;
case VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH:
if (virNetDevOpenvswitchSetMigrateData(cookie->network->net[i].portdata,
netptr->ifname) != 0) {
- virReportSystemError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to run command to set OVS port data for "
- "interface %s"), netptr->ifname);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to run command to set OVS port data for "
+ "interface %s"), netptr->ifname);
goto cleanup;
}
break;
}
if (virCommandRun(cmd, NULL) < 0) {
- virReportSystemError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to add port %s to OVS bridge %s"),
- ifname, brname);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to add port %s to OVS bridge %s"),
+ ifname, brname);
goto cleanup;
}
virCommandAddArgList(cmd, "--timeout=5", "--", "--if-exists", "del-port", ifname, NULL);
if (virCommandRun(cmd, NULL) < 0) {
- virReportSystemError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to delete port %s from OVS"), ifname);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to delete port %s from OVS"), ifname);
goto cleanup;
}
/* Run the command */
if (virCommandRun(cmd, NULL) < 0) {
- virReportSystemError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to run command to get OVS port data for "
- "interface %s"), ifname);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to run command to get OVS port data for "
+ "interface %s"), ifname);
goto cleanup;
}
/* Run the command */
if (virCommandRun(cmd, NULL) < 0) {
- virReportSystemError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to run command to set OVS port data for "
- "interface %s"), ifname);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to run command to set OVS port data for "
+ "interface %s"), ifname);
goto cleanup;
}
return NULL;
if (virMutexInit(&obj->lock) < 0) {
- virReportSystemError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Unable to initialize mutex"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to initialize mutex"));
virObjectUnref(obj);
return NULL;
}