From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60805) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WIb14-0006PK-KK for qemu-devel@nongnu.org; Wed, 26 Feb 2014 04:43:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WIb0x-0003jM-QB for qemu-devel@nongnu.org; Wed, 26 Feb 2014 04:43:02 -0500 Received: from mx1.redhat.com ([209.132.183.28]:65515) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WIb0x-0003iv-IP for qemu-devel@nongnu.org; Wed, 26 Feb 2014 04:42:55 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s1Q9grH5020773 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 26 Feb 2014 04:42:53 -0500 From: Amit Shah Date: Wed, 26 Feb 2014 15:12:37 +0530 Message-Id: <155481d240779c5d25f8195a406d57db613507bc.1393407651.git.amit.shah@redhat.com> Subject: [Qemu-devel] [PATCH 1/1] block: use /var/tmp instead of /tmp for -snapshot List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 --- 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