qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCHv7 5/6] fw_cfg: move qdev_init_nofail() from fw_c


From: Mark Cave-Ayland
Subject: Re: [Qemu-devel] [PATCHv7 5/6] fw_cfg: move qdev_init_nofail() from fw_cfg_init1() to callers
Date: Fri, 7 Jul 2017 17:16:26 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

On 07/07/17 15:48, Eduardo Habkost wrote:

>>> I don't see what needs to be fixed.  It is not a bug to leave
>>> fw_cfg in /machine/unattached, as long as fw_cfg_find() works
>>> properly.
>>
>> Yeah. I wonder if I've been leading myself astray down the wrong path
>> here? Let me do some more local tests without
>> fw_cfg_unattached_at_realize() and with an ambiguous argument in
>> fw_cfg_find().
> 
> Note that if you add assert(!ambiguous) to fw_cfg_find(), you
> need to choose what to do when multiple devices are instantiated:
> a) Calling fw_cfg_find() on realize, making it abort instead of
>    returning an error;
> b) Not calling fw_cfg_find() on realize, and returning an error
>    using object_resolve_path_type() manually;
> c) Not calling fw_cfg_find(), not returning an error, and letting
>    QEMU abort when fw_cfg_find() is called by other code.
> 
> I think it's simpler to just do like vmgenid does and simply
> return NULL when there are multiple devices.  We just need to
> document that clearly, and be aware of that when calling
> fw_cfg_find() on realize.  But I won't object if you choose
> another option.

Yes, I agree. I should add that I've been testing without the ambiguous
argument and everything seems to be working now...


ATB,

Mark.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]