From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51057) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WJSHA-0003lS-69 for qemu-devel@nongnu.org; Fri, 28 Feb 2014 13:35:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WJSH4-0005qg-7f for qemu-devel@nongnu.org; Fri, 28 Feb 2014 13:35:12 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33993) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WJSH3-0005pi-WE for qemu-devel@nongnu.org; Fri, 28 Feb 2014 13:35:06 -0500 From: Stefan Hajnoczi Date: Fri, 28 Feb 2014 19:33:41 +0100 Message-Id: <1393612423-26267-8-git-send-email-stefanha@redhat.com> In-Reply-To: <1393612423-26267-1-git-send-email-stefanha@redhat.com> References: <1393612423-26267-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PULL 7/9] block: use /var/tmp instead of /tmp for -snapshot List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Anthony Liguori From: Amit Shah 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 --- 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