[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 6/8] hw/ide: Do ide_drive_get() within pci_ide_create_devs()
From: |
Markus Armbruster |
Subject: |
Re: [PATCH 6/8] hw/ide: Do ide_drive_get() within pci_ide_create_devs() |
Date: |
Mon, 16 Mar 2020 15:03:32 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) |
Philippe Mathieu-Daudé <address@hidden> writes:
> On 3/16/20 7:23 AM, Markus Armbruster wrote:
>> Paolo Bonzini <address@hidden> writes:
>>
>>> On 13/03/20 23:16, BALATON Zoltan wrote:
>>>>>
>>>>> + pci_dev = pci_create_simple(pci_bus, -1, "cmd646-ide");
>>>>> + pci_ide_create_devs(pci_dev);
>>>>
>>>> Additionally, I think it may also make sense to move pci_ide_create_devs
>>>> call into the realize methods of these IDE controllers so boards do not
>>>> need to do it explicitely. These calls always follow the creation of the
>>>> device immediately so could just be done internally in IDE device and
>>>> simplify it further. I can attempt to prepare additional patches for
>>>> that but first I'd like to hear if anyone has anything against that to
>>>> avoid doing useless work.
>>>
>>> No, it's better to do it separately. I think that otherwise you could
>>> add another IDE controller with -device, and both controllers would try
>>> to add the drives.
>>
>> Correct.
>>
>> Creating device frontends for -drive if=ide is the board's job. Boards
>> may delegate to suitable helpers. I'd very much prefer these helpers
>> not to live with device model code. Board and device model code should
>> be cleanly separated to to reduce the temptation to muddle their
>> responsibilities. It's separation of concerns.
>>
>> I actually wish we had separate sub-trees for boards and devices instead
>> of keeping both in hw/.
>
> Never too late!
>
> To be clear, you suggest:
>
> - one dir with machines, boards, system-on-module
> - one dir with devices, cpu, system-on-chips
>
> Correct?
In QOM terms:
* One sub-tree with descendants of TYPE_DEVICE
* One sub-tree with descendants of TYPE_MACHINE
- Re: [PATCH 5/8] hw/ide/pci.c: Coding style update to fix checkpatch errors, (continued)
Re: [PATCH 0/8] Misc hw/ide legacy clean up, Mark Cave-Ayland, 2020/03/14
Re: [PATCH 0/8] Misc hw/ide legacy clean up, Markus Armbruster, 2020/03/16
[PATCH v2] hw/ide: Move MAX_IDE_DEVS define to hw/ide/internal.h, BALATON Zoltan, 2020/03/16
[PATCH v2] hw/ide: Do ide_drive_get() within pci_ide_create_devs(), BALATON Zoltan, 2020/03/16