qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
	qemu-arm@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>,
	"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
	"Aleksandar Rikalo" <arikalo@gmail.com>,
	"Harsh Prateek Bora" <harshpb@linux.ibm.com>,
	qemu-ppc@nongnu.org, "Laurent Vivier" <laurent@vivier.eu>,
	"Hervé Poussineau" <hpoussin@reactos.org>,
	"Artyom Tarasenko" <atar4qemu@gmail.com>,
	"Thomas Huth" <thuth@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Thomas Huth" <huth@tuxfamily.org>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Fam Zheng" <fam@euphon.net>, "Helge Deller" <deller@gmx.de>,
	"Daniel Henrique Barboza" <danielhb413@gmail.com>,
	"Nicholas Piggin" <npiggin@gmail.com>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>
Subject: [PATCH 2/3] hw/scsi/lsi53c895a: Call scsi_bus_legacy_handle_cmdline() once
Date: Fri, 22 Nov 2024 12:19:38 +0100	[thread overview]
Message-ID: <20241122111939.11936-3-philmd@linaro.org> (raw)
In-Reply-To: <20241122111939.11936-1-philmd@linaro.org>

Call scsi_bus_legacy_handle_cmdline() once in the DeviceRealize
handler, just after scsi_bus_init().
No need for lsi53c8xx_handle_legacy_cmdline(), remove it.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/hw/pci/pci.h | 2 --
 hw/arm/realview.c    | 3 +--
 hw/arm/versatilepb.c | 3 +--
 hw/hppa/machine.c    | 3 +--
 hw/ppc/prep.c        | 1 -
 hw/scsi/lsi53c895a.c | 8 +-------
 6 files changed, 4 insertions(+), 16 deletions(-)

diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
index c0717e3121..7a69f0368c 100644
--- a/include/hw/pci/pci.h
+++ b/include/hw/pci/pci.h
@@ -655,8 +655,6 @@ PCIDevice *pci_create_simple_multifunction(PCIBus *bus, int devfn,
                                            const char *name);
 PCIDevice *pci_create_simple(PCIBus *bus, int devfn, const char *name);
 
-void lsi53c8xx_handle_legacy_cmdline(DeviceState *lsi_dev);
-
 qemu_irq pci_allocate_irq(PCIDevice *pci_dev);
 void pci_set_irq(PCIDevice *pci_dev, int level);
 
diff --git a/hw/arm/realview.c b/hw/arm/realview.c
index b186f965c6..1042c1a1a3 100644
--- a/hw/arm/realview.c
+++ b/hw/arm/realview.c
@@ -294,8 +294,7 @@ static void realview_init(MachineState *machine,
         }
         n = drive_get_max_bus(IF_SCSI);
         while (n >= 0) {
-            dev = DEVICE(pci_create_simple(pci_bus, -1, "lsi53c895a"));
-            lsi53c8xx_handle_legacy_cmdline(dev);
+            pci_create_simple(pci_bus, -1, "lsi53c895a");
             n--;
         }
     }
diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c
index d48235453e..716ed951bc 100644
--- a/hw/arm/versatilepb.c
+++ b/hw/arm/versatilepb.c
@@ -271,8 +271,7 @@ static void versatile_init(MachineState *machine, int board_id)
     }
     n = drive_get_max_bus(IF_SCSI);
     while (n >= 0) {
-        dev = DEVICE(pci_create_simple(pci_bus, -1, "lsi53c895a"));
-        lsi53c8xx_handle_legacy_cmdline(dev);
+        pci_create_simple(pci_bus, -1, "lsi53c895a");
         n--;
     }
 
diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c
index a31dc32a9f..69b822bfc8 100644
--- a/hw/hppa/machine.c
+++ b/hw/hppa/machine.c
@@ -349,8 +349,7 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus,
 
     /* SCSI disk setup. */
     if (drive_get_max_bus(IF_SCSI) >= 0) {
-        dev = DEVICE(pci_create_simple(pci_bus, -1, "lsi53c895a"));
-        lsi53c8xx_handle_legacy_cmdline(dev);
+        pci_create_simple(pci_bus, -1, "lsi53c895a");
     }
 
     /* Graphics setup. */
diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
index fb58c312ac..0e5ff2a75c 100644
--- a/hw/ppc/prep.c
+++ b/hw/ppc/prep.c
@@ -328,7 +328,6 @@ static void ibm_40p_init(MachineState *machine)
 
         dev = DEVICE(pci_create_simple(pci_bus, PCI_DEVFN(1, 0),
                                        "lsi53c810"));
-        lsi53c8xx_handle_legacy_cmdline(dev);
         qdev_connect_gpio_out(dev, 0, qdev_get_gpio_in(i82378_dev, 13));
 
         /* XXX: s3-trio at PCI_DEVFN(2, 0) */
diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c
index 1f728416e2..d632789434 100644
--- a/hw/scsi/lsi53c895a.c
+++ b/hw/scsi/lsi53c895a.c
@@ -2365,6 +2365,7 @@ static void lsi_scsi_realize(PCIDevice *dev, Error **errp)
     QTAILQ_INIT(&s->queue);
 
     scsi_bus_init(&s->bus, sizeof(s->bus), d, &lsi_scsi_info);
+    scsi_bus_legacy_handle_cmdline(&s->bus);
 }
 
 static void lsi_scsi_exit(PCIDevice *dev)
@@ -2422,10 +2423,3 @@ static void lsi53c895a_register_types(void)
 }
 
 type_init(lsi53c895a_register_types)
-
-void lsi53c8xx_handle_legacy_cmdline(DeviceState *lsi_dev)
-{
-    LSIState *s = LSI53C895A(lsi_dev);
-
-    scsi_bus_legacy_handle_cmdline(&s->bus);
-}
-- 
2.45.2



  parent reply	other threads:[~2024-11-22 11:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-22 11:19 [PATCH 0/3] hw/scsi: Cleanup around scsi_bus_legacy_handle_cmdline() Philippe Mathieu-Daudé
2024-11-22 11:19 ` [PATCH 1/3] hw/scsi/spapr_vscsi: Call scsi_bus_legacy_handle_cmdline() in REALIZE Philippe Mathieu-Daudé
2024-11-22 11:19 ` Philippe Mathieu-Daudé [this message]
2024-11-22 11:19 ` [PATCH 3/3] hw/scsi/esp: Call scsi_bus_legacy_handle_cmdline() once Philippe Mathieu-Daudé
2024-11-22 12:37 ` [PATCH 0/3] hw/scsi: Cleanup around scsi_bus_legacy_handle_cmdline() Thomas Huth
2024-11-22 12:53   ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241122111939.11936-3-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=arikalo@gmail.com \
    --cc=atar4qemu@gmail.com \
    --cc=danielhb413@gmail.com \
    --cc=deller@gmx.de \
    --cc=fam@euphon.net \
    --cc=harshpb@linux.ibm.com \
    --cc=hpoussin@reactos.org \
    --cc=huth@tuxfamily.org \
    --cc=laurent@vivier.eu \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=mst@redhat.com \
    --cc=npiggin@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).