From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1qwM0d-0001py-Q5 for mharc-qemu-devel@gnu.org; Fri, 27 Oct 2023 08:32:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qwM0W-0001jh-BH for qemu-devel@nongnu.org; Fri, 27 Oct 2023 08:32:12 -0400 Received: from hsmtpd-def.xspmail.jp ([202.238.198.238]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qwM0O-0003l9-1m for qemu-devel@nongnu.org; Fri, 27 Oct 2023 08:32:06 -0400 X-Country-Code: JP Received: from sakura.ysato.name (ik1-413-38519.vs.sakura.ne.jp [153.127.30.23]) by hsmtpd-out-0.asahinet.cluster.xspmail.jp (Halon) with ESMTPA id cf9071da-cfc2-430a-aae8-d12cacb28888; Fri, 27 Oct 2023 21:31:54 +0900 (JST) Received: from SIOS1075.ysato.ml (ZM005235.ppp.dion.ne.jp [222.8.5.235]) by sakura.ysato.name (Postfix) with ESMTPSA id 755761C0037; Fri, 27 Oct 2023 21:31:45 +0900 (JST) Date: Fri, 27 Oct 2023 21:31:44 +0900 Message-ID: <87sf5wi6vj.wl-ysato@users.sourceforge.jp> From: Yoshinori Sato To: David Woodhouse Cc: qemu-devel@nongnu.org, Richard Henderson , Beniamino Galvani , Peter Maydell , Strahinja Jankovic , Niek Linnenbank , =?ISO-8859-1?Q?C=E9dric?= Le Goater , Andrew Jeffery , Joel Stanley , Igor Mitsyanko , Jean-Christophe Dubois , Andrey Smirnov , Philippe =?ISO-8859-1?Q?Mathieu-Daud=E9?= , 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 , =?ISO-8859-1?Q?Herv=E9?= 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 , David Hildenbrand , Ilya Leoshkevich , Halil Pasic , Christian Borntraeger , Eric Farman , 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 Subject: Re: [PATCH 18/45] hw/sh4/r2d: use pci_init_nic_devices() In-Reply-To: <20231022155200.436340-19-dwmw2@infradead.org> References: <20231022155200.436340-1-dwmw2@infradead.org> <20231022155200.436340-19-dwmw2@infradead.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Received-SPF: softfail client-ip=202.238.198.238; envelope-from=ysato@users.sourceforge.jp; helo=hsmtpd-def.xspmail.jp X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Oct 2023 12:32:12 -0000 On Mon, 23 Oct 2023 00:51:33 +0900, David Woodhouse wrote: > > From: David Woodhouse > > Previously, the first PCI NIC would be assigned to slot 2 even if the > user override the model and made it something other than an rtl8139 > which is the default. Everything else would be dynamically assigned. > > Now, the first rtl8139 gets slot 2 and everything else is dynamic. > > Signed-off-by: David Woodhouse Reviewed-by: Yoshinori Sato > --- > hw/sh4/r2d.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c > index 4944994e9c..e9f316a6ce 100644 > --- a/hw/sh4/r2d.c > +++ b/hw/sh4/r2d.c > @@ -240,7 +240,6 @@ static void r2d_init(MachineState *machine) > MemoryRegion *sdram = g_new(MemoryRegion, 1); > qemu_irq *irq; > DriveInfo *dinfo; > - int i; > DeviceState *dev; > SysBusDevice *busdev; > MemoryRegion *address_space_mem = get_system_memory(); > @@ -309,9 +308,8 @@ static void r2d_init(MachineState *machine) > 0x555, 0x2aa, 0); > > /* NIC: rtl8139 on-board, and 2 slots. */ > - for (i = 0; i < nb_nics; i++) > - pci_nic_init_nofail(&nd_table[i], pci_bus, > - mc->default_nic, i == 0 ? "2" : NULL); > + pci_init_nic_in_slot(pci_bus, mc->default_nic, NULL, "2"); > + pci_init_nic_devices(pci_bus, mc->default_nic); > > /* USB keyboard */ > usb_create_simple(usb_bus_find(-1), "usb-kbd"); > -- > 2.40.1 > -- Yosinori Sato