From patchwork Tue Jun 4 08:08:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 248491 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id F13D32C00A7 for ; Tue, 4 Jun 2013 18:12:31 +1000 (EST) Received: from localhost ([::1]:39441 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjmM1-0003nN-Ey for incoming@patchwork.ozlabs.org; Tue, 04 Jun 2013 04:12:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44359) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjmHK-000696-AI for qemu-devel@nongnu.org; Tue, 04 Jun 2013 04:07:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UjmHF-0007f1-7f for qemu-devel@nongnu.org; Tue, 04 Jun 2013 04:07:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:4975) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjmHE-0007ej-Vl for qemu-devel@nongnu.org; Tue, 04 Jun 2013 04:07:33 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r5487WMo006347 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 4 Jun 2013 04:07:32 -0400 Received: from redhat.com (vpn-203-14.tlv.redhat.com [10.35.203.14]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id r5487U6I030193 for ; Tue, 4 Jun 2013 04:07:31 -0400 Date: Tue, 4 Jun 2013 11:08:05 +0300 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1370202787-3712-9-git-send-email-mst@redhat.com> References: <1370202787-3712-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1370202787-3712-1-git-send-email-mst@redhat.com> X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 8/9] fw_cfg: fw_cfg is a singleton X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@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);