Skip to content

ahci-test preliminary refactoring

John Snow qemu-devel 2 versions – Applied

Status from this message: Thanks, applied to my block tree:

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest15 patches 5 repliesApplied
  2. v114 patches 19 repliesSuperseded

Changes in v2 from the cover letter

- #6 Made QGuestAllocator object opaque, in a new patch.
- Created page_size setter method.
- #7 Renamed "QOSOperations" to "QOSOps" and added Paolo's R-b.
- #12 Dropped GCC attributes from static inline helpers (ahci.h)
- #15 Adjusted assertion to not compare void ptr to int 0
- #15 Share ahci.o with libqos-obj-pc-y instead of only ahci-test
* ahci.o is pc-only for now.

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/15libqos: Split apart pc_alloc_inittests/libqos/malloc-pc.c tests/libqos/malloc.c tests/libqos/malloc.h+22 -160 replies
2/15qtest/ahci: Create ahci.htests/ahci-test.c tests/libqos/ahci.h+353 -3180 replies
3/15libqos: create libqos.ctests/Makefile tests/ahci-test.c tests/libqos/ahci.h +2 more+119 -570 replies
4/15libqos: add qtest_vboottests/libqos/libqos.c tests/libqos/libqos.h+20 -60 replies
5/15libqos: add alloc_init_flagstests/libqos/malloc-pc.c tests/libqos/malloc.c tests/libqos/malloc.h+11 -30 replies
6/15libqos: Update QGuestAllocator to be opaquetests/libqos/malloc-pc.c tests/libqos/malloc.c tests/libqos/malloc.h+50 -351 reply
7/15libqos: add pc specific interfacetests/Makefile tests/ahci-test.c tests/libqos/libqos-pc.c +3 more+55 -140 replies
8/15qtest/ahci: Store hba_base in AHCIQStatetests/ahci-test.c tests/libqos/ahci.h+65 -720 replies
9/15qtest/ahci: finalize AHCIQState consolidationtests/ahci-test.c tests/libqos/ahci.h+42 -470 replies
10/15qtest/ahci: remove pcibus globaltests/ahci-test.c+6 -80 replies
11/15qtest/ahci: remove guest_malloc globaltests/ahci-test.c+9 -90 replies
12/15libqos/ahci: Functional register helperstests/ahci-test.c tests/libqos/ahci.h+74 -141 reply
13/15qtest/ahci: remove getter/setter macrostests/ahci-test.c+83 -950 replies
14/15qtest/ahci: Bookmark FB and CLB pointerstests/ahci-test.c tests/libqos/ahci.h+26 -220 replies
15/15libqos/ahci: create libqos/ahci.ctests/Makefile tests/ahci-test.c tests/libqos/ahci.c +1 more+280 -2261 reply

Reviews trailers per patch

All 15 patches have a Reviewed-by or Acked-by.

PatchPaolo BonziniMarc Marí
1/15R-b
2/15R-b
3/15R-b
4/15R-b
5/15R-b
6/15R-b
7/15R-b
8/15R-b
9/15R-b
10/15R-b
11/15R-b
12/15R-b
13/15R-b
14/15R-b
15/15R-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 [Qemu-devel] [PATCH v2 00/15] ahci-test preliminary refactoring

This series aims to do two main things:

(1) Eliminate global state out of the ahci-test file so that the tests are more functional. This will allow me to write migration tests more easily. These tests are already written and will be submitted upstream after these refactor series.

(2) With global state removed from ahci-test, factor out functions that would be useful to manipulate ahci devices into libqos/ahci.o, to allow other testwriters to capitalize on the functional refactoring.

So, as an overview, we do a few things:

- Clean up the malloc interface to have a clear pc-specific interface that uses an architecture independent core.

- Add some new structures to help keep track of AHCI and libqos state.

- Rewrite existing AHCI helpers and routines to use the new structures and helper routines.

- Excise any commonly valuable code to libqos/ahci.h and libqos/ahci.c.

This series therefore introduces no new functionality itself, but I was trying to keep the series small and reviewable. The real necessity here in jumbling malloc and ahci functions around is to create a functional interface that can be bundled into a single structure to help facilitate migration testing inside of qtests, for which I intend to export to all of qtests to be re-used for other tests.

Quoted 1 line

From this point forward, the churn to my AHCI refactor series should be

significantly reduced and more pleasant to read.

Thanks,
John.

V2:
- #6 Made QGuestAllocator object opaque, in a new patch.
- Created page_size setter method.
- #7 Renamed "QOSOperations" to "QOSOps" and added Paolo's R-b.
- #12 Dropped GCC attributes from static inline helpers (ahci.h)
- #15 Adjusted assertion to not compare void ptr to int 0
- #15 Share ahci.o with libqos-obj-pc-y instead of only ahci-test
* ahci.o is pc-only for now.

John Snow (15):
libqos: Split apart pc_alloc_init
qtest/ahci: Create ahci.h
libqos: create libqos.c
libqos: add qtest_vboot
libqos: add alloc_init_flags
libqos: Update QGuestAllocator to be opaque
libqos: add pc specific interface
qtest/ahci: Store hba_base in AHCIQState
qtest/ahci: finalize AHCIQState consolidation
qtest/ahci: remove pcibus global
qtest/ahci: remove guest_malloc global
libqos/ahci: Functional register helpers
qtest/ahci: remove getter/setter macros
qtest/ahci: Bookmark FB and CLB pointers
libqos/ahci: create libqos/ahci.c

 tests/Makefile           |   5 +-
 tests/ahci-test.c        | 894 ++++++++---------------------------------------
 tests/libqos/ahci.c      | 269 ++++++++++++++
 tests/libqos/ahci.h      | 435 +++++++++++++++++++++++
 tests/libqos/libqos-pc.c |  24 ++
 tests/libqos/libqos-pc.h |   9 +
 tests/libqos/libqos.c    |  63 ++++
 tests/libqos/libqos.h    |  33 ++
 tests/libqos/malloc-pc.c |  20 +-
 tests/libqos/malloc.c    |  86 ++++-
 tests/libqos/malloc.h    |  25 +-
 11 files changed, 1068 insertions(+), 795 deletions(-)
 create mode 100644 tests/libqos/ahci.c
 create mode 100644 tests/libqos/ahci.h
 create mode 100644 tests/libqos/libqos-pc.c
 create mode 100644 tests/libqos/libqos-pc.h
 create mode 100644 tests/libqos/libqos.c
 create mode 100644 tests/libqos/libqos.h
Signature · 1 line
1.9.3