Received: from eggs.gnu.org ([2001:4830:134:3::10]:49677) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDb3u-0006hH-2I for qemu-devel@nongnu.org; Tue, 01 May 2018 15:35:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fDb3p-0007cJ-EQ for qemu-devel@nongnu.org; Tue, 01 May 2018 15:35:42 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:57300 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fDb3p-0007c7-8L for qemu-devel@nongnu.org; Tue, 01 May 2018 15:35:37 -0400 From: Cleber Rosa References: <20180419164642.9536-1-f4bug@amsat.org> <20180419164642.9536-4-f4bug@amsat.org> <46d433c0-eddd-03c8-d695-c30cd1ffd1e7@redhat.com> Message-ID: Date: Tue, 1 May 2018 15:35:24 -0400 MIME-Version: 1.0 In-Reply-To: <46d433c0-eddd-03c8-d695-c30cd1ffd1e7@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Subject: Re: [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?Philippe_Mathieu-Daud=c3=a9?= , =?UTF-8?B?THVrw6HFoSBEb2t0b3I=?= , Amador Pahim , Stefan Hajnoczi , Zheng Xiang Cc: qemu-devel@nongnu.org, =?UTF-8?Q?Alex_Benn=c3=a9e?= , Fam Zheng , Alistair Francis , Eduardo Habkost On 05/01/2018 03:30 PM, Cleber Rosa wrote: >=20 >=20 > On 04/19/2018 12:46 PM, Philippe Mathieu-Daud=C3=A9 wrote: >> Signed-off-by: Philippe Mathieu-Daud=C3=A9 >> --- >> 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 [] >> =20 >> + device =3D '{dev_type},chardev=3Dconsole' >> + if '86' in self._arch: >> + device =3D device.format(dev_type=3D'isa-serial') >> + elif 'ppc' in self._arch: >> + device =3D device.format(dev_type=3D'spapr-vty') >> + elif 's390x' in self._arch: >> + device =3D device.format(dev_type=3D'sclpconsole') >> + else: >> + return [] >> + >> chardev =3D 'socket,id=3Dconsole,{address},server,nowait' >> if console_address is None: >> console_address =3D tempfile.mktemp() >> @@ -203,16 +213,6 @@ class QEMUMachine(object): >> =20 >> self._console_address =3D console_address >> =20 >> - device =3D '{dev_type},chardev=3Dconsole' >> - if '86' in self._arch: >> - device =3D device.format(dev_type=3D'isa-serial') >> - elif 'ppc' in self._arch: >> - device =3D device.format(dev_type=3D'spapr-vty') >> - elif 's390x' in self._arch: >> - device =3D device.format(dev_type=3D'sclpconsole') >> - else: >> - return [] >> - >> return ['-chardev', chardev, >> '-device', device] >> =20 >> >=20 > I understand your point here, but I found the commit message to be > misleading. You're probably referring to this snippet (from > tests/avocado/test_linux-boot-console.py): >=20 > + def setUp(self): > + self.console_path =3D tempfile.mkstemp()[1] >=20 > So I see the following points regarding this patch: >=20 > 1) Function called is mkstemp(), and not mktemp(), assuming you meant > the one from the pasted snippet above. >=20 > 2) The commit message should just state that it returns earlier when > architecture is not supported wrt console creation. >=20 Never mind these previous comments. I was looking at a tree with the next set of patches applied and missed the mktemp() here. Acked-by: Cleber Rosa