From patchwork Fri Jul 28 13:11:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olaf Hering X-Patchwork-Id: 9868757 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 384BF6038F for ; Fri, 28 Jul 2017 13:14:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 26679288D0 for ; Fri, 28 Jul 2017 13:14:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1B193288D4; Fri, 28 Jul 2017 13:14:47 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,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 AE5B2288D2 for ; Fri, 28 Jul 2017 13:14:46 +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 1db53n-00057X-7v; Fri, 28 Jul 2017 13:12:07 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1db53l-00057R-Uu for xen-devel@lists.xenproject.org; Fri, 28 Jul 2017 13:12:06 +0000 Received: from [85.158.143.35] by server-7.bemta-6.messagelabs.com id 89/7C-03557-5283B795; Fri, 28 Jul 2017 13:12:05 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrBLMWRWlGSWpSXmKPExsUSuHLSIl0Vi+p Ig88TTC2+b5nM5MDocfjDFZYAxijWzLyk/IoE1ow5TS1MBTvZKnpmLmJsYFzB2sXIxcEi8IhJ 4tLzRqYuRk4OCYFMiTPn37B1MXIA2SIST/6ngdQICRxkkti34QsLSA2bgJLE3oPHGUESIgK7m CTWNN9gBEkwCyhIvHi+FWyQsICpxOR3y8AaWARUJWbfnARWwytgJDHh3llmiGXyEu/6nzJNYO RewMiwilG9OLWoLLVI11gvqSgzPaMkNzEzR9fQwEwvN7W4ODE9NScxqVgvOT93EyPQvwxAsIO x45/TIUZJDiYlUd6bZtWRQnxJ+SmVGYnFGfFFpTmpxYcYZTg4lCR4z4LkBItS01Mr0jJzgIEG k5bg4FES4ZU1B0rzFhck5hZnpkOkTjEaczR92PKFiePVhP/fmIRY8vLzUqXEeb+DTBIAKc0oz YMbBIuAS4yyUsK8jECnCfEUpBblZpagyr9iFOdgVBKGmMKTmVcCt+8V0ClMQKdMbKoEOaUkES El1cC4J790g029E+cDLu6pJQxKd1WeTGyctSj+A/sN1vezCgtkap1EEiqlDgi/Xva9UygsWTb tov/8b5HczzZln7ItW8U8yWh9OvdUtluPdmU8N/p3b+Pxl7ZS3nN3Xq7dm3bhqGriq2/8HsIh fxp/3C/bOWHZs72V23UuJ3m9Y4jkSZ15RC8rfo6LEktxRqKhFnNRcSIAAENl3nsCAAA= X-Env-Sender: olaf@aepfle.de X-Msg-Ref: server-14.tower-21.messagelabs.com!1501247524!68786569!1 X-Originating-IP: [81.169.146.162] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: QmFkIElQOiA4MS4xNjkuMTQ2LjE2MiA9PiA1ODg3NDY=\n,sa_preprocessor: QmFkIElQOiA4MS4xNjkuMTQ2LjE2MiA9PiA1ODg3NDY=\n X-StarScan-Received: X-StarScan-Version: 9.4.25; banners=-,-,- X-VirusChecked: Checked Received: (qmail 26611 invoked from network); 28 Jul 2017 13:12:04 -0000 Received: from mo4-p00-ob.smtp.rzone.de (HELO mo4-p00-ob.smtp.rzone.de) (81.169.146.162) by server-14.tower-21.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 28 Jul 2017 13:12:04 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1501247524; l=814; s=domk; d=aepfle.de; h=Date:Subject:Cc:To:From; bh=wdkMifzkZBHsRG5k/4gcizfSEx7LqatH5qzq5Z/1Lt0=; b=R0kxW7mK8YndgHrtu1CAFdkF7mUTJMbes29hoLs197c6K0jo/BUbwz8Em1H9LY3mSR FeMDXmlpwFavtnKtRPWB119YEnOAsc70bqhSfPJDEql5XEvmMOFySliJy3BqL9f7RpyC ovgjj1VAto5R+KW8yhULSZdQxqquWWexPtNMw= X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+yackYocTD1iAi8x+OWi/zfN1cLnAYQ78nDBeZKUqR2JOG6DB8E6blGGIfEYe8p7s53wH X-RZG-CLASS-ID: mo00 Received: from sender ([2001:a61:1044:dcff:dad:940f:f4ac:9814]) by smtp.strato.de (RZmta 41.1 AUTH) with ESMTPSA id e0433dt6SDBxWad (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Fri, 28 Jul 2017 15:11:59 +0200 (CEST) From: Olaf Hering To: Stefano Stabellini , Anthony Perard , Kevin Wolf , Max Reitz , xen-devel@lists.xenproject.org (open list:X86), qemu-block@nongnu.org (open list:Block layer core), qemu-devel@nongnu.org (open list:All patches CC here) Date: Fri, 28 Jul 2017 15:11:51 +0200 Message-Id: <20170728131151.4802-1-olaf@aepfle.de> X-Mailer: git-send-email 2.13.2 Cc: Olaf Hering Subject: [Xen-devel] [PATCH v2] xen-disk: use g_new0 to fix build 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 g_malloc0_n is available since glib-2.24. To allow build with older glib versions use the generic g_new0, which is already used in many other places in the code. Fixes commit 3284fad728 ("xen-disk: add support for multi-page shared rings") Signed-off-by: Olaf Hering Reviewed-by: Eric Blake Reviewed-by: Stefano Stabellini --- hw/block/xen_disk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c index d42ed7070d..536e2ee735 100644 --- a/hw/block/xen_disk.c +++ b/hw/block/xen_disk.c @@ -1232,7 +1232,7 @@ static int blk_connect(struct XenDevice *xendev) return -1; } - domids = g_malloc0_n(blkdev->nr_ring_ref, sizeof(uint32_t)); + domids = g_new0(uint32_t, blkdev->nr_ring_ref); for (i = 0; i < blkdev->nr_ring_ref; i++) { domids[i] = blkdev->xendev.dom; }