[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH qom-cpu v3 4/6] cpu: Introduce cpu_class_set_vms
From: |
Eduardo Habkost |
Subject: |
Re: [Qemu-devel] [PATCH qom-cpu v3 4/6] cpu: Introduce cpu_class_set_vmsd() |
Date: |
Tue, 26 Feb 2013 16:32:03 -0300 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Mon, Feb 25, 2013 at 07:22:48PM +0100, Andreas Färber wrote:
> This setter avoids redefining each VMStateDescription value to
> vmstate_dummy by not referencing the value for CONFIG_USER_ONLY.
>
> Suggested-by: Juan Quintela <address@hidden>
> Signed-off-by: Andreas Färber <address@hidden>
> ---
> include/qom/cpu.h | 17 +++++++++++++++++
> 1 Datei geändert, 17 Zeilen hinzugefügt(+)
>
> diff --git a/include/qom/cpu.h b/include/qom/cpu.h
> index 1106e39..65e24d3 100644
> --- a/include/qom/cpu.h
> +++ b/include/qom/cpu.h
> @@ -135,6 +135,23 @@ void cpu_reset(CPUState *cpu);
> ObjectClass *cpu_class_by_name(const char *typename, const char *cpu_model);
>
> /**
> + * cpu_class_set_vmsd:
> + * @cc: CPU class
> + * @value: Value to set.
> + *
> + * Sets #VMStateDescription for @cc.
> + */
> +#ifndef CONFIG_USER_ONLY
> +static inline void cpu_class_set_vmsd(CPUClass *cc,
> + const struct VMStateDescription *value)
> +{
> + cc->vmsd = value;
> +}
> +#else
> +#define cpu_class_set_vmsd(cpu, val) ((cpu)->vmsd = NULL)
Even after reading the description above, I was going to ask you why
this was not an inline function as well. But then I read patch 5/6 and
understood why. :-)
I would add a coment here noting that "val" is actually expected to be
never evaluated when CONFIG_USER_ONLY is defined.
Reviewed-by: Eduardo Habkost <address@hidden>
> +#endif
> +
> +/**
> * qemu_cpu_has_work:
> * @cpu: The vCPU to check.
> *
> --
> 1.7.10.4
>
--
Eduardo
- [Qemu-devel] [PATCH qom-cpu v3 0/6] QOM CPUState VMStateDescriptions, Andreas Färber, 2013/02/25
- [Qemu-devel] [PATCH qom-cpu v3 3/6] cpu: Register VMStateDescription through CPUState, Andreas Färber, 2013/02/25
- [Qemu-devel] [PATCH qom-cpu v3 6/6] target-lm32: Update VMStateDescription to LM32CPU, Andreas Färber, 2013/02/25
- [Qemu-devel] [PATCH qom-cpu v3 5/6] target-i386: Update VMStateDescription to X86CPU, Andreas Färber, 2013/02/25
- [Qemu-devel] [PATCH qom-cpu v3 2/6] stubs: Add a vmstate_dummy struct for CONFIG_USER_ONLY, Andreas Färber, 2013/02/25
- [Qemu-devel] [PATCH qom-cpu v3 4/6] cpu: Introduce cpu_class_set_vmsd(), Andreas Färber, 2013/02/25
- Re: [Qemu-devel] [PATCH qom-cpu v3 4/6] cpu: Introduce cpu_class_set_vmsd(),
Eduardo Habkost <=
- [Qemu-devel] [PATCH qom-cpu v3 1/6] vmstate: Make vmstate_register() static inline, Andreas Färber, 2013/02/25