From: Amit Shah Date: Wed, 26 Feb 2014 09:42:37 +0000 (+0530) Subject: block: use /var/tmp instead of /tmp for -snapshot X-Git-Tag: v2.0.0-rc0~44^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=69bef7931e8880c709556f8444938d8bb9a16118;p=thirdparty%2Fqemu.git block: use /var/tmp instead of /tmp for -snapshot 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 Signed-off-by: Stefan Hajnoczi --- diff --git a/block.c b/block.c index 2fd54825728..38bbdf30838 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; }