[libvirt] [PATCH 4/9] xen: Add coverity[ptr_arith] and [sign_extension] tags

John Ferlan jferlan at redhat.com
Tue Jan 22 14:40:59 UTC 2013


The old cpu bitmap setting algorithm causes a couple of complaints which
have been tagged.
---
 src/xen/xen_hypervisor.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/xen/xen_hypervisor.c b/src/xen/xen_hypervisor.c
index a770f53..bfee56d 100644
--- a/src/xen/xen_hypervisor.c
+++ b/src/xen/xen_hypervisor.c
@@ -1795,8 +1795,11 @@ virXen_setvcpumap(int handle, int id, unsigned int vcpu,
             return -1;
 
         memset(pm, 0, sizeof(cpumap_t));
-        for (j = 0; j < maplen; j++)
+        for (j = 0; j < maplen; j++) {
+            /* coverity[ptr_arith] */
+            /* coverity[sign_extension] */
             *(pm + (j / 8)) |= cpumap[j] << (8 * (j & 7));
+        }
 
         if (hv_versions.hypervisor == 1) {
             xen_op_v1 op;
-- 
1.7.11.7




More information about the libvir-list mailing list