Skip to content

mini-os: remove struct file dependency on config

Juergen Gross xen-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest5 patches 5 repliesIn review
  2. v218 patches 21 repliesSuperseded
  3. v115 patches 21 repliesSuperseded

Changes in v3 from the cover letter

- first 14 patches already applied
- added patch 5

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5introduce get_file_from_fd()include/lib.h lib/sys.c+9 -00 replies
2/5reset file type in close() in one place onlylib/sys.c lib/xs.c+29 -281 reply
3/5remove file type FTYPE_XCConfig.mk arch/x86/testbuild/all-no arch/x86/testbuild/all-yes +3 more+0 -181 reply
4/5use function vectors instead of switch for file operationsinclude/lib.h lib/sys.c+263 -621 reply
5/5add CONFIG_LIBXS itemConfig.mk Makefile arch/x86/testbuild/all-no +3 more+14 -51 reply

Reviews trailers per patch

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

PatchSamuel Thibault
1/5R-b
2/5R-b
3/5R-b
4/5R-b
5/5R-b

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

Read the v3 thread

Cover letter [MINIOS PATCH v3 0/5] mini-os: remove struct file dependency on config

Today the layout of struct file is depending on the Mini-OS configuration. This is especially bad as the layout is exported to external users like the Xen libraries built for Mini-OS, and those are being built only once for multiple stubdom configurations.

Today there is no direct problem resulting from this, as the main difference between struct file layouts is a large union containing all the device specific data for the different file types. The largest union member is not configuration dependant, so the build is currently not broken.

In order to avoid any future problems this patch series is eliminating the configuration dependency by replacing most of the device specific union members by a single pointer.

The two union members used by Xen libraries can't be replaced yet, as those need to be switched to use the generic pointer first.

In order to hide the Mini-OS internal implementation of the files array, patches 1, 2, and 4 are introducing a common framework to access a struct file via its file descriptor, and to allocate new file types dynamically instead of having them all pre-defined. The file type specific operations are supplied via a function vector in order to remove the dependency of lib/sys.c on all the various file types.

Patch 5 is preparing a possible future support of libxenstore instead of using the Mini-OS internal variant located in lib/xs.c.

Changes in v3:
- first 14 patches already applied
- added patch 5

Changes in V2:
- added 3 more patches

Juergen Gross (5):
introduce get_file_from_fd()
reset file type in close() in one place only remove file type FTYPE_XC
use function vectors instead of switch for file operations add CONFIG_LIBXS item

 Config.mk                     |  11 +-
 Makefile                      |   2 +-
 arch/x86/testbuild/all-no     |   2 +-
 arch/x86/testbuild/all-yes    |   2 +-
 arch/x86/testbuild/newxen-yes |   2 +-
 include/lib.h                 |  59 ++++--
 lib/sys.c                     | 345 ++++++++++++++++++++++++++--------
 lib/xs.c                      |   1 -
 8 files changed, 313 insertions(+), 111 deletions(-)
Signature · 1 line
2.26.2