From patchwork Thu Sep 21 02:22:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 9963189 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 69FE9602D8 for ; Thu, 21 Sep 2017 02:23:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 55189292C0 for ; Thu, 21 Sep 2017 02:23:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 49B39292C4; Thu, 21 Sep 2017 02:23:28 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 792BC292C0 for ; Thu, 21 Sep 2017 02:23:27 +0000 (UTC) Received: from localhost ([::1]:51456 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dur9C-0002U3-Oq for patchwork-qemu-devel@patchwork.kernel.org; Wed, 20 Sep 2017 22:23:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34610) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dur8G-0002Sa-TY for qemu-devel@nongnu.org; Wed, 20 Sep 2017 22:22:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dur8F-0008CF-T6 for qemu-devel@nongnu.org; Wed, 20 Sep 2017 22:22:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:48632) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dur8F-0008Bk-N7 for qemu-devel@nongnu.org; Wed, 20 Sep 2017 22:22:27 -0400 Received: from sstabellini-ThinkPad-X260.hsd1.ca.comcast.net (c-24-130-70-9.hsd1.ca.comcast.net [24.130.70.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 722D4217C5; Thu, 21 Sep 2017 02:22:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 722D4217C5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=sstabellini@kernel.org From: Stefano Stabellini To: peter.maydell@linaro.org, stefanha@gmail.com Date: Wed, 20 Sep 2017 19:22:23 -0700 Message-Id: <1505960544-12202-1-git-send-email-sstabellini@kernel.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 198.145.29.99 Subject: [Qemu-devel] [PULL 1/2] 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 , sstabellini@kernel.org, qemu-devel@nongnu.org, stefanha@redhat.com, anthony.perard@citrix.com, xen-devel@lists.xenproject.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Olaf Hering 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: Stefano Stabellini Signed-off-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 d42ed70..536e2ee 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; }