From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MbJVL-00032w-Cc for qemu-devel@nongnu.org; Wed, 12 Aug 2009 15:28:59 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MbJVG-00031K-41 for qemu-devel@nongnu.org; Wed, 12 Aug 2009 15:28:58 -0400 Received: from [199.232.76.173] (port=53043 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MbJVG-00031H-0R for qemu-devel@nongnu.org; Wed, 12 Aug 2009 15:28:54 -0400 Received: from mx20.gnu.org ([199.232.41.8]:36338) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MbJVF-0000kE-Em for qemu-devel@nongnu.org; Wed, 12 Aug 2009 15:28:53 -0400 Received: from mail.codesourcery.com ([65.74.133.4]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MbJVE-0003vH-DY for qemu-devel@nongnu.org; Wed, 12 Aug 2009 15:28:52 -0400 From: Paul Brook Subject: Re: [Qemu-devel] [PATCH] qdev: add return value to init() callbacks. Date: Wed, 12 Aug 2009 20:28:40 +0100 References: <1250092766-23986-1-git-send-email-kraxel@redhat.com> In-Reply-To: <1250092766-23986-1-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <200908122028.41012.paul@codesourcery.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann > We have already one case in-tree where this is needed: > Try -device virtio-blk-pci (without drive= specified) and watch qemu > segfault. No. Failure of the init routine should be fatal. i.e. virtio_blk_init_pci should call hw_error. If you want to allow graceful failure (which is pointless for commandline options, but may be desirable for hotplug devices) they you need to also add some way of reporting why device creation failure. fprintf(stderr) is just plain wrong. Paul