From: Paolo Bonzini <pbonzini@redhat.com>
To: "Thomas Huth" <thuth@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
qemu-devel@nongnu.org
Cc: 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>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Thomas Huth" <huth@tuxfamily.org>,
"Peter Maydell" <peter.maydell@linaro.org>,
"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: Re: [PATCH 0/3] hw/scsi: Cleanup around scsi_bus_legacy_handle_cmdline()
Date: Fri, 22 Nov 2024 13:53:19 +0100 [thread overview]
Message-ID: <5b91eba1-be60-48b9-ab6c-9f483601e36e@redhat.com> (raw)
In-Reply-To: <f18c00d1-1ae3-4f14-9e6e-5fa1fb09b1d5@redhat.com>
On 11/22/24 13:37, Thomas Huth wrote:
> On 22/11/2024 12.19, Philippe Mathieu-Daudé wrote:
>> When a device model requires legacy command line handling,
>> call scsi_bus_legacy_handle_cmdline() in its realize handler
>> instead of having each user call it.
>>
>> This applies to:
>> - spapr_vscsi
>> - lsi53c810 / lsi53c895a
>> - sysbus_esp
>>
>> Note, scsi_bus_legacy_handle_cmdline() prototype could be
>> made private to hw/scsi/ to restrict its use to scsi device
>> implementations.
>
> Not sure whether this is the right way to go ... shouldn't the handling
> of the legacy command line be rather part of the machine than being part
> of the SCSI controller device? Imagine for example a machine that has
> multiple, different SCSI controllers - I think you'd rather want to let
> the machine decide where the legacy devices should be grabbed from than
> having the SCSI controller devices fight for them...?
I agree that it should be done in the machines generally:
1) if the machine creates a SCSI controller, it should then call
scsi_bus_legacy_handle_cmdline(). This is the case for esp and for
spapr-vscsi (so spapr_vscsi_create() could be inlined in its caller).
2) lsi53c* is the odd one out because it was "the" way to add "-drive
if=scsi" to the PC machine.
For case (2) it's okay to call it in the realize function, I guess.
However, let's only process -drive if=scsi for devices added on the
command-line.
The LSI HBA should not call scsi_bus_legacy_handle_cmdline() if
dev->hotplugged. I think we can do it without a deprecation period,
and in fact assert that !phase_check(PHASE_MACHINE_READY) in
scsi_bus_legacy_handle_cmdline().
Paolo
prev parent reply other threads:[~2024-11-22 12:54 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 ` [PATCH 2/3] hw/scsi/lsi53c895a: Call scsi_bus_legacy_handle_cmdline() once Philippe Mathieu-Daudé
2024-11-22 11:19 ` [PATCH 3/3] hw/scsi/esp: " 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 [this message]
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=5b91eba1-be60-48b9-ab6c-9f483601e36e@redhat.com \
--to=pbonzini@redhat.com \
--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=peter.maydell@linaro.org \
--cc=philmd@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).