Received: from eggs.gnu.org ([2001:4830:134:3::10]:52746) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9X2Q-0003GK-37 for qemu-devel@nongnu.org; Fri, 20 Apr 2018 10:29:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9X2L-00023D-5y for qemu-devel@nongnu.org; Fri, 20 Apr 2018 10:29:22 -0400 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:37933) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9X2L-00022O-0j for qemu-devel@nongnu.org; Fri, 20 Apr 2018 10:29:17 -0400 Received: by mail-qk0-x242.google.com with SMTP id b39so9099324qkb.5 for ; Fri, 20 Apr 2018 07:29:16 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= References: <20180419220914.959-1-f4bug@amsat.org> <20180419220914.959-2-f4bug@amsat.org> Message-ID: Date: Fri, 20 Apr 2018 11:29:12 -0300 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2] hw/isa/superio: Fix inconsistent use of Chardev->be List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Paolo Bonzini , =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , QEMU Developers , "=?UTF-8?Q?Daniel_P_._Berrang=c3=a9?=" , "Michael S. Tsirkin" >>> On 04/20/2018 05:43 AM, Peter Maydell wrote: >>> Since we can now safely call serial_mm_init(..., chr=NULL, ...), I'll >>> work on simplifying and fixing this. >> >> Correct. There are a bunch of dubious workarounds in the >> codebase which try to handle the problem at different levels, >> but we've decided that the right thing is for the NULL pointer >> to be dealt with in one place at the bottom (in the qemu_chr_fe_* >> functions). > > OK, I'll happily clean that :) Hmmm removing the "if (serial_hds[0])" check I reach: void serial_realize_core(SerialState *s, Error **errp) { if (!qemu_chr_fe_backend_connected(&s->chr)) { error_setg(errp, "Can't create serial device, empty char device"); return; }