On Tue, Sep 18, 2018 at 05:45:42PM +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/util/vircgroup.c | 14 ++------------
src/util/vircgroupbackend.h | 20 ++++++++++++++++++++
src/util/vircgroupv1.c | 29 +++++++++++++++++++++++++++++
3 files changed, 51 insertions(+), 12 deletions(-)
@@ -161,4 +173,12 @@ virCgroupBackendRegister(virCgroupBackendPtr backend);
virCgroupBackendPtr *
virCgroupBackendGetAll(void);
+# define VIR_CGROUP_BACKEND_CALL(group, func, ret, ...) \
+ if (!group->backend->func) { \
+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", \
+ _("operation '" #func "' not
supported")); \
_("operation '%s' not supported"), #func)
I don't think the function names are translatable. And having a separate
translatable string for each unlikely error message is a waste of
translators' time.
+ return ret; \
+ } \
+ return group->backend->func(group, ##__VA_ARGS__);
+
#endif /* __VIR_CGROUP_BACKEND_H__ */
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
Jano