qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PULL 20/21] Revert use of DEFINE_MACHINE() for registr


From: Eduardo Habkost
Subject: Re: [Qemu-devel] [PULL 20/21] Revert use of DEFINE_MACHINE() for registrations of multiple machines
Date: Mon, 21 Sep 2015 14:24:51 -0300
User-agent: Mutt/1.5.23 (2014-03-12)

On Mon, Sep 21, 2015 at 05:52:47PM +0200, Andreas Färber wrote:
> Am 21.09.2015 um 17:49 schrieb Eduardo Habkost:
> > On Sat, Sep 19, 2015 at 04:43:29PM +0200, Andreas Färber wrote:
> >> The script used for converting from QEMUMachine had used one
> >> DEFINE_MACHINE() per machine registered. In cases where multiple
> >> machines are registered from one source file, avoid the excessive
> >> generation of module init functions by reverting this unrolling.
> > 
> > Why is that a problem?
> 
> It's unnecessary code bloat and it blocks the usual QOM patterns. See
> the follow-up series for an example where an abstract base type helps,
> which your macro does not allow.

Do you have any numbers on the actual bloat impact? Personally, I
think the reduction of boilerplate code is worth the extra bytes
in the binary. Files that register lots of simple machine classes
are exactly the use case I had in mind when adding the macro.

About the cases where an abstract base type helps, I agree
DEFINE_MACHINE isn't appropriate, but in those cases I would use
a macro like DEFINE_PC_MACHINE to reduce boilerplate code anyway.

But I don't mind too much either way: if the maintainer of the
corresponding machine code prefers to not reduce boilerplate code
using a macro, that's OK to me. I am happy now that QEMUMachine
is gone.

-- 
Eduardo



reply via email to

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