From nobody Tue Feb 10 01:16:03 2026 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1572113113; cv=none; d=zoho.com; s=zohoarc; b=MTgrotko3yQrdch1tpr12sA3QUoU0jXpU6k1wCNML+77QtBj8kVSCX3jgz4LGFhZ4PvrFjctru8pGdfXg8Cm1AtUUffkxczxiHj4Si9CYFk1P7niTnxeq9vYJmDB5rssg3VSgUvHUR9xiVOU11FMM1thR5G0TS/GCK9DkqpvBV0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572113113; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=kIuqxFJswQw22BLqqL3QoIYGMI169VzfUiVYocQoBkU=; b=ROCguuHkRUtGh9S/43JNHMPX8RIqdHMuQqCR14LU/qXA3ytDNxRuPMK2WKkk8e55R9lyu58TdaKJh+Gr5Va4ObjrHsbO+do586ReMBrk1sazrYG5wo6s9zAlxJ87xJA/vViSmBAgm2/dICDDS2eVHEBAqIqh0X6oD9S0dXtThDI= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1572113113697602.95980484837; Sat, 26 Oct 2019 11:05:13 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iOQPl-0005aT-JN; Sat, 26 Oct 2019 18:03:49 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iOQPk-0005ZO-7c for xen-devel@lists.xenproject.org; Sat, 26 Oct 2019 18:03:48 +0000 Received: from us-smtp-1.mimecast.com (unknown [207.211.31.120]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id f2f54809-f81a-11e9-94d7-12813bfff9fa; Sat, 26 Oct 2019 18:03:44 +0000 (UTC) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-341-FIb2hg0IP66tzJR3pTmWow-1; Sat, 26 Oct 2019 14:03:40 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B39BF5E6; Sat, 26 Oct 2019 18:03:38 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-39.brq.redhat.com [10.40.204.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2451B60F82; Sat, 26 Oct 2019 18:03:30 +0000 (UTC) X-Inumbo-ID: f2f54809-f81a-11e9-94d7-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572113023; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Lt5h0tf7aQi9H+UHQOfKlnMmiCztk0u8qFBuajQLpTc=; b=cmYmMxTn2sbqERY5JQgmI8OtOSdvId0X5vPppErWxs36QA5mCPy8E2jv6D7RUUsH7Mv5aS 6wYUb0hJMSd/gOOc0KmLrHwO9QNDTlnJYTVUjMXqyzkPz5MT4g3pAWB4t4UlKIGvx64oLX oDbUSY1EzVnArTfh9Z3t1r79+s/hocw= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Sat, 26 Oct 2019 20:01:32 +0200 Message-Id: <20191026180143.7369-10-philmd@redhat.com> In-Reply-To: <20191026180143.7369-1-philmd@redhat.com> References: <20191026180143.7369-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: FIb2hg0IP66tzJR3pTmWow-1 X-Mimecast-Spam-Score: 0 Subject: [Xen-devel] [PATCH v3 09/20] hw/mips/mips_malta: Create IDE hard drive array dynamically X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Eduardo Habkost , Paul Durrant , Aleksandar Markovic , "Michael S. Tsirkin" , Li Qiang , xen-devel@lists.xenproject.org, =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Marcel Apfelbaum , Igor Mammedov , Anthony Perard , Paolo Bonzini , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Richard Henderson Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) In the next commit we'll refactor the PIIX4 code out of mips_malta_init(). As a preliminary step, add the 'ide_drives' variable and create the drive array dynamically. Reviewed-by: Aleksandar Markovic Reviewed-by: Li Qiang Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/mips/mips_malta.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 645c223edb..239ea98ef8 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -1235,7 +1235,8 @@ void mips_malta_init(MachineState *machine) int piix4_devfn; I2CBus *smbus; DriveInfo *dinfo; - DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; + const size_t ide_drives =3D MAX_IDE_BUS * MAX_IDE_DEVS; + DriveInfo **hd; int fl_idx =3D 0; int be; =20 @@ -1406,7 +1407,8 @@ void mips_malta_init(MachineState *machine) pci_bus =3D gt64120_register(s->i8259); =20 /* Southbridge */ - ide_drive_get(hd, ARRAY_SIZE(hd)); + hd =3D g_new(DriveInfo *, ide_drives); + ide_drive_get(hd, ide_drives); =20 pci =3D pci_create_simple_multifunction(pci_bus, PCI_DEVFN(10, 0), true, TYPE_PIIX4_PCI_DEVICE); @@ -1421,6 +1423,7 @@ void mips_malta_init(MachineState *machine) } =20 pci_piix4_ide_init(pci_bus, hd, piix4_devfn + 1); + g_free(hd); pci_create_simple(pci_bus, piix4_devfn + 2, "piix4-usb-uhci"); smbus =3D piix4_pm_init(pci_bus, piix4_devfn + 3, 0x1100, isa_get_irq(NULL, 9), NULL, 0, NULL); --=20 2.21.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel