[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/3] pvpanic: use FWCfgState explicitly
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 1/3] pvpanic: use FWCfgState explicitly |
Date: |
Thu, 30 May 2013 18:01:55 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6 |
Il 30/05/2013 18:03, Laszlo Ersek ha scritto:
> On 05/30/13 17:05, Laszlo Ersek wrote:
>> On 05/30/13 15:27, Michael S. Tsirkin wrote:
>>> Use the type-safe FWCfgState structure instead
>>> of the unsafe void *.
>>>
>>> Signed-off-by: Michael S. Tsirkin <address@hidden>
>>> ---
>>> hw/misc/pvpanic.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/hw/misc/pvpanic.c b/hw/misc/pvpanic.c
>>> index 31e1b1d..1483f27 100644
>>> --- a/hw/misc/pvpanic.c
>>> +++ b/hw/misc/pvpanic.c
>>> @@ -90,7 +90,7 @@ static int pvpanic_isa_initfn(ISADevice *dev)
>>> {
>>> PVPanicState *s = ISA_PVPANIC_DEVICE(dev);
>>> static bool port_configured;
>>> - void *fw_cfg;
>>> + FWCfgState *fw_cfg;
>>>
>>> memory_region_init_io(&s->io, &pvpanic_ops, s, "pvpanic", 1);
>>> isa_register_ioport(dev, &s->io, s->ioport);
>>>
>>
>> Doesn't this break your build? Lower down in the function there's
>>
>> fw_cfg = object_resolve_path("/machine/fw_cfg", NULL);
>>
>> and object_resolve_path() returns a pointer-to-Object, not
>> pointer-to-FWCfgState.
>
> Paolo explained the guts, but don't we still need a downcast here? (No
> idea how to do that nicely in the object model du jour -- maybe
> OBJECT_CHECK() or similar?)
Patch 2 addresses that.
Paolo
[Qemu-devel] [PATCH 3/3] fw_cfg: fw_cfg is a singleton, Michael S. Tsirkin, 2013/05/30
[Qemu-devel] [PATCH 2/3] fw_cfg: add API to find FW cfg object, Michael S. Tsirkin, 2013/05/30
Re: [Qemu-devel] [PATCH 0/3] fw_cfg: misc fixes, Laszlo Ersek, 2013/05/30
Re: [Qemu-devel] [PATCH 0/3] fw_cfg: misc fixes, Hu Tao, 2013/05/30