From: "Andreas Färber" <afaerber@suse.de>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: qemu-devel@nongnu.org, quintela@redhat.com
Subject: Re: [Qemu-devel] [PATCH qom-cpu v3 4/6] cpu: Introduce cpu_class_set_vmsd()
Date: Tue, 05 Mar 2013 18:10:53 +0100 [thread overview]
Message-ID: <5136271D.5060104@suse.de> (raw)
In-Reply-To: <20130226193203.GC32578@otherpad.lan.raisama.net>
Am 26.02.2013 20:32, schrieb Eduardo Habkost:
> 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 <quintela@redhat.com>
>> Signed-off-by: Andreas Färber <afaerber@suse.de>
>> ---
>> 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.
Done. I also renamed the arguments to match those of the function.
>
> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Thanks,
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
next parent reply other threads:[~2013-03-05 17:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1361816570-8707-1-git-send-email-afaerber@suse.de>
[not found] ` <1361816570-8707-5-git-send-email-afaerber@suse.de>
[not found] ` <20130226193203.GC32578@otherpad.lan.raisama.net>
2013-03-05 17:10 ` Andreas Färber [this message]
2013-03-05 18:21 ` [Qemu-devel] [PATCH qom-cpu v3 0/6] QOM CPUState VMStateDescriptions Andreas Färber
[not found] ` <1361816570-8707-7-git-send-email-afaerber@suse.de>
2013-03-05 23:48 ` [Qemu-devel] [PATCH qom-cpu v3 6/6] target-lm32: Update VMStateDescription to LM32CPU Michael Walle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5136271D.5060104@suse.de \
--to=afaerber@suse.de \
--cc=ehabkost@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).