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: 9868751 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 4C1A16035E for ; Fri, 28 Jul 2017 13:13:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3AA95288F1 for ; Fri, 28 Jul 2017 13:13:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2F9CF288E4; Fri, 28 Jul 2017 13:13:00 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 899A4288E4 for ; Fri, 28 Jul 2017 13:12:59 +0000 (UTC) Received: from localhost ([::1]:48341 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1db54c-0007ge-GT for patchwork-qemu-devel@patchwork.kernel.org; Fri, 28 Jul 2017 09:12:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44282) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1db53n-0007fW-Es for qemu-devel@nongnu.org; Fri, 28 Jul 2017 09:12:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1db53m-00048M-H2 for qemu-devel@nongnu.org; Fri, 28 Jul 2017 09:12:07 -0400 Received: from mo6-p00-ob.smtp.rzone.de ([2a01:238:20a:202:5300::7]:30955) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1db53k-00046A-8Q; Fri, 28 Jul 2017 09:12:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1501247522; l=814; s=domk; d=aepfle.de; h=Date:Subject:Cc:To:From; bh=wdkMifzkZBHsRG5k/4gcizfSEx7LqatH5qzq5Z/1Lt0=; b=xmxB/+JGjsd9325hg2XwMlZKA2Mc1+772lQ6t0NuPGkO25tVQv96zTrOEGFDLEfKz/ yKn7rCU+Lqg6AgXdzJ4S8GoQ7QL6brFLPISkAgHsgrSM5trIJz7Xf2o5HgM0oJGayDVr 9liYIFur7PIoAndn+bb2NBtaIUu0ZoQMEvQnk= 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 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 2a01:238:20a:202:5300::7 Subject: [Qemu-devel] [PATCH v2] xen-disk: use g_new0 to fix build 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: Olaf Hering Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-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; }