All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>,
	qemu-block@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>,
	Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
	Markus Armbruster <armbru@redhat.com>,
	qemu-devel@nongnu.org, hpoussin@reactos.org,
	Aleksandar Markovic <amarkovic@wavecomp.com>,
	Paolo Bonzini <pbonzini@redhat.com>, John Snow <jsnow@redhat.com>,
	Artyom Tarasenko <atar4qemu@gmail.com>,
	Richard Henderson <rth@twiddle.net>
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	[thread overview]
Message-ID: <87pndcgzwr.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <f3aa3c0d-0786-18aa-0c75-e195910b7a77@redhat.com> ("Philippe Mathieu-Daudé"'s message of "Mon, 16 Mar 2020 09:30:52 +0100")

Philippe Mathieu-Daudé <philmd@redhat.com> writes:

> On 3/16/20 7:23 AM, Markus Armbruster wrote:
>> Paolo Bonzini <pbonzini@redhat.com> 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



  reply	other threads:[~2020-03-16 15:23 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-13 21:14 [PATCH 0/8] Misc hw/ide legacy clean up BALATON Zoltan
2020-03-13 21:14 ` [PATCH 8/8] hw/ide: Remove unneeded inclusion of hw/ide.h BALATON Zoltan
2020-03-13 21:14 ` [PATCH 5/8] hw/ide/pci.c: Coding style update to fix checkpatch errors BALATON Zoltan
2020-03-14 22:05   ` Philippe Mathieu-Daudé
2020-03-13 21:14 ` [PATCH 2/8] hw/ide: Get rid of piix4_init function BALATON Zoltan
2020-03-14 22:02   ` Philippe Mathieu-Daudé
2020-03-14 23:52     ` BALATON Zoltan
2020-03-15  5:35   ` Michael S. Tsirkin
2020-03-15 12:08     ` BALATON Zoltan
2020-03-13 21:14 ` [PATCH 1/8] hw/ide: Get rid of piix3_init functions BALATON Zoltan
2020-03-14 21:59   ` Philippe Mathieu-Daudé
2020-03-16  6:34   ` Markus Armbruster
2020-03-16 12:40     ` BALATON Zoltan
2020-03-13 21:14 ` [PATCH 3/8] hw/ide: Remove now unneded #include "hw/pci/pci.h" from hw/ide.h BALATON Zoltan
2020-03-14 22:03   ` Philippe Mathieu-Daudé
2020-03-13 21:14 ` [PATCH 7/8] hw/ide: Move MAX_IDE_DEVS define to hw/ide/internal.h BALATON Zoltan
2020-03-13 21:14 ` [PATCH 4/8] hw/ide: Move MAX_IDE_BUS define to one header BALATON Zoltan
2020-03-16  6:53   ` Markus Armbruster
2020-03-16  8:23     ` Philippe Mathieu-Daudé
2020-03-13 21:14 ` [PATCH 6/8] hw/ide: Do ide_drive_get() within pci_ide_create_devs() BALATON Zoltan
2020-03-13 22:16   ` BALATON Zoltan
2020-03-14 10:01     ` Paolo Bonzini
2020-03-16  6:23       ` Markus Armbruster
2020-03-16  8:30         ` Philippe Mathieu-Daudé
2020-03-16 14:03           ` Markus Armbruster [this message]
2020-03-14 11:45 ` [PATCH 0/8] Misc hw/ide legacy clean up Mark Cave-Ayland
2020-03-14 11:54   ` Paolo Bonzini
2020-03-16  6:58 ` Markus Armbruster
2020-03-16 13:06   ` BALATON Zoltan
2020-03-16 13:41     ` BALATON Zoltan
2020-03-17  4:25       ` John Snow
2020-03-16 12:55 ` [PATCH v2] hw/ide: Move MAX_IDE_DEVS define to hw/ide/internal.h BALATON Zoltan
2020-03-16 13:35 ` [PATCH v2] hw/ide: Do ide_drive_get() within pci_ide_create_devs() BALATON Zoltan

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=87pndcgzwr.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=amarkovic@wavecomp.com \
    --cc=atar4qemu@gmail.com \
    --cc=ehabkost@redhat.com \
    --cc=hpoussin@reactos.org \
    --cc=jsnow@redhat.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.