Received: from eggs.gnu.org ([2001:4830:134:3::10]:39671) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fpdGS-00081S-50 for qemu-devel@nongnu.org; Tue, 14 Aug 2018 13:38:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fpdGC-0004ef-V1 for qemu-devel@nongnu.org; Tue, 14 Aug 2018 13:37:52 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:48538 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 1fpdGC-0004dh-OI for qemu-devel@nongnu.org; Tue, 14 Aug 2018 13:37:36 -0400 References: <20180808210750.3915-1-jusual@mail.ru> <20180808210750.3915-2-jusual@mail.ru> <5a087618-751c-c562-6d41-630a9ced03f4@mail.ru> From: Paolo Bonzini Message-ID: Date: Tue, 14 Aug 2018 19:37:30 +0200 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 v2 1/4] hw/char: Implement nRF51 SoC UART List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , Stefan Hajnoczi Cc: Julia Suvorova , qemu-devel , Stefan Hajnoczi , Joel Stanley , Jim Mussared , =?UTF-8?Q?Steffen_G=c3=b6rtz?= On 14/08/2018 12:02, Peter Maydell wrote: > On 13 August 2018 at 10:47, Stefan Hajnoczi wrote: >> It's an assumption that on-board devices cannot be hot unplugged and >> that the machine type stays alive until QEMU terminates. >> >> Making this assumption saves 1 call to qemu_chr_fe_set_handlers(). >> The cost is that we cannot safely stop the system-on-chip because its >> devices don't clean up properly. >> >> Since cleanup is so trivial here I think it's worthwhile. > I would be more in favour of adding an unrealize function to > random always-present-never-unpluggable devices if we had > better documentation of exactly what the QOM lifecycle is > and what needs to be done in init/realize/unrealize/etc. > As it is, I don't know myself and therefore can't review > whether devices with unrealize methods get it right. And > obviously the code is completely untestable because it can > never run... I agree. Don't bother with unrealize unless the device hot-unpluggable. What matters is that init/finalize are done right but that is tested by device-introspection-test. Paolo