From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59212) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ui2tK-0002tn-Kt for qemu-devel@nongnu.org; Thu, 30 May 2013 09:27:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ui2tD-0002bU-Uh for qemu-devel@nongnu.org; Thu, 30 May 2013 09:27:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37367) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ui2tD-0002Yl-Kf for qemu-devel@nongnu.org; Thu, 30 May 2013 09:27:35 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4UDRZbu032479 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 30 May 2013 09:27:35 -0400 Received: from redhat.com (vpn-203-5.tlv.redhat.com [10.35.203.5]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id r4UDRXEZ003945 for ; Thu, 30 May 2013 09:27:34 -0400 Date: Thu, 30 May 2013 16:28:03 +0300 From: "Michael S. Tsirkin" Message-ID: <1369920427-18274-4-git-send-email-mst@redhat.com> References: <1369920427-18274-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1369920427-18274-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PATCH 3/3] fw_cfg: fw_cfg is a singleton List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Make sure we only have a single instance ever: because if it isn't we can't find it so it's useless anyway. Signed-off-by: Michael S. Tsirkin --- hw/nvram/fw_cfg.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index df3f089..3c255ce 100644 --- a/hw/nvram/fw_cfg.c +++ b/hw/nvram/fw_cfg.c @@ -496,10 +496,9 @@ FWCfgState *fw_cfg_init(uint32_t ctl_port, uint32_t data_port, s = DO_UPCAST(FWCfgState, busdev.qdev, dev); - if (!object_resolve_path(FW_CFG_PATH, NULL)) { - object_property_add_child(qdev_get_machine(), FW_CFG_NAME, OBJECT(s), - NULL); - } + assert(!object_resolve_path(FW_CFG_PATH, NULL)); + + object_property_add_child(qdev_get_machine(), FW_CFG_NAME, OBJECT(s), NULL); qdev_init_nofail(dev); -- MST