[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2] migration: discard non-migratable RAMBlocks
From: |
Cédric Le Goater |
Subject: |
Re: [Qemu-devel] [PATCH v2] migration: discard non-migratable RAMBlocks |
Date: |
Fri, 20 Apr 2018 11:05:21 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 |
On 04/20/2018 10:47 AM, Peter Maydell wrote:
> On 20 April 2018 at 07:59, Cédric Le Goater <address@hidden> wrote:
>> Hello David,
>>
>> On 04/19/2018 06:58 PM, Dr. David Alan Gilbert wrote:
>>> * Cédric Le Goater (address@hidden) wrote:
>>>> @@ -1823,6 +1831,7 @@ void qemu_ram_set_idstr(RAMBlock *new_block, const
>>>> char *name, DeviceState *dev)
>>>> }
>>>> }
>>>> pstrcat(new_block->idstr, sizeof(new_block->idstr), name);
>>>> + new_block->flags |= RAM_MIGRATABLE;
>>>>
>>>> rcu_read_lock();
>>>> RAMBLOCK_FOREACH(block) {
>>>> @@ -1845,6 +1854,7 @@ void qemu_ram_unset_idstr(RAMBlock *block)
>>>> */
>>>> if (block) {
>>>> memset(block->idstr, 0, sizeof(block->idstr));
>>>> + block->flags &= ~RAM_MIGRATABLE;
>>>> }
>>>> }
>>>
>>> Why in qemu_ram_set_idstr and qemu_ram_(un)set_idstr ? It seems an
>>> odd place to put them.
>>
>> The only place where this routines are called is from
>> vmstate_un/register_ram()
>> It seemed unnecessary to add an extra interface qemu_ram_un/set_migratable().
>
> Why not set the flags in vmstate_{register,unregister}_ram() ?
because the RAM flags are not exposed outside exec.c so it would
require some qemu_ram_un/set_migratable() helpers like this is done
for RAM_UF_ZEROPAGE. That is possible of course.
C.
Re: [Qemu-devel] [PATCH v2] migration: discard non-migratable RAMBlocks, Peter Maydell, 2018/04/20