valgrind/i386: avoid false positives on KVM_GET_MSRS ioctl
authorChristian Borntraeger <borntraeger@de.ibm.com>
Thu, 30 Oct 2014 08:33:23 +0000 (09:33 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 15 Dec 2014 11:21:01 +0000 (12:21 +0100)
struct kvm_msrs contains a pad field. Let's use a designated
initializer on the info part to avoid false positives from
valgrind/memcheck.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target-i386/kvm.c

index 93927bd93bf7572517dc0e31d3cb2325a58bb0c3..1762c2e184856adcef4d8736382140cd689b2e20 100644 (file)
@@ -1655,7 +1655,10 @@ static int kvm_get_msrs(X86CPU *cpu)
         }
     }
 
-    msr_data.info.nmsrs = n;
+    msr_data.info = (struct kvm_msrs) {
+        .nmsrs = n,
+    };
+
     ret = kvm_vcpu_ioctl(CPU(cpu), KVM_GET_MSRS, &msr_data);
     if (ret < 0) {
         return ret;