From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33268) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJgtI-0004n4-P8 for qemu-devel@nongnu.org; Tue, 19 Aug 2014 06:43:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XJgtD-0004ag-Fn for qemu-devel@nongnu.org; Tue, 19 Aug 2014 06:43:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22410) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJgtD-0004ab-5Q for qemu-devel@nongnu.org; Tue, 19 Aug 2014 06:43:43 -0400 From: Paolo Bonzini Date: Tue, 19 Aug 2014 12:42:59 +0200 Message-Id: <1408444983-21464-17-git-send-email-pbonzini@redhat.com> In-Reply-To: <1408444983-21464-1-git-send-email-pbonzini@redhat.com> References: <1408444983-21464-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PULL 16/20] exec: Abstract away ref to memory region names List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Crosthwaite From: Peter Crosthwaite Use the function provided rather than spying on the struct. Signed-off-by: Peter Crosthwaite Signed-off-by: Paolo Bonzini --- exec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exec.c b/exec.c index 5a2a25e..42688b6 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); -- 1.8.3.1