From nobody Wed May 1 12:27:54 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1537952509817113.4661083426347; Wed, 26 Sep 2018 02:01:49 -0700 (PDT) Received: from localhost ([::1]:57146 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g55hU-0002iV-5j for importer@patchew.org; Wed, 26 Sep 2018 05:01:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60553) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g55gR-0002Py-6m for qemu-devel@nongnu.org; Wed, 26 Sep 2018 05:00:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g55gO-0000FY-2X for qemu-devel@nongnu.org; Wed, 26 Sep 2018 05:00:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45114) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g55gN-0000FL-SV for qemu-devel@nongnu.org; Wed, 26 Sep 2018 05:00:32 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E628D3DBDD; Wed, 26 Sep 2018 09:00:30 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-98.ams2.redhat.com [10.36.116.98]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9B8BF600C3; Wed, 26 Sep 2018 09:00:30 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 2AA1811385F2; Wed, 26 Sep 2018 11:00:29 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 26 Sep 2018 11:00:29 +0200 Message-Id: <20180926090029.25178-1-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 26 Sep 2018 09:00:31 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [RFC PATCH] ssi-sd: Make devices picking up backends unavailable with -device X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Device models aren't supposed to go on fishing expeditions for backends. They should expose suitable properties for the user to set. For onboard devices, board code sets them. Device ssi-sd picks up its block backend in its init() method with drive_get_next() instead. This mistake is already marked FIXME since commit af9e40a. Unset user_creatable to remove the mistake from our external interface. Since the SSI bus doesn't support hotplug, only -device can be affected. Only certain ARM machines provide an SSI bus. Signed-off-by: Markus Armbruster Acked-by: Philippe Mathieu-Daud=C3=A9 --- Are there valid uses of -device ssi-sd? If no, this patch is fine. If yes, this patch breaks them. But fixing the FIXME will also break them. What should we do? hw/sd/ssi-sd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/sd/ssi-sd.c b/hw/sd/ssi-sd.c index 95a143bfba..ec7c7e6dbf 100644 --- a/hw/sd/ssi-sd.c +++ b/hw/sd/ssi-sd.c @@ -284,6 +284,8 @@ static void ssi_sd_class_init(ObjectClass *klass, void = *data) k->cs_polarity =3D SSI_CS_LOW; dc->vmsd =3D &vmstate_ssi_sd; dc->reset =3D ssi_sd_reset; + /* Reason: init() method uses drive_get_next() */ + dc->cannot_instantiate_with_device_add_yet =3D true; } =20 static const TypeInfo ssi_sd_info =3D { --=20 2.17.1