[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 0/3] Add new utility function memory_region_allo
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH 0/3] Add new utility function memory_region_allocate_aux_memory() |
Date: |
Thu, 6 Jul 2017 18:47:04 +0100 |
On 6 July 2017 at 18:26, Paolo Bonzini <address@hidden> wrote:
>
>
> On 06/07/2017 19:13, Peter Maydell wrote:
>> Slightly awkward because owner is an Object but vmstate_register_ram()
>> needs a DeviceState. Is this OK, or too much magic?
>>
>> DeviceState *owner_dev;
>> Error *err = NULL;
>>
>> memory_region_init_ram(mr, owner, name, ram_size, &err);
>> if (err) {
>> error_propagate(errp, err);
>> return;
>> }
>> /* Note that owner_dev may be NULL if owner is not a DeviceState;
>> * in that case this is equivalent to calling
>> vmstate_register_ram_global().
>> */
>> owner_dev = object_dynamic_cast(owner, TYPE_DEVICE);
>> vmstate_register_ram(mr, owner_dev);
>
> Maybe, for memory_region_init_ram only, the owner argument can be made a
> DeviceState (or NULL)?
Something that might influence things here -- of the twelve
callers of vmstate_register_ram(), only 6 use an 'owner'
pointer that's the same as the one they use for initializing
the memory region (and 3 of those are using _init_rom or
_init_rom_device rather than init_ram directly).
thanks
-- PMM
- Re: [Qemu-devel] [PATCH 0/3] Add new utility function memory_region_allocate_aux_memory(), (continued)
- Re: [Qemu-devel] [PATCH 0/3] Add new utility function memory_region_allocate_aux_memory(), Peter Maydell, 2017/07/06
- Re: [Qemu-devel] [PATCH 0/3] Add new utility function memory_region_allocate_aux_memory(), Paolo Bonzini, 2017/07/06
- Re: [Qemu-devel] [PATCH 0/3] Add new utility function memory_region_allocate_aux_memory(), Peter Maydell, 2017/07/06
- Re: [Qemu-devel] [PATCH 0/3] Add new utility function memory_region_allocate_aux_memory(), Paolo Bonzini, 2017/07/06
- Re: [Qemu-devel] [PATCH 0/3] Add new utility function memory_region_allocate_aux_memory(), Igor Mammedov, 2017/07/07
- Re: [Qemu-devel] [PATCH 0/3] Add new utility function memory_region_allocate_aux_memory(), Peter Maydell, 2017/07/07
- Re: [Qemu-devel] [PATCH 0/3] Add new utility function memory_region_allocate_aux_memory(), Peter Maydell, 2017/07/17
- Re: [Qemu-devel] [PATCH 0/3] Add new utility function memory_region_allocate_aux_memory(), Igor Mammedov, 2017/07/07
Re: [Qemu-devel] [PATCH 0/3] Add new utility function memory_region_allocate_aux_memory(), Peter Maydell, 2017/07/06
Re: [Qemu-devel] [PATCH 0/3] Add new utility function memory_region_allocate_aux_memory(), Peter Maydell, 2017/07/07
Re: [Qemu-devel] [PATCH 0/3] Add new utility function memory_region_allocate_aux_memory(), Paolo Bonzini, 2017/07/07