From patchwork Fri Mar 1 17:21:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [v2] exec: make -mem-path filenames deterministic X-Patchwork-Submitter: Peter Feiner X-Patchwork-Id: 224417 Message-Id: <1362158493-11907-1-git-send-email-peter@gridcentric.ca> To: qemu-devel@nongnu.org, aliguori@us.ibm.com Cc: andreslc@gridcentric.ca, peter@gridcentric.ca Date: Fri, 1 Mar 2013 12:21:33 -0500 From: peter@gridcentric.ca List-Id: From: Peter Feiner Adds ramblocks' names to their backing files when using -mem-path. Eases introspection and debugging. Signed-off-by: Peter Feiner --- On Tue, Jan 8, 2013 at 2:04 PM, Anthony Liguori wrote: > > Yes, please submit the oneliner. Here it is :) The commit should probably be called "exec: add ramblocks' names to -mem-path files" since the paths aren't deterministic. v1 -> v2: Just add ramblock name to mkstemp template. Thanks, Peter exec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exec.c b/exec.c index a41bcb8..16a5452 100644 --- a/exec.c +++ b/exec.c @@ -865,7 +865,8 @@ static void *file_ram_alloc(RAMBlock *block, return NULL; } - filename = g_strdup_printf("%s/qemu_back_mem.XXXXXX", path); + filename = g_strdup_printf("%s/qemu_back_mem.%s.XXXXXX", path, + block->mr->name); fd = mkstemp(filename); if (fd < 0) {