From nobody Sat May 18 11:46:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1684839936; cv=none; d=zohomail.com; s=zohoarc; b=CEGdmiSpcDeodXk6e5728R1QBC9X7+LSmYbyIDVk4xi5PW5ELjIAfOFjCAOFk/yFtHEg5KdyQUCJQ9RfW6WD5f1ISuaeZGGe6/uI+97w5c8efN4e8URLWBDCKbP5F+7tyalgiA9XSDygsdQ04gnsCHXf/rJ9MEpHJ1oGQ01amZQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684839936; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=QPvbxejgj/zHqMIwqaEznsRDu2txeXcjWw0YpkveP5k=; b=ApaQFTBgXsObFawb97LIkulmSGwlVzk9p81kDOlUJHdfb5nBtrP03OWdzAcseIY1C9LTP/67ySdiineEvQFrNqX+8DzsAc82cFpxHQdjWelf65NKCiq9fPVb0mrw310vr435WXRwQrx5DdtsUOclWvhIfhi0UF8YiYEIQwTZKQU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684839936268239.52109915071287; Tue, 23 May 2023 04:05:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1Pp2-0004Tc-7u; Tue, 23 May 2023 07:04:56 -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 1q1Pp0-0004TB-4L for qemu-devel@nongnu.org; Tue, 23 May 2023 07:04:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q1Poy-0002dD-KF for qemu-devel@nongnu.org; Tue, 23 May 2023 07:04:53 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-169-9EK3HNsoNEyTBkSirQCivg-1; Tue, 23 May 2023 07:04:48 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 08874811E78; Tue, 23 May 2023 11:04:48 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.186]) by smtp.corp.redhat.com (Postfix) with ESMTP id 188F39D73; Tue, 23 May 2023 11:04:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684839891; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QPvbxejgj/zHqMIwqaEznsRDu2txeXcjWw0YpkveP5k=; b=G4w8ZP8OQugyqrbvNL8gTCnAtQdazPF3oLPRAlhNsBPW2VTlTKU2DiCZbm+/8VTcJfvvc2 qtKOwI/Ghe4NI5Sw9Ixujh1HtPAcGNXKYgaIJx5AIQe6wyxlRPqlNhA3Ww02JzLEXt5tNs X1U/rDJE+pAtFjbggrE3WFKsMPBxlw0= X-MC-Unique: 9EK3HNsoNEyTBkSirQCivg-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , Helge Deller , Xiaojuan Yang , Song Gao , Max Filippov , Jason Wang Subject: [PATCH 1/5] hw/hppa: Use MachineClass->default_nic in the hppa machine Date: Tue, 23 May 2023 13:04:31 +0200 Message-Id: <20230523110435.1375774-2-thuth@redhat.com> In-Reply-To: <20230523110435.1375774-1-thuth@redhat.com> References: <20230523110435.1375774-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1684839937879100006 Content-Type: text/plain; charset="utf-8" Mark the default NIC via the new MachineClass->default_nic setting so that the machine-defaults code in vl.c can decide whether the default NIC is usable or not (for example when compiling with the "--without-default-devices" configure switch). Signed-off-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Tested-by: Philippe Mathieu-Daud=C3=A9 --- hw/hppa/machine.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 8fea5fa6b8..b00a91ecfe 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -177,6 +177,7 @@ static void machine_hppa_init(MachineState *machine) const char *kernel_filename =3D machine->kernel_filename; const char *kernel_cmdline =3D machine->kernel_cmdline; const char *initrd_filename =3D machine->initrd_filename; + MachineClass *mc =3D MACHINE_GET_CLASS(machine); DeviceState *dev, *dino_dev, *lasi_dev; PCIBus *pci_bus; ISABus *isa_bus; @@ -272,7 +273,7 @@ static void machine_hppa_init(MachineState *machine) =20 for (i =3D 0; i < nb_nics; i++) { if (!enable_lasi_lan()) { - pci_nic_init_nofail(&nd_table[i], pci_bus, "tulip", NULL); + pci_nic_init_nofail(&nd_table[i], pci_bus, mc->default_nic, NU= LL); } } =20 @@ -462,6 +463,7 @@ static void hppa_machine_init_class_init(ObjectClass *o= c, void *data) mc->default_ram_size =3D 512 * MiB; mc->default_boot_order =3D "cd"; mc->default_ram_id =3D "ram"; + mc->default_nic =3D "tulip"; =20 nc->nmi_monitor_handler =3D hppa_nmi; } --=20 2.31.1 From nobody Sat May 18 11:46:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1684839935; cv=none; d=zohomail.com; s=zohoarc; b=J8AP1PZgHMSmKWFP23CnMVz1G7t13JRf/7qSdMMIzMJePbBmhRFK/TfDbYnurNc0Icwpwpb1Aph9khDUjCAqVIgaryDYlvy9IsD0mMe9cRtEhJF5kCOJME5gB3oVsT8KRGRrf6Pa6QFvwdAPe2ZAQ0dzt9HhN6G3WT4i8jtm7ck= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684839935; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=rM30N0KaR37ESOUKaGeDS2dtk3N/C0zbCYN4eye2Plc=; b=HHCljU43YLPC4e6nZsDdz4kY4z+7hnSth09cEFUkd6JoO3K6czd44YASub3G4VW572tLoH1uDpyQSf4eF3XYDdus1ni7dWRnMutiQUGmlQI7yMkdbHiJPiRy/y/IpSDFrxlGzEHnYFzgZnzJujlQJKgK6R568WKqiFLHF79IEIU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684839935973239.09536158447088; Tue, 23 May 2023 04:05:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1Pp7-0004V9-S2; Tue, 23 May 2023 07:05:02 -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 1q1Pp4-0004Tz-9Z for qemu-devel@nongnu.org; Tue, 23 May 2023 07:04:58 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q1Pp2-0002eE-RP for qemu-devel@nongnu.org; Tue, 23 May 2023 07:04:58 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-411-UPBcsx_JNKKAqs_c3FwZGA-1; Tue, 23 May 2023 07:04:51 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CF9DA2A5955D; Tue, 23 May 2023 11:04:50 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.186]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9782F7AF5; Tue, 23 May 2023 11:04:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684839896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rM30N0KaR37ESOUKaGeDS2dtk3N/C0zbCYN4eye2Plc=; b=DvnP828NqaoZndO4bHI39FH6KqB2oWXgd49hngjCpeJBl3YMBhYJo7zm9qK0IK+OUChHag BWikZK9pappgx2W70RV4eNn2flddUeJlGEnPLiM0Y/vIyYnz0Bz+rZ3eDtqdZq41h36lYR ZlSLUFCbDFDiZAUdQp+j0q323Oco7nA= X-MC-Unique: UPBcsx_JNKKAqs_c3FwZGA-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , Helge Deller , Xiaojuan Yang , Song Gao , Max Filippov , Jason Wang Subject: [PATCH 2/5] hw/alpha: Use MachineClass->default_nic in the alpha machine Date: Tue, 23 May 2023 13:04:32 +0200 Message-Id: <20230523110435.1375774-3-thuth@redhat.com> In-Reply-To: <20230523110435.1375774-1-thuth@redhat.com> References: <20230523110435.1375774-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1684839937879100005 Content-Type: text/plain; charset="utf-8" Mark the default NIC via the new MachineClass->default_nic setting so that the machine-defaults code in vl.c can decide whether the default NIC is usable or not (for example when compiling with the "--without-default-devices" configure switch). Signed-off-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Tested-by: Philippe Mathieu-Daud=C3=A9 --- hw/alpha/dp264.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c index 4161f559a7..03495e1e60 100644 --- a/hw/alpha/dp264.c +++ b/hw/alpha/dp264.c @@ -49,6 +49,7 @@ static void clipper_init(MachineState *machine) const char *kernel_filename =3D machine->kernel_filename; const char *kernel_cmdline =3D machine->kernel_cmdline; const char *initrd_filename =3D machine->initrd_filename; + MachineClass *mc =3D MACHINE_GET_CLASS(machine); AlphaCPU *cpus[4]; PCIBus *pci_bus; PCIDevice *pci_dev; @@ -124,7 +125,7 @@ static void clipper_init(MachineState *machine) =20 /* Network setup. e1000 is good enough, failing Tulip support. */ for (i =3D 0; i < nb_nics; i++) { - pci_nic_init_nofail(&nd_table[i], pci_bus, "e1000", NULL); + pci_nic_init_nofail(&nd_table[i], pci_bus, mc->default_nic, NULL); } =20 /* Super I/O */ @@ -213,6 +214,7 @@ static void clipper_machine_init(MachineClass *mc) mc->is_default =3D true; mc->default_cpu_type =3D ALPHA_CPU_TYPE_NAME("ev67"); mc->default_ram_id =3D "ram"; + mc->default_nic =3D "e1000"; } =20 DEFINE_MACHINE("clipper", clipper_machine_init) --=20 2.31.1 From nobody Sat May 18 11:46:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1684839935; cv=none; d=zohomail.com; s=zohoarc; b=i4D86rkMoHCkOFTsiPtHnH0TJOsX9sDqdkjzjZLWy5WagWhMUHxhyvNboCHjXe0JgCksFhnT9/bpUj8qTM3Hy82KTIwh7q1CkrqIcNZtaawpmCQcIcjuLt7wD79FVy/3DYwJdF+E/I7vfkkx+YswWpEKnIS393Q4K4wC6BSV++8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684839935; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=p88QPabx6fyTv3KzbTfhZ1QR58gl8zylMmH/d8/QmaM=; b=Iae07s1W5+qwJCNN+mX1g6A8cKpgvtMp7Q4vVAlfXdJ7dQqPk3qLDFWs8mTj8X21d1z3JCHI13TONg+6uoD5IngnIOP2++v3ZyFCxksSJPbWa+B2BkB/RYbmpCu1AGjpLcIBq3i7Oz9GbRhgMJM2A9ex9+3+61Uj8dv6e2yo2EM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684839935986272.2038975199215; Tue, 23 May 2023 04:05:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1Pp4-0004U7-Vz; Tue, 23 May 2023 07:04:59 -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 1q1Pp3-0004Tq-R6 for qemu-devel@nongnu.org; Tue, 23 May 2023 07:04:57 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q1Pp2-0002e2-82 for qemu-devel@nongnu.org; Tue, 23 May 2023 07:04:57 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-410-RL2zaCohNwK0JQqzFlLIUg-1; Tue, 23 May 2023 07:04:54 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BD31B800888; Tue, 23 May 2023 11:04:53 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.186]) by smtp.corp.redhat.com (Postfix) with ESMTP id 61BC09D7B; Tue, 23 May 2023 11:04:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684839895; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=p88QPabx6fyTv3KzbTfhZ1QR58gl8zylMmH/d8/QmaM=; b=BwohHHJKyVLITOeRTAtpOLkawAy1UqubJ71J+F2j3wac3Ftn9wsbHNvxPYFqO9mb8NhmUm Rk2ftfCOwJAVkZl3TlUI/a/SwTtIfEeQmVsZwJaNmVAHLDyMnUVQZu33uXxyZuXRV9WaIL a0Bl+AoS9z8dYXi0JazIe795PLVh9B8= X-MC-Unique: RL2zaCohNwK0JQqzFlLIUg-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , Helge Deller , Xiaojuan Yang , Song Gao , Max Filippov , Jason Wang Subject: [PATCH 3/5] hw/arm: Use MachineClass->default_nic in the virt machine Date: Tue, 23 May 2023 13:04:33 +0200 Message-Id: <20230523110435.1375774-4-thuth@redhat.com> In-Reply-To: <20230523110435.1375774-1-thuth@redhat.com> References: <20230523110435.1375774-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1684839937893100007 Content-Type: text/plain; charset="utf-8" Mark the default NIC via the new MachineClass->default_nic setting so that the machine-defaults code in vl.c can decide whether the default NIC is usable or not (for example when compiling with the "--without-default-devices" configure switch). Signed-off-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Tested-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/virt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index b99ae18501..9b9f7d9c68 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1426,6 +1426,7 @@ static void create_pcie(VirtMachineState *vms) int i, ecam_id; PCIHostState *pci; MachineState *ms =3D MACHINE(vms); + MachineClass *mc =3D MACHINE_GET_CLASS(ms); =20 dev =3D qdev_new(TYPE_GPEX_HOST); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); @@ -1479,7 +1480,7 @@ static void create_pcie(VirtMachineState *vms) NICInfo *nd =3D &nd_table[i]; =20 if (!nd->model) { - nd->model =3D g_strdup("virtio"); + nd->model =3D g_strdup(mc->default_nic); } =20 pci_nic_init_nofail(nd, pci->bus, nd->model, NULL); @@ -3033,6 +3034,7 @@ static void virt_machine_class_init(ObjectClass *oc, = void *data) mc->auto_enable_numa_with_memhp =3D true; mc->auto_enable_numa_with_memdev =3D true; mc->default_ram_id =3D "mach-virt.ram"; + mc->default_nic =3D "virtio-net-pci"; =20 object_class_property_add(oc, "acpi", "OnOffAuto", virt_get_acpi, virt_set_acpi, --=20 2.31.1 From nobody Sat May 18 11:46:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1684839995; cv=none; d=zohomail.com; s=zohoarc; b=PpkPWrI+0Jw+mn/jm2hPoX5eVCcR4lmmtN2nr0ixnxa6H4dXfnoWbNTXbyDTMH/qMUtgpwkRqQKkM0GY+oX76RfOqtCZqwPa5LZFpfvZcW1wLIaybP0RaU1dqTJ89hPYlNWNtxvvHobIpLa8aVADjr9Jqm4S5CGVbegvh8I0Jgk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684839995; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=GEhu+teZUwblMDFRea80VevbZ0LABi1UpQmCaIo/QrM=; b=FqYsTx3u88Pr4eeyRGIWale8GX0ZCLAewFTV4Kq5K6j2uhUmTZREauRaE1MV3ALqrdxOLWsIPZ6vcGb4KJVhKifOJ5mrnXYC1j3mxo3u+TVFGNkd93PmFmd2XXrOB1NG608qP56uwxxrW57VDtbniREicNndGHAUFN+qengrWt8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684839995567152.02159489014616; Tue, 23 May 2023 04:06:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1PpC-0004We-3r; Tue, 23 May 2023 07:05:06 -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 1q1PpA-0004Vw-N4 for qemu-devel@nongnu.org; Tue, 23 May 2023 07:05:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q1Pp9-0002gC-5e for qemu-devel@nongnu.org; Tue, 23 May 2023 07:05:04 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-315-zAo8AH_bNfiGhuo3qu-Ykg-1; Tue, 23 May 2023 07:04:57 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D1F07800B2A; Tue, 23 May 2023 11:04:56 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.186]) by smtp.corp.redhat.com (Postfix) with ESMTP id 37A2D7AF5; Tue, 23 May 2023 11:04:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684839900; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GEhu+teZUwblMDFRea80VevbZ0LABi1UpQmCaIo/QrM=; b=Xv7uwogxzyY4Kw9gG8ZR4GDdYTHdqo19hDd5LU+DKfb9kTwgBLQyXgVxgSs9PuE1eNfjWA 4zgraBnpLnjAuGReEXpQLXwYyCh9JjJqIXBUiShIoeOIsPspxtr1fLzn+jZeBauLMI0Muv 1uYB/z15Fp4ZhWCm3DAl/AlOfl5/NrU= X-MC-Unique: zAo8AH_bNfiGhuo3qu-Ykg-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , Helge Deller , Xiaojuan Yang , Song Gao , Max Filippov , Jason Wang Subject: [PATCH 4/5] hw/loongarch64: Use MachineClass->default_nic in the virt machine Date: Tue, 23 May 2023 13:04:34 +0200 Message-Id: <20230523110435.1375774-5-thuth@redhat.com> In-Reply-To: <20230523110435.1375774-1-thuth@redhat.com> References: <20230523110435.1375774-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1684839996341100001 Content-Type: text/plain; charset="utf-8" Mark the default NIC via the new MachineClass->default_nic setting so that the machine-defaults code in vl.c can decide whether the default NIC is usable or not (for example when compiling with the "--without-default-devices" configure switch). Signed-off-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Song Gao Tested-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Song Gao --- hw/loongarch/virt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 2b7588e32a..ceddec1b23 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@ -474,6 +474,7 @@ static DeviceState *create_platform_bus(DeviceState *pc= h_pic) =20 static void loongarch_devices_init(DeviceState *pch_pic, LoongArchMachineS= tate *lams) { + MachineClass *mc =3D MACHINE_GET_CLASS(lams); DeviceState *gpex_dev; SysBusDevice *d; PCIBus *pci_bus; @@ -528,7 +529,7 @@ static void loongarch_devices_init(DeviceState *pch_pic= , LoongArchMachineState * NICInfo *nd =3D &nd_table[i]; =20 if (!nd->model) { - nd->model =3D g_strdup("virtio"); + nd->model =3D g_strdup(mc->default_nic); } =20 pci_nic_init_nofail(nd, pci_bus, nd->model, NULL); @@ -1038,6 +1039,7 @@ static void loongarch_class_init(ObjectClass *oc, voi= d *data) mc->default_boot_order =3D "c"; mc->no_cdrom =3D 1; mc->get_hotplug_handler =3D virt_machine_get_hotplug_handler; + mc->default_nic =3D "virtio-net-pci"; hc->plug =3D loongarch_machine_device_plug_cb; hc->pre_plug =3D virt_machine_device_pre_plug; hc->unplug_request =3D virt_machine_device_unplug_request; --=20 2.31.1 From nobody Sat May 18 11:46:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1684839962; cv=none; d=zohomail.com; s=zohoarc; b=GK2L/Q6OcNH5XedPkGmUuvvVyqSWqZ3IJchmYdMEa40w6CbEd0MjsqLuxH7u98Mvpz0nVrXoP1I6XkvKAHSCIF1wXjgd9r+KIxUdkkQe0hQgRmpPh6FNEADao4xDu0wEZGQZSHtTaf8PQwXRbzTo7tMnOmnQM592wQJaByk1trI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684839962; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Jz3fW1+WBRLn1C7pO/CSsoBecMk3HqTr1LVKHm8D5/o=; b=bwC7jhdoP1HXmVUNZG7XvKBpzGfbYOmykJDXF7/O0TNCQqqBoYGLk4FERFG5eyfXK/vIfRB06LGdUzDXPgpKP45d4KjQJlg4z5/7GdAlLZVomBt4nHmX9AfCkZV1peUUmI3YRzXOUm/yo7CXdeVPFLRRGq/GlwjfoGSH+by5cvQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684839962657709.4982637180793; Tue, 23 May 2023 04:06:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1PpC-0004Wn-G1; Tue, 23 May 2023 07:05:06 -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 1q1PpB-0004W5-7i for qemu-devel@nongnu.org; Tue, 23 May 2023 07:05:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q1Pp9-0002iW-Lg for qemu-devel@nongnu.org; Tue, 23 May 2023 07:05:04 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-616-kFORMggVPWanh5RQJ4ZFaQ-1; Tue, 23 May 2023 07:04:59 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1193E2A59574; Tue, 23 May 2023 11:04:59 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.186]) by smtp.corp.redhat.com (Postfix) with ESMTP id 26CE07AF5; Tue, 23 May 2023 11:04:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684839902; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Jz3fW1+WBRLn1C7pO/CSsoBecMk3HqTr1LVKHm8D5/o=; b=Ry3NLJAn2NAsB0tbPUYtlc2M4c7cuRPT3fh/yPao21hizcSmLYo1R/Iiu3hFcJ3o0yIbYP R9RnYFF9ZZr/fCZbd6bEVK3TfSabaCtdS2jPaWSRmuoL32y4HceVfANqME6X1pJNtad3cL go4Y+FzIvsMRGCEwrY83NHbfoMNLvMM= X-MC-Unique: kFORMggVPWanh5RQJ4ZFaQ-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , Helge Deller , Xiaojuan Yang , Song Gao , Max Filippov , Jason Wang Subject: [PATCH 5/5] hw/xtensa: Use MachineClass->default_nic in the virt machine Date: Tue, 23 May 2023 13:04:35 +0200 Message-Id: <20230523110435.1375774-6-thuth@redhat.com> In-Reply-To: <20230523110435.1375774-1-thuth@redhat.com> References: <20230523110435.1375774-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1684839964467100003 Content-Type: text/plain; charset="utf-8" Mark the default NIC via the new MachineClass->default_nic setting so that the machine-defaults code in vl.c can decide whether the default NIC is usable or not (for example when compiling with the "--without-default-devices" configure switch). Signed-off-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Tested-by: Philippe Mathieu-Daud=C3=A9 --- hw/xtensa/virt.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/xtensa/virt.c b/hw/xtensa/virt.c index a18e3fc910..b87f842e74 100644 --- a/hw/xtensa/virt.c +++ b/hw/xtensa/virt.c @@ -38,7 +38,8 @@ #include "xtensa_memory.h" #include "xtensa_sim.h" =20 -static void create_pcie(CPUXtensaState *env, int irq_base, hwaddr addr_bas= e) +static void create_pcie(MachineState *ms, CPUXtensaState *env, int irq_bas= e, + hwaddr addr_base) { hwaddr base_ecam =3D addr_base + 0x00100000; hwaddr size_ecam =3D 0x03f00000; @@ -54,6 +55,7 @@ static void create_pcie(CPUXtensaState *env, int irq_base= , hwaddr addr_base) MemoryRegion *mmio_alias; MemoryRegion *mmio_reg; =20 + MachineClass *mc =3D MACHINE_GET_CLASS(ms); DeviceState *dev; PCIHostState *pci; qemu_irq *extints; @@ -104,7 +106,7 @@ static void create_pcie(CPUXtensaState *env, int irq_ba= se, hwaddr addr_base) NICInfo *nd =3D &nd_table[i]; =20 if (!nd->model) { - nd->model =3D g_strdup("virtio"); + nd->model =3D g_strdup(mc->default_nic); } =20 pci_nic_init_nofail(nd, pci->bus, nd->model, NULL); @@ -117,7 +119,7 @@ static void xtensa_virt_init(MachineState *machine) XtensaCPU *cpu =3D xtensa_sim_common_init(machine); CPUXtensaState *env =3D &cpu->env; =20 - create_pcie(env, 0, 0xf0000000); + create_pcie(machine, env, 0, 0xf0000000); xtensa_sim_load_kernel(cpu, machine); } =20 @@ -127,6 +129,7 @@ static void xtensa_virt_machine_init(MachineClass *mc) mc->init =3D xtensa_virt_init; mc->max_cpus =3D 32; mc->default_cpu_type =3D XTENSA_DEFAULT_CPU_TYPE; + mc->default_nic =3D "virtio-net-pci"; } =20 DEFINE_MACHINE("virt", xtensa_virt_machine_init) --=20 2.31.1