From patchwork Wed May 24 10:27:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcin Juszkiewicz X-Patchwork-Id: 685331 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp168810wrt; Wed, 24 May 2023 03:29:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5rNbzh88Ej80rVw7WF7mLfUXmV1MTUU66DgZtohuoA79qDrnorVQ0TiMKg8xdV9fil24sA X-Received: by 2002:a05:6214:c23:b0:5e3:d150:3168 with SMTP id a3-20020a0562140c2300b005e3d1503168mr24344772qvd.18.1684924144458; Wed, 24 May 2023 03:29:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684924144; cv=none; d=google.com; s=arc-20160816; b=i10+dfzNKLPdQRdDRIQusb9tVdPuOjfMiVoxnSCTuW9hx8ox9CrK569oyUbAUb+NNM AH+plY0xzVeyxRBqqsI7qLADhIOwE46WHQ4+StYFKkQlWAU9nLifR9Vs9tgLvBSfI/4m XMxVUZT25KpHwZfzU57rO+Z1vgho/PcqAdRSFUOeHvHvS8Rfg0dKRyMrkroaxv0HZlDh lJLWSzaWw8xZ30ytraNhEW7QRv2OkMQ5SDc0heOXMhXcditcmYxKj55zuFOP1k159o+Q 4RCfAHMHWIOaEswi5PEj+Hr/UET5QiSN0xYbfxJEeDBNuRFwqA4XHaxdwlPMXvhdvGrU ZerA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=3e9LymC1Yc9KvB15ELruVVHR08VNyMQ7IqdBakyZxug=; b=YPEkhXOl7IkJen5d6nLzpXVi8FGeBqJQL6W2GKxCY3yj0HCJXW1PHXLpakBZpaC130 BOMp/1ffqGJWkHO9jVGwjBnKWyP0cVyTOuC89IImhiPzQ8W09eL+H3x3uVPo3TIikEmA hCoXd7x8jXN0uv8u+fFCVpbvEpKG3XKRRLzuYGW687O4XIswKGyRsC55AvVIG6qqoJKl Tji6LlwqeWZeEbS6uKFrtJ9EVhB301mBQaANyExBTV3JqcI3SzZjvv/Feo+O7As1Ojjc RaVFG/Ju2PvJLCKwkuWl3W1MK9xatta2BohZ9faqtuIe79WRU9ewbN9fXM2aOR+znfaw BruQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 2-20020a05621420e200b005355bd68bc0si6283629qvk.564.2023.05.24.03.29.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 May 2023 03:29:04 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1lis-00082c-Os; Wed, 24 May 2023 06:28: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 1q1liX-0007pl-EC; Wed, 24 May 2023 06:27:42 -0400 Received: from muminek.juszkiewicz.com.pl ([213.251.184.221]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q1liU-0000OI-RM; Wed, 24 May 2023 06:27:41 -0400 Received: from localhost (localhost [127.0.0.1]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTP id 95279260BC0; Wed, 24 May 2023 12:27:36 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at juszkiewicz.com.pl Received: from muminek.juszkiewicz.com.pl ([127.0.0.1]) by localhost (muminek.juszkiewicz.com.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id X8FxYvjZTYBK; Wed, 24 May 2023 12:27:34 +0200 (CEST) Received: from applejack.lan (83.21.125.167.ipv4.supernova.orange.pl [83.21.125.167]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTPSA id 64814260287; Wed, 24 May 2023 12:27:34 +0200 (CEST) From: Marcin Juszkiewicz To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Leif Lindholm , Peter Maydell , Thomas Huth , Paolo Bonzini Subject: [PATCH v3 1/5] hw/arm: Use MachineClass->default_nic in the sbsa-ref machine Date: Wed, 24 May 2023 12:27:25 +0200 Message-Id: <20230524102729.810892-2-marcin.juszkiewicz@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230524102729.810892-1-marcin.juszkiewicz@linaro.org> References: <20230524102729.810892-1-marcin.juszkiewicz@linaro.org> MIME-Version: 1.0 Received-SPF: softfail client-ip=213.251.184.221; envelope-from=marcin.juszkiewicz@linaro.org; helo=muminek.juszkiewicz.com.pl 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_NONE=0.001, SPF_SOFTFAIL=0.665, T_SCC_BODY_TEXT_LINE=-0.01 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Thomas Huth 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: Richard Henderson --- hw/arm/sbsa-ref.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c index 792371fdce..9c3e670ec6 100644 --- a/hw/arm/sbsa-ref.c +++ b/hw/arm/sbsa-ref.c @@ -596,6 +596,7 @@ static void create_pcie(SBSAMachineState *sms) hwaddr size_mmio_high = sbsa_ref_memmap[SBSA_PCIE_MMIO_HIGH].size; hwaddr base_pio = sbsa_ref_memmap[SBSA_PCIE_PIO].base; int irq = sbsa_ref_irqmap[SBSA_PCIE]; + MachineClass *mc = MACHINE_GET_CLASS(sms); MemoryRegion *mmio_alias, *mmio_alias_high, *mmio_reg; MemoryRegion *ecam_alias, *ecam_reg; DeviceState *dev; @@ -641,7 +642,7 @@ static void create_pcie(SBSAMachineState *sms) NICInfo *nd = &nd_table[i]; if (!nd->model) { - nd->model = g_strdup("e1000e"); + nd->model = g_strdup(mc->default_nic); } pci_nic_init_nofail(nd, pci->bus, nd->model, NULL); @@ -858,6 +859,7 @@ static void sbsa_ref_class_init(ObjectClass *oc, void *data) mc->minimum_page_bits = 12; mc->block_default_type = IF_IDE; mc->no_cdrom = 1; + mc->default_nic = "e1000e"; mc->default_ram_size = 1 * GiB; mc->default_ram_id = "sbsa-ref.ram"; mc->default_cpus = 4;