From d19ae73e987ecc13a89c0830b501341103d06982 Mon Sep 17 00:00:00 2001 From: Christian Borntraeger Date: Thu, 30 Oct 2014 09:33:23 +0100 Subject: [PATCH] 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 Signed-off-by: Paolo Bonzini --- target-i386/kvm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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;