qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/1] block: use /var/tmp instead of /tmp for -snapshot
@ 2014-02-26  9:42 Amit Shah
  2014-02-27 10:18 ` Stefan Hajnoczi
  0 siblings, 1 reply; 4+ messages in thread
From: Amit Shah @ 2014-02-26  9:42 UTC (permalink / raw)
  To: qemu list; +Cc: Kevin Wolf, Amit Shah, Stefan Hajnoczi

If TMPDIR is not specified, the default was to use /tmp for the working
copy of the block devices.  Update this to /var/tmp instead, so systems
using tmp-on-tmpfs don't end up inadvertently using RAM for the block
device.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
 block.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/block.c b/block.c
index 2fd5482..38bbdf3 100644
--- a/block.c
+++ b/block.c
@@ -547,8 +547,9 @@ int get_tmp_filename(char *filename, int size)
     int fd;
     const char *tmpdir;
     tmpdir = getenv("TMPDIR");
-    if (!tmpdir)
-        tmpdir = "/tmp";
+    if (!tmpdir) {
+        tmpdir = "/var/tmp";
+    }
     if (snprintf(filename, size, "%s/vl.XXXXXX", tmpdir) >= size) {
         return -EOVERFLOW;
     }
-- 
1.8.5.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-02-27 13:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-26  9:42 [Qemu-devel] [PATCH 1/1] block: use /var/tmp instead of /tmp for -snapshot Amit Shah
2014-02-27 10:18 ` Stefan Hajnoczi
2014-02-27 11:33   ` Amit Shah
2014-02-27 13:42     ` Eric Blake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).