From: Peter Feiner <pe...@gridcentric.ca>

Adds ramblocks' names to their backing files when using -mem-path.  Eases
introspection and debugging.

Signed-off-by: Peter Feiner <pe...@gridcentric.ca>
---

On Tue, Jan 8, 2013 at 2:04 PM, Anthony Liguori <aligu...@us.ibm.com> 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) {
-- 
1.7.10.4


Reply via email to