From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36085) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fAhRp-0001uW-Ei for qemu-devel@nongnu.org; Mon, 23 Apr 2018 15:48:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fAhRk-0000G1-J3 for qemu-devel@nongnu.org; Mon, 23 Apr 2018 15:48:25 -0400 Date: Mon, 23 Apr 2018 16:47:51 -0300 From: Eduardo Habkost Message-ID: <20180423194751.GQ29865@localhost.localdomain> References: <20180420181951.7252-1-ehabkost@redhat.com> <20180420181951.7252-2-ehabkost@redhat.com> <20180420195625.GF29865@localhost.localdomain> <96915f39-e4d4-6bf4-add7-6006107ddbb3@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <96915f39-e4d4-6bf4-add7-6006107ddbb3@redhat.com> Subject: Re: [Qemu-devel] [RFC 01/24] qemu.py: Introduce _create_console() method List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Huth Cc: qemu-devel@nongnu.org, =?utf-8?B?THVrw6HFoQ==?= Doktor , Fam Zheng , Stefan Hajnoczi , Amador Pahim , Cleber Rosa , Alistair Francis , Qemu-s390x list On Mon, Apr 23, 2018 at 05:26:13AM +0200, Thomas Huth wrote: > On 20.04.2018 21:56, Eduardo Habkost wrote: > > On Fri, Apr 20, 2018 at 03:19:28PM -0300, Eduardo Habkost wrote: > >> From: Amador Pahim > >> > >> This patch adds the QEMUMachine._create_console() method, which > >> returns a list with the chardev console device arguments to be > >> used in the qemu command line. > >> > >> Signed-off-by: Amador Pahim > >> [ehabkost: reword commit message] > >> Signed-off-by: Eduardo Habkost > >> --- > >> scripts/qemu.py | 49 ++++++++++++++++++++++++++++++++++++++++++++----- > >> 1 file changed, 44 insertions(+), 5 deletions(-) > >> > >> diff --git a/scripts/qemu.py b/scripts/qemu.py > >> index 08a3e9af5a..9e9d502543 100644 > >> --- a/scripts/qemu.py > >> +++ b/scripts/qemu.py > >> @@ -55,7 +55,7 @@ class QEMUMachine(object): > [...] > >> + chardev = 'socket,id=console,{address},server,nowait' > >> + if console_address is None: > >> + console_address = tempfile.mktemp() > >> + chardev = chardev.format(address='path=%s' % > >> + console_address) > >> + elif isinstance(console_address, tuple): > >> + chardev = chardev.format(address='host=%s,port=%s' % > >> + (console_address[0], > >> + console_address[1])) > >> + else: > >> + chardev = chardev.format(address='path=%s' % console_address) > >> + > >> + 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') > > > > Why do we need this? Why isn't -serial enough? > > AFAIK, at least on s390x, -serial is not implemented and you need to > specify a sclpconsole device. It sounds like it would be useful if it did implement it. Does anybody see any drawbacks? -- Eduardo