romfile_loader: utility to patch in-memory ROM files

Add ability for a ROM file to point to
it's image in memory. When file is in memory,
add utility that can patch it, storing
pointers to one file within another file.

This is not a lot of code: together with the follow-up patch to load
ACPI tables from ROM, it's about 1K extra.

Signed-off-by: Michael S. Tsirkin <>
Signed-off-by: Gerd Hoffmann <>
3 files changed