aboutsummaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorPeter Crosthwaite <peter.crosthwaite@xilinx.com>2014-08-14 23:54:29 -0700
committerPaolo Bonzini <pbonzini@redhat.com>2014-08-18 12:06:21 +0200
commit83234bf2fa4b28feb2accee823c56f2188eed48c (patch)
tree7bb17246151488d1b79ae1a5d56cfa73cc59e34b /exec.c
parent401cf7fdc4b9f1971ee74927511391a66af0627e (diff)
exec: Abstract away ref to memory region names
Use the function provided rather than spying on the struct. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/exec.c b/exec.c
index 5a2a25e851..42688b69b1 100644
--- a/exec.c
+++ b/exec.c
@@ -1044,7 +1044,7 @@ static void *file_ram_alloc(RAMBlock *block,
}
/* Make name safe to use with mkstemp by replacing '/' with '_'. */
- sanitized_name = g_strdup(block->mr->name);
+ sanitized_name = g_strdup(memory_region_name(block->mr));
for (c = sanitized_name; *c != '\0'; c++) {
if (*c == '/')
*c = '_';
@@ -1242,7 +1242,7 @@ static ram_addr_t ram_block_add(RAMBlock *new_block)
new_block->host = phys_mem_alloc(new_block->length);
if (!new_block->host) {
fprintf(stderr, "Cannot set up guest memory '%s': %s\n",
- new_block->mr->name, strerror(errno));
+ memory_region_name(new_block->mr), strerror(errno));
exit(1);
}
memory_try_enable_merging(new_block->host, new_block->length);