mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
domain_capabilities: Introduce VIR_DOMAIN_CAPS_ENUM_IS_SET
This is a convenient macro for querying whether particular domain caps enum value is set or not. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
3fba30fc82
commit
4f8677cee2
@ -287,7 +287,7 @@ virDomainCapsEnumFormat(virBufferPtr buf,
|
||||
for (i = 0; i < sizeof(capsEnum->values) * CHAR_BIT; i++) {
|
||||
const char *val;
|
||||
|
||||
if (!(capsEnum->values & (1 << i)))
|
||||
if (!VIR_DOMAIN_CAPS_ENUM_IS_SET(*capsEnum, i))
|
||||
continue;
|
||||
|
||||
if ((val = (valToStr)(i)))
|
||||
|
@ -214,6 +214,8 @@ virDomainCapsCPUModelPtr
|
||||
virDomainCapsCPUModelsGet(virDomainCapsCPUModelsPtr cpuModels,
|
||||
const char *name);
|
||||
|
||||
#define VIR_DOMAIN_CAPS_ENUM_IS_SET(capsEnum, value) \
|
||||
((capsEnum).values & (1 << value))
|
||||
|
||||
#define VIR_DOMAIN_CAPS_ENUM_SET(capsEnum, ...) \
|
||||
do { \
|
||||
|
Loading…
x
Reference in New Issue
Block a user