Introduce virCheckFlags for consistent flags checking
The idea is that every API implementation in driver which has flags parameter should first call virCheckFlags() macro to check the function was called with supported flags: virCheckFlags(VIR_SUPPORTED_FLAG_1 | VIR_SUPPORTED_FLAG_2 | VIR_ANOTHER_SUPPORTED_FLAG, -1); The error massage which is printed when unsupported flags are passed looks like: invalid argument in virFooBar: unsupported flags (0x2) Where the unsupported flags part only prints those flags which were passed but are not supported rather than all flags passed.
Showing
想要评论请 注册 或 登录