Skip to content

hw/ide: Clean up hw/ide/qdev.c and include/hw/ide/internal.h

Thomas Huth qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest7 patches 6 repliesIn review
  2. v17 patches 8 repliesSuperseded

Changes in v2 from the cover letter

- Change the order of the DMA patch and move typedef struct IDEDMAOps and typedef struct IDEDMA IDEDMA into ide-dma.h, too
- Make sure that the headers are self-contained (i.e. #include the right other headers)
- Remove some more remnants of include/hw/ide.h

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7hw/ide: Add the possibility to disable the CompactFlash device in the buildhw/ide/Kconfig hw/ide/cf.c hw/ide/meson.build +2 more+106 -490 replies
2/7hw/ide: Split qdev.c into ide-bus.c and ide-dev.chw/arm/Kconfig hw/ide/Kconfig hw/ide/ide-bus.c +2 more+134 -990 replies
3/7hw/ide: Move IDE DMA related definitions to a separate header ide-dma.hinclude/hw/ide/ide-dma.h include/hw/ide/internal.h+38 -281 reply
4/7hw/ide: Move IDE device related definitions to ide-dev.hhw/ide/ide-dev.c include/hw/ide/ide-dev.h include/hw/ide/internal.h+144 -1433 replies
5/7hw/ide: Move IDE bus related definitions to a new header ide-bus.hinclude/hw/ide/ide-bus.h include/hw/ide/internal.h+43 -391 reply
6/7hw/ide: Remove the include/hw/ide.h legacy fileMAINTAINERS include/hw/ide.h include/hw/ide/ide-dev.h +1 more+3 -120 replies
7/7hw/ide: Stop exposing internal.h to non-IDE fileshw/i386/pc.c hw/ide/cmd646.c hw/ide/pci.c +4 more+7 -20 replies

Reviews trailers per patch

All 7 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchPhilippe Mathieu-DaudéMark Cave-Ayland
SeriesA-b
1/7R-b
2/7R-b
3/7R-b
4/7R-b
5/7R-b
6/7R-b
7/7R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/7] hw/ide: Clean up hw/ide/qdev.c and include/hw/ide/internal.h

While trying to make it possible to compile-out the CompactFlash IDE device in downstream distributions (first patch), we noticed that there are more things in the IDE code that could use a proper clean up:

First, hw/ide/qdev.c is quite a mix between IDE BUS specific functions and (disk) device specific functions. Thus the second patch splits qdev.c into two new separate files to make it more obvious which part belongs to which kind of devices.

The remaining patches unentangle include/hw/ide/internal.h, which is meant as a header that should only be used internally to the IDE subsystem, but which is currently exposed to the world since include/hw/ide/pci.h includes this header, too. Thus we move the definitions that are also required for non-IDE code to other new header files, so we can finally change pci.h to stop including internal.h. After these changes, internal.h is only included by files in hw/ide/ as it should be.

v2:
- Change the order of the DMA patch and move typedef struct IDEDMAOps and typedef struct IDEDMA IDEDMA into ide-dma.h, too
- Make sure that the headers are self-contained (i.e. #include the right other headers)
- Remove some more remnants of include/hw/ide.h

Thomas Huth (7):
hw/ide: Add the possibility to disable the CompactFlash device in the
build
hw/ide: Split qdev.c into ide-bus.c and ide-dev.c
hw/ide: Move IDE DMA related definitions to a separate header
ide-dma.h
hw/ide: Move IDE device related definitions to ide-dev.h hw/ide: Move IDE bus related definitions to a new header ide-bus.h hw/ide: Remove the include/hw/ide.h legacy file
hw/ide: Stop exposing internal.h to non-IDE files

 MAINTAINERS                  |   1 -
 include/hw/ide.h             |   9 --
 include/hw/ide/ide-bus.h     |  42 +++++++
 include/hw/ide/ide-dev.h     | 184 ++++++++++++++++++++++++++++++
 include/hw/ide/ide-dma.h     |  37 ++++++
 include/hw/ide/internal.h    | 211 +----------------------------------
 include/hw/ide/pci.h         |   2 +-
 hw/i386/pc.c                 |   2 +-
 hw/ide/cf.c                  |  58 ++++++++++
 hw/ide/cmd646.c              |   1 +
 hw/ide/ide-bus.c             | 111 ++++++++++++++++++
 hw/ide/{qdev.c => ide-dev.c} | 137 +----------------------
 hw/ide/pci.c                 |   1 +
 hw/ide/piix.c                |   1 +
 hw/ide/sii3112.c             |   1 +
 hw/ide/via.c                 |   1 +
 hw/arm/Kconfig               |   2 +
 hw/ide/Kconfig               |  32 ++++--
 hw/ide/meson.build           |   4 +-
 19 files changed, 470 insertions(+), 367 deletions(-)
 delete mode 100644 include/hw/ide.h
 create mode 100644 include/hw/ide/ide-bus.h
 create mode 100644 include/hw/ide/ide-dev.h
 create mode 100644 include/hw/ide/ide-dma.h
 create mode 100644 hw/ide/cf.c
 create mode 100644 hw/ide/ide-bus.c
 rename hw/ide/{qdev.c => ide-dev.c} (67%)
Signature · 1 line
2.43.2