qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] i440fx: implement reset


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH] i440fx: implement reset
Date: Wed, 20 Feb 2013 19:20:27 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130105 Thunderbird/17.0.2

Am 20.02.2013 19:04, schrieb David Woodhouse:
> On Wed, 2013-02-20 at 18:42 +0100, Andreas Färber wrote:
>>
>>     PCII440FXState *d = I440FX_PCI_WHATEVER_CAST_MACRO_NAME(dev);
> 
> Yeah, that's the easy bit. The bit that I'm vaguely confused by would be
> something like
> 
> #define I440FX_PCI_WHATEVER_CAST_MACRO_NAME(obj) \
>     OBJECT_CHECK(PCII440FXState, (obj), "i440FX") 
> 
> Where that "i440FX" should probably be turned into a macro of its own?

Yes, a #define TYPE_SOMETHING_THAT_MAKES_SENSE "i440FX" a line above and
then use .name = TYPE_..., in the TypeInfo as well.

With proper names in both places obviously. :)

> And then all the *existing* uses of DO_UPCAST should be fixed to use it
> too? Such as in i440fx_write_config() ?

Outside the scope of this patch.

But if you're feeling like contributing, then generally there will be
uses to review and convert, yes. Every rule has its exceptions like hot
paths such as timers, interrupts and read/write, which usually just do
MyType *s = opaque;, but instance_init, initfn, (un)realize and reset
are clear candidates.

Cheers,
Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

[Prev in Thread] Current Thread [Next in Thread]