From nobody Fri May 3 13:15:05 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=1558961652; cv=none; d=zoho.com; s=zohoarc; b=QOZlHVkqNmYxJV0IOP1ES4kIdi27FfY/bToavXt45ta02iJPhO5MiiKQX/quzXzHX1zx+Up6KZXDcRydAhkZZeLXUTKFwzQPcQqMDhMWUhPDOib9RUiwUq/SepGK4O0oF4dISCvmmosmwDjstburbhAUc+p/OvLILhGBAf4Sc3c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558961652; 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=43ETvfEhs+fHhrFX6KRMOZcU3xQN8LQYJPRDE+6VGMM=; b=bmIeiE91vljMJaKTxf4C0HfFn4RX2113hR0tXudOXV04P6tYdWr8D+qytY9Pc44pBYZ5irqlogab2s+Ap2Yg6XA3e11OzPy2B+qNxz/NUjViZr143GItbPDi1uRRiWcGjC0GAcN3PkmosoAgAATrtWH4OUU6v1l2fLRgpcsIcK8= 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 1558961651985487.94905283913147; Mon, 27 May 2019 05:54:11 -0700 (PDT) Received: from localhost ([127.0.0.1]:45503 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVF8f-0004av-TT for importer@patchew.org; Mon, 27 May 2019 08:54:05 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56475) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVF6q-0003aI-Le for qemu-devel@nongnu.org; Mon, 27 May 2019 08:52:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVF6p-0002d1-Oq for qemu-devel@nongnu.org; Mon, 27 May 2019 08:52:12 -0400 Received: from relay.sw.ru ([185.231.240.75]:38456) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hVF6o-0002bL-Kq; Mon, 27 May 2019 08:52:11 -0400 Received: from [172.16.25.136] (helo=localhost.sw.ru) by relay.sw.ru with esmtp (Exim 4.91) (envelope-from ) id 1hVF6h-0002Co-I6; Mon, 27 May 2019 15:52:03 +0300 From: Andrey Shinkevich To: qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Mon, 27 May 2019 15:52:01 +0300 Message-Id: <1558961521-131620-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] qcow2-bitmap: initialize bitmap directory alignment 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, den@openvz.org, vsementsov@virtuozzo.com, andrey.shinkevich@virtuozzo.com, mreitz@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" Valgrind detects multiple issues in QEMU iotests when the memory is used without being initialized. Valgrind may dump lots of unnecessary reports what makes the memory issue analysis harder. Particularly, that is true for the aligned bitmap directory and can be seen while running the iotest #169. Padding the aligned space with zeros eases the pain. Signed-off-by: Andrey Shinkevich --- block/qcow2-bitmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c index 8a75366..4941764 100644 --- a/block/qcow2-bitmap.c +++ b/block/qcow2-bitmap.c @@ -754,7 +754,7 @@ static int bitmap_list_store(BlockDriverState *bs, Qcow= 2BitmapList *bm_list, dir_offset =3D *offset; } =20 - dir =3D g_try_malloc(dir_size); + dir =3D g_try_malloc0(dir_size); if (dir =3D=3D NULL) { return -ENOMEM; } --=20 1.8.3.1