aboutsummaryrefslogtreecommitdiff
path: root/target-i386/kvm.c
diff options
context:
space:
mode:
authorChristian Borntraeger <borntraeger@de.ibm.com>2014-10-30 09:33:23 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2014-12-15 12:21:01 +0100
commitd19ae73e987ecc13a89c0830b501341103d06982 (patch)
treeed3e2c1a81c8825e06e635dccfb596ebfe93cd4d /target-i386/kvm.c
parentc7fe4b12984a36b87438080e48aff5e8f6d48ac9 (diff)
valgrind/i386: avoid false positives on KVM_GET_MSRS ioctl
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>
Diffstat (limited to 'target-i386/kvm.c')
-rw-r--r--target-i386/kvm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index 93927bd93b..1762c2e184 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -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;