mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
util: cgroup: wrap BACKEND_CALL macro in a block
VIR_CGROUP_BACKEND_CALL is exclusively used at the end of a function, but it declares a variable. Wrap it in a do..while block. Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
33e3c69320
commit
c23c7dac9b
@ -452,15 +452,17 @@ virCgroupBackendForController(virCgroupPtr group,
|
|||||||
unsigned int controller);
|
unsigned int controller);
|
||||||
|
|
||||||
#define VIR_CGROUP_BACKEND_CALL(group, controller, func, ret, ...) \
|
#define VIR_CGROUP_BACKEND_CALL(group, controller, func, ret, ...) \
|
||||||
virCgroupBackendPtr backend = virCgroupBackendForController(group, controller); \
|
do { \
|
||||||
if (!backend) { \
|
virCgroupBackendPtr backend = virCgroupBackendForController(group, controller); \
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, \
|
if (!backend) { \
|
||||||
_("failed to get cgroup backend for '%s'"), #func); \
|
virReportError(VIR_ERR_INTERNAL_ERROR, \
|
||||||
return ret; \
|
_("failed to get cgroup backend for '%s'"), #func); \
|
||||||
} \
|
return ret; \
|
||||||
if (!backend->func) { \
|
} \
|
||||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, \
|
if (!backend->func) { \
|
||||||
_("operation '%s' not supported"), #func); \
|
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, \
|
||||||
return ret; \
|
_("operation '%s' not supported"), #func); \
|
||||||
} \
|
return ret; \
|
||||||
return backend->func(group, ##__VA_ARGS__);
|
} \
|
||||||
|
return backend->func(group, ##__VA_ARGS__); \
|
||||||
|
} while (0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user