From patchwork Fri Sep 2 16:39:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamas Lengyel X-Patchwork-Id: 9311419 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8B5F460756 for ; Fri, 2 Sep 2016 16:42:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C07A297F6 for ; Fri, 2 Sep 2016 16:42:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6DC1C29817; Fri, 2 Sep 2016 16:42:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RCVD_IN_SORBS_SPAM,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 71659297F6 for ; Fri, 2 Sep 2016 16:42:39 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bfrVZ-0002we-3w; Fri, 02 Sep 2016 16:40:01 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bfrVX-0002wH-Nj for xen-devel@lists.xenproject.org; Fri, 02 Sep 2016 16:39:59 +0000 Received: from [193.109.254.147] by server-3.bemta-6.messagelabs.com id 13/77-05661-E5BA9C75; Fri, 02 Sep 2016 16:39:58 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupjkeJIrShJLcpLzFFi42K5GHrNRTdu9cl wg92bpSy+b5nM5MDocfjDFZYAxijWzLyk/IoE1oz7P3tYCq5zVZw7fYG1gXE1ZxcjF4eQwAxG iQ93t7GAOCwCb1gkXn/ax9zFyMkhIfCORWLOlBIIO0bi1M4lLBB2hcSWW7vYQWwhAU2JgxvOM ENMmsgk8bprIRtIgk3ASOLq1R4wW0RASeLeqslMIDazQJVE75PnYM3CAjYS/65cAYuzCKhK/H j+CWwBr4C9xJHuGWwQy+QkLm37wjyBkW8BI8MqRo3i1KKy1CJdIzO9pKLM9IyS3MTMHF1DAzO 93NTi4sT01JzEpGK95PzcTYzAUGEAgh2MZxYEHmKU5GBSEuV9EHAyXIgvKT+lMiOxOCO+qDQn tfgQowwHh5IE79eVQDnBotT01Iq0zBxg0MKkJTh4lER4RVYBpXmLCxJzizPTIVKnGI05tvy+t paJY9vUe2uZhFjy8vNSpcR5N4JMEgApzSjNgxsEi6ZLjLJSwryMQKcJ8RSkFuVmlqDKv2IU52 BUEuZVAlnIk5lXArfvFdApTECnlFw7DnJKSSJCSqqB8cAi+6ZXrN1Gj5fVRaycyX5i87Iv8Uq mbvL8avUtzbPVLlQot0ksrzDb1f5rZ2nulFunE4ovBKtNXlUUGt/Ra9r1aMIFE1bv4H09vfzF 6gafXQ/uXbFpZecR088JXLduTl40/7e3UdyNUx0WF04LKLwwWfnnkdQ3yx7VScazz/uJBV08v OS4pRJLcUaioRZzUXEiAL6n1X6hAgAA X-Env-Sender: tamas.lengyel@zentific.com X-Msg-Ref: server-12.tower-27.messagelabs.com!1472834397!56929796!1 X-Originating-IP: [209.85.214.68] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 34608 invoked from network); 2 Sep 2016 16:39:58 -0000 Received: from mail-it0-f68.google.com (HELO mail-it0-f68.google.com) (209.85.214.68) by server-12.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 2 Sep 2016 16:39:58 -0000 Received: by mail-it0-f68.google.com with SMTP id i184so2418271itf.3 for ; Fri, 02 Sep 2016 09:39:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zentific-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=Ml9+GV1mmKBtVQWWK9r5WhOo2OkfUu2RCnpeFnYUK7k=; b=dcxzuTrrQ2vaodyPi8mKQ/OCJJ+UwknHJDlYoAb6C0yilSUbBgqmyAOrPrHBaF/7lo q5mkvORYe3SZRDtsLeYS1KNs9FqcRgHRPtg/qF5+PaCjnNy7QiT3w2n5uimeUNwizkcj 9eIZdQ43eBbdI1zUtGI/3CS1x/A99iR1cJXA5TAo2f+hCoNPkaKNL0MajlWOB+h11/PG iTCnc4JTQdFA8aDTfwl2w3wOZR8isb3Zn8ZGJyhZOdz2g/FJ87Lz+Tj+xBeHj1WQA3Y4 NXzrSxY6X8hMp+NslI4gin5nkAqQnt1J2r048kBj+Y3RXeeCT5zeRLrvxsg40c/9iPBD 62YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Ml9+GV1mmKBtVQWWK9r5WhOo2OkfUu2RCnpeFnYUK7k=; b=GPcqHP7LmVCZAHpDPrDAzNBlP58kp9FGADYIUYsU+HVFdS8fEwwxR5nRxnAGseSuny q0uEJL4gi9aLjka2JE8M+IZbdO9oopgL+O/0/sqO/k/cuxfo27q7e1NuD33ZKpVX8Aws dlhwLoR1G6Y4cuWThc/eFy6UN/qmF6ZVI7bWxVzmX5MgfYX0+Xp2ubp6VKEDQNMvmloa YfjtBeE2VE03GsTsALQqLfZrhVYffRLHClpM5K67daW2SCZb69Xq5gAwRn0mkEjztALg PIEl+mCCNibd53SKjwgJgM4DvfH9IzP/nQhBo54uZw+a6E6rXiDVw826TaMTqnpTE5HJ 4dOg== X-Gm-Message-State: AE9vXwPfTdWaiSQ65BRmG5+D2fkvaV5T0qAX+nypFqMBDBO6UuG54/runJnAdAo78VM7PA== X-Received: by 10.36.188.65 with SMTP id n62mr6358178ite.61.1472834396875; Fri, 02 Sep 2016 09:39:56 -0700 (PDT) Received: from l1.lan (c-73-14-35-59.hsd1.co.comcast.net. [73.14.35.59]) by smtp.gmail.com with ESMTPSA id u75sm2825610ita.16.2016.09.02.09.39.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Sep 2016 09:39:56 -0700 (PDT) From: Tamas K Lengyel To: xen-devel@lists.xenproject.org Date: Fri, 2 Sep 2016 10:39:52 -0600 Message-Id: <20160902163952.16600-1-tamas.lengyel@zentific.com> X-Mailer: git-send-email 2.9.3 Cc: Tamas K Lengyel , Ian Jackson , Wei Liu Subject: [Xen-devel] [PATCH] libxc: zero-initialize structures in macros X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP While debugging applications built on top of libxc with Valgrind we get a lot of complaining about relying on uninitialized values allocated in libxc. While these warnings are safe to ignore, zero-initializing the structures reduces Valgrind clutter a lot and aids in spotting real bugs. Signed-off-by: Tamas K Lengyel --- Cc: Ian Jackson Cc: Wei Liu --- tools/libxc/xc_private.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h index 75b761c..4e9073b 100644 --- a/tools/libxc/xc_private.h +++ b/tools/libxc/xc_private.h @@ -59,11 +59,11 @@ struct iovec { #include #endif -#define DECLARE_DOMCTL struct xen_domctl domctl -#define DECLARE_SYSCTL struct xen_sysctl sysctl -#define DECLARE_PHYSDEV_OP struct physdev_op physdev_op -#define DECLARE_FLASK_OP struct xen_flask_op op -#define DECLARE_PLATFORM_OP struct xen_platform_op platform_op +#define DECLARE_DOMCTL struct xen_domctl domctl = {0} +#define DECLARE_SYSCTL struct xen_sysctl sysctl = {0} +#define DECLARE_PHYSDEV_OP struct physdev_op physdev_op = {0} +#define DECLARE_FLASK_OP struct xen_flask_op op = {0} +#define DECLARE_PLATFORM_OP struct xen_platform_op platform_op = {0} #undef PAGE_SHIFT #undef PAGE_SIZE