From 727c858d6a837bd26f8cedc7e24c54dbff301e29 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Mon, 29 Sep 2025 14:54:17 +0200 Subject: [PATCH] qemu_caps: Prefer VIR_DOMAIN_CAPS_ENUM_IS_SET() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit While virDomainCapsEnum is in fact a bitmap, we also have a macro to manipulate/query individual bits. Prefer it to make the code more readable. Signed-off-by: Michal Privoznik Reviewed-by: Ján Tomko --- src/qemu/qemu_capabilities.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 618291e5b6..5b485d7bfb 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -5065,7 +5065,7 @@ virQEMUCapsFormatHypervCapabilities(virQEMUCaps *qemuCaps, size_t i; for (i = 0; i < sizeof(hvcaps->features.values) * CHAR_BIT; i++) { - if (!(hvcaps->features.values & (1U << i))) + if (!VIR_DOMAIN_CAPS_ENUM_IS_SET(hvcaps->features, i)) continue; virBufferAsprintf(&childBuf, "\n", -- 2.47.3