From nobody Sat Apr 5 00:07:09 2025 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1739220559; cv=none; d=zohomail.com; s=zohoarc; b=OscWAhMXsFs9QASKABPPaOXyW2PrpjIO9BdzUa09z098s3FR2gQC9SAE82D4MZ+EcX2jbeTijhtS1SHCuXH/tOSSuAqlQDz6nSs7w6QAVN6ssKU5Zjb3JFurDch9ZMTvPpBzcxaIfKbPL2vht/eMILEAqia2x9L/weANnG4k1cs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1739220559; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Gj8bVeK5NOhu7y6Rw3GfYIssZOi6C5MlJs9pxmbGNdg=; b=bUr91b9xSBp7aOzwnk7xC9EabeZc840CFejC1FmQyA14gvbr2egaCgYbo3pmbwojnp74z69wRdifn58n73n09TmepVX9f+SLLa+3zcAKbtWqaa+MvtXZ8vaTdgmADmkkJMJ1mSG9lUSPcdsEsaysoHLj1RgODRGA7q5lfQ9xeUo= 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 1739220559745110.55133590507603; Mon, 10 Feb 2025 12:49:19 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1thadm-0003yv-No; Mon, 10 Feb 2025 15:44:26 -0500 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 1thadj-0003aj-T4 for qemu-devel@nongnu.org; Mon, 10 Feb 2025 15:44:24 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1thadi-0003uD-6H for qemu-devel@nongnu.org; Mon, 10 Feb 2025 15:44:23 -0500 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-4361815b96cso32389755e9.1 for ; Mon, 10 Feb 2025 12:44:21 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4390d94db77sm190300425e9.15.2025.02.10.12.44.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 10 Feb 2025 12:44:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739220260; x=1739825060; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Gj8bVeK5NOhu7y6Rw3GfYIssZOi6C5MlJs9pxmbGNdg=; b=C2QuIbabgyPYd3G6V9+QYo3qKox1PYongaMS6tWx01bdSgpbXD8puKi5jvX8Rj6SBn Y+c5rLxgRmW3WXP4sbDGSLElb7Siy+G/7IdppXiUgAwRjrl+OFdTus16+5AA9ejtJhaE K4byFznoIySIySLFWvO7kXJ918RRCzPVSpyTHerAPjLMMrCN//G2PmRJJ4ZrmvWaVH3b bphORmCbivfyO20SxRrOmNnodRyuAmKGIkUkyxoL9i61rkhz6ByQTnp1DkQI0fY9IsDY 08MMrereHXY7jrLZ0hsk7aTdVSK1QL92igD45sQGQ+gk3G3LhsS9P5CtHqahr9szoi6B ELxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739220260; x=1739825060; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Gj8bVeK5NOhu7y6Rw3GfYIssZOi6C5MlJs9pxmbGNdg=; b=xRNl16M5di/2ahNWDVnZPEOBD9qLOpKRKxvxHeuUEsn1g43dp5E3pMMJL1zxjiZaEO Zp9TxOs8daKiyXesFsGwqA6UYoOW9joH5s9B5HcWvTcYq/4isMaJ1IKTuX3Gqfi9yqT5 DFtaQKaCpX+3/XRkzXnB/nRPVjw+fAhRZ+rGRwj7oy35YNyIzy8V7nnCqjCNpPFR4I24 uyc8gN6pFPRa8MvSMUp+y2OPtcgMNcBAR3wxwC8CO68OwMQIdnR70AAL817eO/j5Tz4+ fxWzTyE57OTngh1/Meu+zpgyhIJ1dMLaXxa3R4XDZqPakYlvNSVFcO4g+TBEzc3if34c q5LQ== X-Gm-Message-State: AOJu0Yzrp6UL7V5cbL0PF1Rh2JsZ78Ko4P3H9RDmKxAH8nn0RXPXas46 7SzFHZwLUtZR8tysWCI5oM1bdBo2/5xaAmOQHuqrle3XjxJzLTQhz6dN89ctYBUDdwty9MEy457 BPlw= X-Gm-Gg: ASbGncsfh39YUFpy5ziEBgoWysnmm8P0tB01A7cs7Xx5rIx0YeZaN6hdPrB21l+fj0h JGywrHGYy7ta+8QKqCMeQse/DbB2m+6g9uz730gdAo35lvuDntqZG/kQ6fts8uss97tD9qENhum q55pgkN7HaIi10khatvB3mxQMDKNiIPS1L00a39jDX9kZP5JVtOVAkh7PsMWWc4aNdSlnsxi/O5 2/EgCRcLhKXcKq/XAucrLwUp8mSh89MSO+/Xkdz2deghHIRwmFTW8hFA+DvHDx5fyL4zeWUSZPE pF5tzpf8D67gh8tHAPcUBTnpJECTfhsN/wXpWRV1Ys1AS3IvdDXlX3D6EvjYDqUdJA== X-Google-Smtp-Source: AGHT+IHYdVOroScQDlt4TOiZe4GG8CJV18muBS3cycrgMwakwWd6k5Kmvr2L7eQRDxRNmFHxPtM9LA== X-Received: by 2002:a05:600c:4f90:b0:434:a7e7:a1ca with SMTP id 5b1f17b1804b1-439249b04f8mr117469235e9.20.1739220260096; Mon, 10 Feb 2025 12:44:20 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth Subject: [PULL 26/32] hw/boards: Ensure machine setting auto_create_sdcard expose a SD Bus Date: Mon, 10 Feb 2025 21:41:58 +0100 Message-ID: <20250210204204.54407-27-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250210204204.54407-1-philmd@linaro.org> References: <20250210204204.54407-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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 @linaro.org) X-ZM-MESSAGEID: 1739220561557019100 Using the auto_create_sdcard feature without SD Bus is irrelevant. Reviewed-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20250204200934.65279-8-philmd@linaro.org> --- system/vl.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/system/vl.c b/system/vl.c index 2ce7d8c49d7..66862807be4 100644 --- a/system/vl.c +++ b/system/vl.c @@ -53,6 +53,7 @@ #include "hw/usb.h" #include "hw/isa/isa.h" #include "hw/scsi/scsi.h" +#include "hw/sd/sd.h" #include "hw/display/vga.h" #include "hw/firmware/smbios.h" #include "hw/acpi/acpi.h" @@ -2661,12 +2662,27 @@ static void qemu_init_displays(void) =20 static void qemu_init_board(void) { + MachineClass *machine_class =3D MACHINE_GET_CLASS(current_machine); + /* process plugin before CPUs are created, but once -smp has been pars= ed */ qemu_plugin_load_list(&plugin_list, &error_fatal); =20 /* From here on we enter MACHINE_PHASE_INITIALIZED. */ machine_run_board_init(current_machine, mem_path, &error_fatal); =20 + if (machine_class->auto_create_sdcard) { + bool ambigous; + + /* Ensure there is a SD bus available to create SD card on */ + Object *obj =3D object_resolve_path_type("", TYPE_SD_BUS, &ambigou= s); + if (!obj && !ambigous) { + fprintf(stderr, "Can not create sd-card on '%s' machine" + " because it lacks a sd-bus\n", + machine_class->name); + abort(); + } + } + drive_check_orphaned(); =20 realtime_init(); --=20 2.47.1