From: Michal Privoznik Date: Mon, 29 Sep 2025 12:54:17 +0000 (+0200) Subject: qemu_caps: Prefer VIR_DOMAIN_CAPS_ENUM_IS_SET() X-Git-Tag: v11.9.0-rc1~65 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=727c858d6a837bd26f8cedc7e24c54dbff301e29;p=thirdparty%2Flibvirt.git qemu_caps: Prefer VIR_DOMAIN_CAPS_ENUM_IS_SET() 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 --- 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",