Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A7C96C4828F for ; Thu, 1 Feb 2024 16:20:49 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.674535.1049541 (Exim 4.92) (envelope-from ) id 1rVZnq-0002Us-F8; Thu, 01 Feb 2024 16:20:38 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 674535.1049541; Thu, 01 Feb 2024 16:20:38 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rVZnq-0002Ul-B7; Thu, 01 Feb 2024 16:20:38 +0000 Received: by outflank-mailman (input) for mailman id 674535; Thu, 01 Feb 2024 16:20:36 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rVZno-0002UK-Bz for xen-devel@lists.xenproject.org; Thu, 01 Feb 2024 16:20:36 +0000 Received: from gandalf.ozlabs.org (mail.ozlabs.org [2404:9400:2221:ea00::3]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id d0e4465b-c11d-11ee-98f5-efadbce2ee36; Thu, 01 Feb 2024 17:20:33 +0100 (CET) Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4TQkf30k39z4wcW; Fri, 2 Feb 2024 03:20:27 +1100 (AEDT) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4TQkdZ2ZRRz4wcN; Fri, 2 Feb 2024 03:20:02 +1100 (AEDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: d0e4465b-c11d-11ee-98f5-efadbce2ee36 Message-ID: Date: Thu, 1 Feb 2024 17:19:54 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 22/47] hw/arm/aspeed: use qemu_configure_nic_device() Content-Language: en-US To: David Woodhouse , qemu-devel@nongnu.org Cc: Richard Henderson , Beniamino Galvani , Peter Maydell , Strahinja Jankovic , Niek Linnenbank , Andrew Jeffery , Joel Stanley , Igor Mitsyanko , Jean-Christophe Dubois , Andrey Smirnov , =?UTF-8?Q?Philippe_Mathieu-Daud=C3=A9?= , Rob Herring , Subbaraya Sundeep , Jan Kiszka , Tyrone Ting , Hao Wu , Radoslaw Biernacki , Leif Lindholm , Marcin Juszkiewicz , "Edgar E. Iglesias" , Alistair Francis , Helge Deller , Paolo Bonzini , Eduardo Habkost , "Michael S. Tsirkin" , Marcel Apfelbaum , Song Gao , Thomas Huth , Laurent Vivier , Huacai Chen , Jiaxun Yang , =?UTF-8?Q?Herv=C3=A9_Poussineau?= , Aleksandar Rikalo , Aurelien Jarno , Jason Wang , Jia Liu , Stafford Horne , Mark Cave-Ayland , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Bin Meng , Palmer Dabbelt , Weiwei Li , Liu Zhiwei , Halil Pasic , Christian Borntraeger , Eric Farman , David Hildenbrand , Ilya Leoshkevich , Yoshinori Sato , Magnus Damm , Artyom Tarasenko , Stefano Stabellini , Anthony Perard , Paul Durrant , Max Filippov , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, qemu-s390x@nongnu.org, xen-devel@lists.xenproject.org, David Woodhouse References: <20240126173228.394202-1-dwmw2@infradead.org> <20240126173228.394202-23-dwmw2@infradead.org> From: =?UTF-8?Q?C=C3=A9dric_Le_Goater?= In-Reply-To: <20240126173228.394202-23-dwmw2@infradead.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 1/26/24 18:24, David Woodhouse wrote: > From: David Woodhouse > > Signed-off-by: David Woodhouse > Acked-by: Cédric Le Goater and Reviewed-by: Cédric Le Goater Thanks, C. > --- > hw/arm/aspeed.c | 9 ++++----- > 1 file changed, 4 insertions(+), 5 deletions(-) > > diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c > index cc59176563..bed5e4f40b 100644 > --- a/hw/arm/aspeed.c > +++ b/hw/arm/aspeed.c > @@ -356,7 +356,6 @@ static void aspeed_machine_init(MachineState *machine) > AspeedMachineClass *amc = ASPEED_MACHINE_GET_CLASS(machine); > AspeedSoCClass *sc; > int i; > - NICInfo *nd = &nd_table[0]; > > bmc->soc = ASPEED_SOC(object_new(amc->soc_name)); > object_property_add_child(OBJECT(machine), "soc", OBJECT(bmc->soc)); > @@ -371,10 +370,10 @@ static void aspeed_machine_init(MachineState *machine) > &error_fatal); > > for (i = 0; i < sc->macs_num; i++) { > - if ((amc->macs_mask & (1 << i)) && nd->used) { > - qemu_check_nic_model(nd, TYPE_FTGMAC100); > - qdev_set_nic_properties(DEVICE(&bmc->soc->ftgmac100[i]), nd); > - nd++; > + if ((amc->macs_mask & (1 << i)) && > + !qemu_configure_nic_device(DEVICE(&bmc->soc->ftgmac100[i]), > + true, NULL)) { > + break; /* No configs left; stop asking */ > } > } >