From nobody Mon Apr 29 19:18:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=1; a=rsa-sha256; t=1559154135; cv=none; d=zoho.com; s=zohoarc; b=jMneudvAW2m+ZQ6bye2bXX+8c2J6QzdBo3cQmmfcHVyaMqxPGOQAfwdW98kPdsxXUYrXy1RDnBSFGTN3JXX/z4XpsYBrsk7ULvcQwE1myUGW5xIDUQRySCLl8KbaoaSpu239hbcta2oGSq0oE92djJUh3HiArKPYnsAF4cPvjCc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559154135; h=Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=JtpZmCU3NejzzC2hHBg8bwf5eUbhFu0bAlvuSDKWus0=; b=i2K+5809xRJvunya2qS6OaIU7IpjODjM3USdQV67i/uBk8pvuPSLEoVhwh0/C4uf+22nL7fsiLd7RmxaTBwB76yxF0s0LNA2fRho43qY4g5OcIiAm9br6qig7itMqed42BAK3i0/UarfjfbkkN+EIeiOJJOrj3TJkHmdR69MyNw= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1559154135919641.2143466568253; Wed, 29 May 2019 11:22:15 -0700 (PDT) Received: from localhost ([127.0.0.1]:58951 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hW3DC-0003vZ-St for importer@patchew.org; Wed, 29 May 2019 14:22:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59682) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hW3Bi-00031D-MJ for qemu-devel@nongnu.org; Wed, 29 May 2019 14:20:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hW3Bh-0006Fa-Iy for qemu-devel@nongnu.org; Wed, 29 May 2019 14:20:34 -0400 Received: from relay.sw.ru ([185.231.240.75]:48886) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hW3Bg-0006Cw-T3; Wed, 29 May 2019 14:20:33 -0400 Received: from [172.16.25.136] (helo=localhost.sw.ru) by relay.sw.ru with esmtp (Exim 4.91) (envelope-from ) id 1hW3Bd-0006Yr-D5; Wed, 29 May 2019 21:20:29 +0300 From: Andrey Shinkevich To: qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Wed, 29 May 2019 21:20:27 +0300 Message-Id: <1559154027-282547-1-git-send-email-andrey.shinkevich@virtuozzo.com> X-Mailer: git-send-email 1.8.3.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 185.231.240.75 Subject: [Qemu-devel] [PATCH v2] hw/block/fdc: floppy command FIFO memory initialization X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, vsementsov@virtuozzo.com, mreitz@redhat.com, andrey.shinkevich@virtuozzo.com, den@openvz.org, jsnow@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The uninitialized memory allocated for the command FIFO of the floppy controller during the VM hardware initialization incurs many unwanted reports by Valgrind when VM state is being saved. That verbosity hardens a search for the real memory issues when the iotests run. Particularly, the patch eliminates 20 unnecessary reports of the Valgrind tool in the iotest #169. Signed-off-by: Andrey Shinkevich Reviewed-by: John Snow --- v2: 01: The pointer unnecessary check 'if (fdctrl->fifo)' was removed as suggested by John. hw/block/fdc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/block/fdc.c b/hw/block/fdc.c index 6f19f12..9af762b 100644 --- a/hw/block/fdc.c +++ b/hw/block/fdc.c @@ -2647,6 +2647,7 @@ static void fdctrl_realize_common(DeviceState *dev, F= DCtrl *fdctrl, =20 FLOPPY_DPRINTF("init controller\n"); fdctrl->fifo =3D qemu_memalign(512, FD_SECTOR_LEN); + memset(fdctrl->fifo, 0, FD_SECTOR_LEN); fdctrl->fifo_size =3D 512; fdctrl->result_timer =3D timer_new_ns(QEMU_CLOCK_VIRTUAL, fdctrl_result_timer, fdctrl); --=20 1.8.3.1