On 9/17/25 08:18, Richard Henderson wrote:
On 9/17/25 05:56, Akihiko Odaki wrote:
The name field of an QOM-ified AddressSpace represents a property name,
which may not be sufficient to identify the AddressSpace. Use
address_space_get_path() instead.
Signed-off-by: Akihiko Odaki <[email protected]>
---
hw/core/loader.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/core/loader.c b/hw/core/loader.c
index 524af6f14a09..1ee603f19c90 100644
--- a/hw/core/loader.c
+++ b/hw/core/loader.c
@@ -1258,10 +1258,10 @@ static bool roms_overlap(Rom *last_rom, Rom *this_rom)
last_rom->addr + last_rom->romsize > this_rom->addr;
}
-static const char *rom_as_name(Rom *rom)
+static const char *rom_as_path(Rom *rom)
{
- const char *name = rom->as ? rom->as->name : NULL;
- return name ?: "anonymous";
+ const char *path = rom->as ? address_space_get_path(rom->as) : NULL;
+ return path ?: "anonymous";
}
You're not freeing the result of address_space_get_path.
In addition, I think the result of address_space_get_path cannot be null, so,
if (rom->as) {
return address_space_get_path(rom->as);
}
return g_strdup("anonymous");
r~