Received: from eggs.gnu.org ([2001:4830:134:3::10]:33204) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9CiF-0003LL-Pn for qemu-devel@nongnu.org; Thu, 19 Apr 2018 12:47:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9CiF-0007TH-1K for qemu-devel@nongnu.org; Thu, 19 Apr 2018 12:47:11 -0400 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:45373) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9CiE-0007Sy-Tl for qemu-devel@nongnu.org; Thu, 19 Apr 2018 12:47:10 -0400 Received: by mail-qk0-x242.google.com with SMTP id c136so5941415qkb.12 for ; Thu, 19 Apr 2018 09:47:10 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Thu, 19 Apr 2018 13:46:39 -0300 Message-Id: <20180419164642.9536-5-f4bug@amsat.org> In-Reply-To: <20180419164642.9536-1-f4bug@amsat.org> References: <20180419164642.9536-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [RFC PATCH 4/7] qemu.py: Avoid deprecated tempfile.mktemp() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?q?Luk=C3=A1=C5=A1=20Doktor?= , Cleber Rosa , Amador Pahim , Stefan Hajnoczi , Zheng Xiang Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Fam Zheng , Alistair Francis , Eduardo Habkost We already have secure temporary directory created with tempfile.mkdtemp(). Signed-off-by: Philippe Mathieu-Daudé --- scripts/qemu.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/qemu.py b/scripts/qemu.py index 379767b62f..26c4b1fd3b 100644 --- a/scripts/qemu.py +++ b/scripts/qemu.py @@ -201,7 +201,8 @@ class QEMUMachine(object): chardev = 'socket,id=console,{address},server,nowait' if console_address is None: - console_address = tempfile.mktemp() + console_address = os.path.join(self._temp_dir, + self._name + "-console.sock") chardev = chardev.format(address='path=%s' % console_address) elif isinstance(console_address, tuple): -- 2.17.0