Skip to content

Commit

Permalink
valgrind/i386: avoid false positives on KVM_GET_MSRS ioctl
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
borntraeger authored and bonzini committed Dec 15, 2014
1 parent c7fe4b1 commit d19ae73
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion target-i386/kvm.c
Expand Up @@ -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;
Expand Down

0 comments on commit d19ae73

Please sign in to comment.