From 5e0b7d8869a567d8f535f63510adf8f53ca438d3 Mon Sep 17 00:00:00 2001 From: Christian Borntraeger Date: Tue, 14 Oct 2014 11:55:49 +0200 Subject: valgrind/i386: avoid false positives on KVM_SET_CLOCK ioctl kvm_clock_data contains pad fields. Let's use a designated initializer to avoid false positives from valgrind/memcheck. Signed-off-by: Christian Borntraeger Signed-off-by: Paolo Bonzini --- hw/i386/kvm/clock.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'hw/i386/kvm') diff --git a/hw/i386/kvm/clock.c b/hw/i386/kvm/clock.c index 58be2bda27..efdf165848 100644 --- a/hw/i386/kvm/clock.c +++ b/hw/i386/kvm/clock.c @@ -88,7 +88,7 @@ static void kvmclock_vm_state_change(void *opaque, int running, int ret; if (running) { - struct kvm_clock_data data; + struct kvm_clock_data data = {}; uint64_t time_at_migration = kvmclock_current_nsec(s); s->clock_valid = false; @@ -99,7 +99,6 @@ static void kvmclock_vm_state_change(void *opaque, int running, } data.clock = s->clock; - data.flags = 0; ret = kvm_vm_ioctl(kvm_state, KVM_SET_CLOCK, &data); if (ret < 0) { fprintf(stderr, "KVM_SET_CLOCK failed: %s\n", strerror(ret)); -- cgit v1.2.3