From patchwork Thu Oct 30 09:36:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Borntraeger X-Patchwork-Id: 404949 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 2427D140080 for ; Thu, 30 Oct 2014 20:37:37 +1100 (AEDT) Received: from localhost ([::1]:51642 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjmAg-0004Uy-P0 for incoming@patchwork.ozlabs.org; Thu, 30 Oct 2014 05:37:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33439) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xjm9r-0003OP-TR for qemu-devel@nongnu.org; Thu, 30 Oct 2014 05:36:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xjm9h-0007Bb-JH for qemu-devel@nongnu.org; Thu, 30 Oct 2014 05:36:43 -0400 Received: from e06smtp11.uk.ibm.com ([195.75.94.107]:42899) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xjm9h-0007Ay-95 for qemu-devel@nongnu.org; Thu, 30 Oct 2014 05:36:33 -0400 Received: from /spool/local by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 30 Oct 2014 09:36:32 -0000 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 30 Oct 2014 09:36:29 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 1CFAE219005F for ; Thu, 30 Oct 2014 09:36:04 +0000 (GMT) Received: from d06av08.portsmouth.uk.ibm.com (d06av08.portsmouth.uk.ibm.com [9.149.37.249]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s9U9aSuv8519990 for ; Thu, 30 Oct 2014 09:36:28 GMT Received: from d06av08.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s9U9aS5i007763 for ; Thu, 30 Oct 2014 03:36:28 -0600 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s9U9aRaw007755; Thu, 30 Oct 2014 03:36:28 -0600 Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 25651) id DB6BA1224439; Thu, 30 Oct 2014 10:36:27 +0100 (CET) From: Christian Borntraeger To: Paolo Bonzini , Peter Maydell Date: Thu, 30 Oct 2014 10:36:42 +0100 Message-Id: <1414661809-21383-3-git-send-email-borntraeger@de.ibm.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1414661809-21383-1-git-send-email-borntraeger@de.ibm.com> References: <1414661809-21383-1-git-send-email-borntraeger@de.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14103009-0005-0000-0000-000001DD507E X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 195.75.94.107 Cc: Christian Borntraeger , qemu-devel Subject: [Qemu-devel] [PATCH 2/9] valgrind/i386: avoid false positives on KVM_SET_CLOCK ioctl X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org kvm_clock_data contains pad fields. Let's use a designated initializer to avoid false positives from valgrind/memcheck. Signed-off-by: Christian Borntraeger --- hw/i386/kvm/clock.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/i386/kvm/clock.c b/hw/i386/kvm/clock.c index 1ac60d6..78f5d26 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));