qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Use TMPDIR environment Variable for Snapshot Mode


From: Oliver Adler
Subject: [Qemu-devel] Use TMPDIR environment Variable for Snapshot Mode
Date: Sat, 17 Mar 2007 02:40:59 +0100
User-agent: Mutt/1.4.1i

Hi Folks,
thank you VERY MUCH for bringing qemu to us.

I would like to see this little modification, honoring the
setting of the TMPDIR environment variable. Then I can use
the snapshot mode even if my /tmp directory is small in
size:

The diff is based on the qemu-0.9.0 release.

--- block.c+    Sat Mar 17 02:06:26 2007
+++ block.c     Fri Mar 16 23:21:21 2007
@@ -188,8 +188,13 @@
 void get_tmp_filename(char *filename, int size)
 {
     int fd;
+    char *tmpdir;
     /* XXX: race condition possible */
-    pstrcpy(filename, size, "/tmp/vl.XXXXXX");
+    tmpdir = getenv("TMPDIR");
+    if (tmpdir == NULL)
+       tmpdir = "/tmp";
+    snprintf(filename, size, "%s/vl.XXXXXX", tmpdir);
+//    pstrcpy(filename, size, "/tmp/vl.XXXXXX");
     fd = mkstemp(filename);
     close(fd);
 }



Thank you 


Oliver




reply via email to

[Prev in Thread] Current Thread [Next in Thread]