Received: from eggs.gnu.org ([2001:4830:134:3::10]:33168) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9CiC-0003IP-W6 for qemu-devel@nongnu.org; Thu, 19 Apr 2018 12:47:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9CiB-0007RY-Pi for qemu-devel@nongnu.org; Thu, 19 Apr 2018 12:47:09 -0400 Received: from mail-qt0-x22b.google.com ([2607:f8b0:400d:c0d::22b]:45202) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9CiB-0007RE-KF for qemu-devel@nongnu.org; Thu, 19 Apr 2018 12:47:07 -0400 Received: by mail-qt0-x22b.google.com with SMTP id b13-v6so6485545qtp.12 for ; Thu, 19 Apr 2018 09:47:07 -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:38 -0300 Message-Id: <20180419164642.9536-4-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 3/7] qemu.py: Check console arch is supported before calling 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 Signed-off-by: Philippe Mathieu-Daudé --- scripts/qemu.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/qemu.py b/scripts/qemu.py index 0eecc44d09..379767b62f 100644 --- a/scripts/qemu.py +++ b/scripts/qemu.py @@ -189,6 +189,16 @@ class QEMUMachine(object): if option in item: return [] + device = '{dev_type},chardev=console' + if '86' in self._arch: + device = device.format(dev_type='isa-serial') + elif 'ppc' in self._arch: + device = device.format(dev_type='spapr-vty') + elif 's390x' in self._arch: + device = device.format(dev_type='sclpconsole') + else: + return [] + chardev = 'socket,id=console,{address},server,nowait' if console_address is None: console_address = tempfile.mktemp() @@ -203,16 +213,6 @@ class QEMUMachine(object): self._console_address = console_address - device = '{dev_type},chardev=console' - if '86' in self._arch: - device = device.format(dev_type='isa-serial') - elif 'ppc' in self._arch: - device = device.format(dev_type='spapr-vty') - elif 's390x' in self._arch: - device = device.format(dev_type='sclpconsole') - else: - return [] - return ['-chardev', chardev, '-device', device] -- 2.17.0