qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: BALATON Zoltan <balaton@eik.bme.hu>
Cc: qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
	John Snow <jsnow@redhat.com>,
	qemu-block@nongnu.org, Miroslav Rezanina <mrezanin@redhat.com>
Subject: Re: [PATCH] hw/ide: Add the possibility to disable the CompactFlash device in the build
Date: Thu, 1 Feb 2024 20:25:07 +0100	[thread overview]
Message-ID: <bffd1672-c084-4177-8a5a-51e0dbcf38be@redhat.com> (raw)
In-Reply-To: <alpine.LMD.2.03.2402011352080.16176@eik.bme.hu>

On 01/02/2024 13.54, BALATON Zoltan wrote:
> On Thu, 1 Feb 2024, Thomas Huth wrote:
>> On 01/02/2024 13.39, BALATON Zoltan wrote:
>>> On Thu, 1 Feb 2024, Thomas Huth wrote:
>>>> For distros like downstream RHEL, it would be helpful to allow to disable
>>>> the CompactFlash device. For making this possible, we need a separate
>>>> Kconfig switch for this device, and the code should reside in a separate
>>>> file.
>>>>
>>>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>>>> ---
>>>> hw/ide/qdev-ide.h  | 41 ++++++++++++++++++++++++++++++++
>>>> hw/ide/cf.c        | 58 ++++++++++++++++++++++++++++++++++++++++++++++
>>>> hw/ide/qdev.c      | 51 ++--------------------------------------
>>>> hw/ide/Kconfig     |  4 ++++
>>>> hw/ide/meson.build |  1 +
>>>> 5 files changed, 106 insertions(+), 49 deletions(-)
>>>> create mode 100644 hw/ide/qdev-ide.h
>>>> create mode 100644 hw/ide/cf.c
>>>>
>>>> diff --git a/hw/ide/qdev-ide.h b/hw/ide/qdev-ide.h
>>>> new file mode 100644
>>>> index 0000000000..3dd977466c
>>>> --- /dev/null
>>>> +++ b/hw/ide/qdev-ide.h
>>>
>>> This may be unrelated to this patch but we already have 
>>> include/hw/ide/internal.h which may be a place these should go in but 
>>> that header is in inlcude because some files outside hw/ide include it. 
>>> I've found three places that include ide/internal.h: hw/arm/sbsa-ref.c, 
>>> hw/i386/pc.c and hw/misc/macio.h. Only macio is really needing internal 
>>> IDE parts the other two just uses some functions so macio is probably the 
>>> reason this wasn't cleaned up yet. In any case, maybe this could go in 
>>> include/hw/ide/internal.h to avoid introducing a new header or somehow 
>>> make this a local header where non-public parts of hw/ide/internal.h 
>>> could be moved in the future. Such as rename include/hw/ide/internal.h to 
>>> ide.h and name this one internal.h maybe?
>>
>> I don't like headers that much that just collect a lot of only slightly 
>> related things. That only causes problems again when you have to 
>> unentangle the stuff one day. So what's wrong with having a dedicated 
>> header for the stuff in hw/ide/qdev.c ?
> 
> Maybe that it's not obvious from the name that it belongs to qdev.c as the 
> names are not the same.

I didn't want to just name the header "qdev.h" since that could easily be 
confused in #include statements...
IMHO qdev.c is already a very bad idea for a file name here... maybe 
something like ide-dev.c and ide-dev.h would be better?

> Also some of the qdev stuff that should be in this 
> header are in include/hw/ide/internal.h so these will still be split 
> arbitrarily.

Oh, well, it seems to be a mess already... hw/ide/pci.h includes the 
internal.h header and thus opens the internal definitions to all PCI-based 
IDE devices :-/

If we can agree on a better name for qdev-ide.h, I can try to clean that 
mess up a little bit...

  Thomas



  reply	other threads:[~2024-02-01 19:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-01  8:29 [PATCH] hw/ide: Add the possibility to disable the CompactFlash device in the build Thomas Huth
2024-02-01 12:39 ` BALATON Zoltan
2024-02-01 12:49   ` Thomas Huth
2024-02-01 12:54     ` BALATON Zoltan
2024-02-01 19:25       ` Thomas Huth [this message]
2024-02-01 19:51         ` 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=bffd1672-c084-4177-8a5a-51e0dbcf38be@redhat.com \
    --to=thuth@redhat.com \
    --cc=balaton@eik.bme.hu \
    --cc=jsnow@redhat.com \
    --cc=mrezanin@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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).