38 lines
1.5 KiB
Diff
38 lines
1.5 KiB
Diff
From 3ccbf88062419dc604e9e98e44287fdc65c94bbc Mon Sep 17 00:00:00 2001
|
|
Message-ID: <3ccbf88062419dc604e9e98e44287fdc65c94bbc.1763133105.git.jdenemar@redhat.com>
|
|
From: Michal Privoznik <mprivozn@redhat.com>
|
|
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=UTF-8
|
|
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 <mprivozn@redhat.com>
|
|
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
|
(cherry picked from commit 727c858d6a837bd26f8cedc7e24c54dbff301e29)
|
|
Resolves: https://issues.redhat.com/browse/RHEL-122930
|
|
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
|
---
|
|
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 4f239ae77b..28d3a78d8c 100644
|
|
--- a/src/qemu/qemu_capabilities.c
|
|
+++ b/src/qemu/qemu_capabilities.c
|
|
@@ -5126,7 +5126,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, "<cap name='%s'/>\n",
|
|
--
|
|
2.51.1
|