diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2013-05-30 16:21:24 +0300 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2013-06-02 18:14:14 +0300 |
commit | cac122103abac633d7b39aac87273bf6d5a37588 (patch) | |
tree | 81ebf543f3f9d28da7f642b4a91099b0c57f0cfe | |
parent | 600c60b76d0682f6c39d19bfff79da9321e8cf86 (diff) | |
download | hqemu-cac122103abac633d7b39aac87273bf6d5a37588.zip hqemu-cac122103abac633d7b39aac87273bf6d5a37588.tar.gz |
fw_cfg: fw_cfg is a singleton
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 <mst@redhat.com>
-rw-r--r-- | hw/nvram/fw_cfg.c | 7 |
1 files 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); |