[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH qom-cpu v2 3/8] cpu: Register VMStateDescription
From: |
Andreas Färber |
Subject: |
Re: [Qemu-devel] [PATCH qom-cpu v2 3/8] cpu: Register VMStateDescription through CPUState |
Date: |
Mon, 18 Feb 2013 21:02:55 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130105 Thunderbird/17.0.2 |
Am 18.02.2013 20:57, schrieb Eduardo Habkost:
> On Mon, Feb 18, 2013 at 08:42:28PM +0100, Andreas Färber wrote:
>> In comparison to DeviceClass::vmsd, CPU VMState is split in two,
>> "cpu_common" and "cpu", and uses cpu_index as instance_id instead of -1.
>> Therefore add a CPU-specific CPUClass::vmsd field.
>>
>> Unlike the legacy CPUArchState registration, rather register CPUState.
>>
>> Signed-off-by: Juan Quintela <address@hidden>
>> Signed-off-by: Andreas Färber <address@hidden>
>> ---
> [...]
>> @@ -266,6 +268,7 @@ CPUState *qemu_get_cpu(int index)
>> void cpu_exec_init(CPUArchState *env)
>> {
>> CPUState *cpu = ENV_GET_CPU(env);
>> + CPUClass *cc = CPU_GET_CLASS(cpu);
>> CPUArchState **penv;
>> int cpu_index;
>>
>> @@ -290,11 +293,15 @@ void cpu_exec_init(CPUArchState *env)
>> #if defined(CONFIG_USER_ONLY)
>> cpu_list_unlock();
>> #endif
>> -#if defined(CPU_SAVE_VERSION) && !defined(CONFIG_USER_ONLY)
>> vmstate_register(NULL, cpu_index, &vmstate_cpu_common, env);
>
> Now vmstate_cpu_common is registered even if CPU_SAVE_VERSION isn't
> defined and cc->vmsd is NULL. Is this intentional?
Kind of, this was adopted from Juan's series. Apart from alpha and
openrisc, which are fixed later in this series, I had taken care to mark
all unmigratable targets as such via dc->vmsd. Thus I don't see any harm
in it. We could go 100% safe and first mark alpha and openrisc as
unmigratable, then do these changes and some patches later drop it again.
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
- Re: [Qemu-devel] [PATCH qom-cpu v2 5/8] target-lm32: Update VMStateDescription to LM32CPU, (continued)
- [Qemu-devel] [RFC qom-cpu v2 6/8] target-alpha: Register VMStateDescription for AlphaCPU, Andreas Färber, 2013/02/18
- [Qemu-devel] [RFC qom-cpu v2 8/8] cpu: Guard cpu_{save, load}() definitions, Andreas Färber, 2013/02/18
- [Qemu-devel] [PATCH qom-cpu v2 4/8] target-i386: Update VMStateDescription to X86CPU, Andreas Färber, 2013/02/18
- [Qemu-devel] [RFC qom-cpu v2 7/8] target-openrisc: Register VMStateDescription for OpenRISCCPU, Andreas Färber, 2013/02/18
- [Qemu-devel] [PATCH qom-cpu v2 3/8] cpu: Register VMStateDescription through CPUState, Andreas Färber, 2013/02/18
- Re: [Qemu-devel] [PATCH qom-cpu v2 3/8] cpu: Register VMStateDescription through CPUState, Juan Quintela, 2013/02/22
- [Qemu-devel] [PATCH qom-cpu v2 2/8] stubs: Add a vmstate_dummy struct for CONFIG_USER_ONLY, Andreas Färber, 2013/02/18