From nobody Fri Oct 24 21:49:09 2025 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 1520413782021495.8741194285493; Wed, 7 Mar 2018 01:09:42 -0800 (PST) Received: from localhost ([::1]:60320 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etV4l-0003MH-Fk for importer@patchew.org; Wed, 07 Mar 2018 04:09:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53413) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etV3n-0002uP-DP for qemu-devel@nongnu.org; Wed, 07 Mar 2018 04:08:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etV3i-0004ZJ-CW for qemu-devel@nongnu.org; Wed, 07 Mar 2018 04:08:31 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:41102 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1etV3i-0004Yh-7u; Wed, 07 Mar 2018 04:08:26 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0033876FBA; Wed, 7 Mar 2018 09:08:23 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-104.ams2.redhat.com [10.36.116.104]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0AC2D10CD798; Wed, 7 Mar 2018 09:08:15 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Wed, 7 Mar 2018 10:08:14 +0100 Message-Id: <1520413694-1271-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 07 Mar 2018 09:08:23 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 07 Mar 2018 09:08:23 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'thuth@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH] hw/ppc/prep: Fix implicit creation of "-drive if=scsi" devices 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: Paolo Bonzini , Mark Cave-Ayland , Fam Zheng , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The global hack for creating SCSI devices has recently been removed, but this apparently broke SCSI devices on some boards that were not ready for this change yet. For the 40p machine you now get: $ ppc64-softmmu/qemu-system-ppc64 -M 40p -cdrom x.iso qemu-system-ppc64: -cdrom x.iso: machine type does not support if=3Dscsi,bu= s=3D0,unit=3D2 Fix it by providing a lsi53c810_create() function that takes care of calling scsi_bus_legacy_handle_cmdline() after creating the corresponding SCSI controller. Fixes: 1454509726719e0933c800fad00d6999752688ea Signed-off-by: Thomas Huth Reviewed-by: Herv=C3=A9 Poussineau --- hw/ppc/prep.c | 2 +- hw/scsi/lsi53c895a.c | 7 +++++++ include/hw/pci/pci.h | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index 096d4d4..3361509 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -788,7 +788,7 @@ static void ibm_40p_init(MachineState *machine) qdev_prop_set_uint32(dev, "equipment", 0xc0); qdev_init_nofail(dev); =20 - pci_create_simple(pci_bus, PCI_DEVFN(1, 0), "lsi53c810"); + lsi53c810_create(pci_bus, PCI_DEVFN(1, 0)); =20 /* XXX: s3-trio at PCI_DEVFN(2, 0) */ pci_vga_init(pci_bus); diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c index f3d4c4d..160657f 100644 --- a/hw/scsi/lsi53c895a.c +++ b/hw/scsi/lsi53c895a.c @@ -2279,3 +2279,10 @@ void lsi53c895a_create(PCIBus *bus) =20 scsi_bus_legacy_handle_cmdline(&s->bus); } + +void lsi53c810_create(PCIBus *bus, int devfn) +{ + LSIState *s =3D LSI53C895A(pci_create_simple(bus, devfn, "lsi53c810")); + + scsi_bus_legacy_handle_cmdline(&s->bus); +} diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index d8c18c7..e255941 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -708,6 +708,7 @@ PCIDevice *pci_create(PCIBus *bus, int devfn, const cha= r *name); PCIDevice *pci_create_simple(PCIBus *bus, int devfn, const char *name); =20 void lsi53c895a_create(PCIBus *bus); +void lsi53c810_create(PCIBus *bus, int devfn); =20 qemu_irq pci_allocate_irq(PCIDevice *pci_dev); void pci_set_irq(PCIDevice *pci_dev, int level); --=20 1.8.3.1