From patchwork Fri Sep 7 12:56:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 967370 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ilande.co.uk Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 426Hcd0vt9z9s3x for ; Fri, 7 Sep 2018 23:01:05 +1000 (AEST) Received: from localhost ([::1]:38536 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fyGNi-0003pm-In for incoming@patchwork.ozlabs.org; Fri, 07 Sep 2018 09:01:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60479) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fyGK9-0000hy-IR for qemu-devel@nongnu.org; Fri, 07 Sep 2018 08:57:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fyGK7-0007fZ-UU for qemu-devel@nongnu.org; Fri, 07 Sep 2018 08:57:21 -0400 Received: from chuckie.co.uk ([82.165.15.123]:58395 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fyGK7-0007bz-Fw; Fri, 07 Sep 2018 08:57:19 -0400 Received: from host86-138-87-37.range86-138.btcentralplus.com ([86.138.87.37] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1fyGKC-0002sL-5u; Fri, 07 Sep 2018 13:57:25 +0100 From: Mark Cave-Ayland To: pbonzini@redhat.com, famz@redhat.com, hpoussin@reactos.org, rth@twiddle.net, peter.maydell@linaro.org, thuth@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org, qemu-ppc@nongnu.org Date: Fri, 7 Sep 2018 13:56:52 +0100 Message-Id: <20180907125653.5010-3-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180907125653.5010-1-mark.cave-ayland@ilande.co.uk> References: <20180907125653.5010-1-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.138.87.37 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PATCH v2 2/3] scsi: move lsi53c8xx_create() callers to lsi53c8xx_handle_legacy_cmdline() 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: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" As part of commits a64aa5785d "hw: Deprecate -drive if=scsi with non-onboard HBAs" and b891538e81 "hw/ppc/prep: Fix implicit creation of "-drive if=scsi" devices" the lsi53c895a_create() and lsi53c810_create() functions were added to wrap pci_create_simple() and scsi_bus_legacy_handle_cmdline(). Unfortunately this prevents us from changing qdev properties on the device and/or changing the PCI configuration. By switching over to using the new lsi53c8xx_handle_legacy_cmdline() function then the caller can now configure and realize the LSI SCSI device exactly as required. Signed-off-by: Mark Cave-Ayland Reviewed-by: Thomas Huth --- hw/arm/realview.c | 3 ++- hw/arm/versatilepb.c | 3 ++- hw/hppa/machine.c | 4 +++- hw/ppc/prep.c | 4 +++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/hw/arm/realview.c b/hw/arm/realview.c index ab8c14fde3..242f5a87b6 100644 --- a/hw/arm/realview.c +++ b/hw/arm/realview.c @@ -257,7 +257,8 @@ static void realview_init(MachineState *machine, } n = drive_get_max_bus(IF_SCSI); while (n >= 0) { - lsi53c895a_create(pci_bus); + dev = DEVICE(pci_create_simple(pci_bus, -1, "lsi53c895a")); + lsi53c8xx_handle_legacy_cmdline(dev); n--; } } diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c index 8b74857059..22b09a1e61 100644 --- a/hw/arm/versatilepb.c +++ b/hw/arm/versatilepb.c @@ -278,7 +278,8 @@ static void versatile_init(MachineState *machine, int board_id) } n = drive_get_max_bus(IF_SCSI); while (n >= 0) { - lsi53c895a_create(pci_bus); + dev = DEVICE(pci_create_simple(pci_bus, -1, "lsi53c895a")); + lsi53c8xx_handle_legacy_cmdline(dev); n--; } diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index cf7c61c6cc..0fb8fb877e 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -59,6 +59,7 @@ static void machine_hppa_init(MachineState *machine) const char *kernel_filename = machine->kernel_filename; const char *kernel_cmdline = machine->kernel_cmdline; const char *initrd_filename = machine->initrd_filename; + DeviceState *dev; PCIBus *pci_bus; ISABus *isa_bus; qemu_irq rtc_irq, serial_irq; @@ -115,7 +116,8 @@ static void machine_hppa_init(MachineState *machine) } /* SCSI disk setup. */ - lsi53c895a_create(pci_bus); + dev = DEVICE(pci_create_simple(pci_bus, -1, "lsi53c895a")); + lsi53c8xx_handle_legacy_cmdline(dev); /* Network setup. e1000 is good enough, failing Tulip support. */ for (i = 0; i < nb_nics; i++) { diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index 162b27a3b8..b0ea20416e 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -702,7 +702,9 @@ static void ibm_40p_init(MachineState *machine) qdev_prop_set_uint32(dev, "equipment", 0xc0); qdev_init_nofail(dev); - lsi53c810_create(pci_bus, PCI_DEVFN(1, 0)); + dev = DEVICE(pci_create_simple(pci_bus, PCI_DEVFN(1, 0), + "lsi53c810")); + lsi53c8xx_handle_legacy_cmdline(dev); /* XXX: s3-trio at PCI_DEVFN(2, 0) */ pci_vga_init(pci_bus);