[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCHv9 1/3] fw_cfg: switch fw_cfg_find() to locate th
From: |
Igor Mammedov |
Subject: |
Re: [Qemu-devel] [PATCHv9 1/3] fw_cfg: switch fw_cfg_find() to locate the fw_cfg device by type rather than path |
Date: |
Fri, 14 Jul 2017 17:53:50 +0200 |
On Fri, 14 Jul 2017 10:40:06 +0100
Mark Cave-Ayland <address@hidden> wrote:
> This will enable the fw_cfg device to be placed anywhere within the QOM tree
> regardless of its machine location.
>
> Note that we also add a comment to document the behaviour that we return NULL
> to
> indicate failure where either no fw_cfg device or multiple fw_cfg devices are
> found.
>
> Signed-off-by: Mark Cave-Ayland <address@hidden>
Reviewed-by: Igor Mammedov <address@hidden>
> ---
> hw/nvram/fw_cfg.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
> index 99bdbc2..ac52b50 100644
> --- a/hw/nvram/fw_cfg.c
> +++ b/hw/nvram/fw_cfg.c
> @@ -1017,7 +1017,8 @@ FWCfgState *fw_cfg_init_mem(hwaddr ctl_addr, hwaddr
> data_addr)
>
> FWCfgState *fw_cfg_find(void)
> {
> - return FW_CFG(object_resolve_path(FW_CFG_PATH, NULL));
> + /* Returns NULL unless there is exactly one fw_cfg device */
> + return FW_CFG(object_resolve_path_type("", TYPE_FW_CFG, NULL));
> }
>
> static void fw_cfg_class_init(ObjectClass *klass, void *data)
- [Qemu-devel] [PATCHv9 0/3] fw_cfg: qdev-related tidy-ups, Mark Cave-Ayland, 2017/07/14
- [Qemu-devel] [PATCHv9 1/3] fw_cfg: switch fw_cfg_find() to locate the fw_cfg device by type rather than path, Mark Cave-Ayland, 2017/07/14
- [Qemu-devel] [PATCHv9 2/3] fw_cfg: move qdev_init_nofail() from fw_cfg_init1() to callers, Mark Cave-Ayland, 2017/07/14
- [Qemu-devel] [PATCHv9 3/3] fw_cfg: move QOM type defines and fw_cfg types into fw_cfg.h, Mark Cave-Ayland, 2017/07/14
- Re: [Qemu-devel] [PATCHv9 3/3] fw_cfg: move QOM type defines and fw_cfg types into fw_cfg.h, Eduardo Habkost, 2017/07/14
- Re: [Qemu-devel] [PATCHv9 3/3] fw_cfg: move QOM type defines and fw_cfg types into fw_cfg.h, Laszlo Ersek, 2017/07/14
- Re: [Qemu-devel] [PATCHv9 3/3] fw_cfg: move QOM type defines and fw_cfg types into fw_cfg.h, Eduardo Habkost, 2017/07/14
- Re: [Qemu-devel] [PATCHv9 3/3] fw_cfg: move QOM type defines and fw_cfg types into fw_cfg.h, Mark Cave-Ayland, 2017/07/16
- Re: [Qemu-devel] [PATCHv9 3/3] fw_cfg: move QOM type defines and fw_cfg types into fw_cfg.h, Igor Mammedov, 2017/07/17
- Re: [Qemu-devel] [PATCHv9 3/3] fw_cfg: move QOM type defines and fw_cfg types into fw_cfg.h, Eduardo Habkost, 2017/07/17