[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] When to use qemu/typedefs.h
From: |
Daniel P . Berrangé |
Subject: |
Re: [Qemu-devel] When to use qemu/typedefs.h |
Date: |
Wed, 31 Jul 2019 11:51:24 +0100 |
User-agent: |
Mutt/1.12.0 (2019-05-25) |
On Wed, Jul 31, 2019 at 11:45:41AM +0100, Peter Maydell wrote:
> On Wed, 31 Jul 2019 at 09:40, Thomas Huth <address@hidden> wrote:
> > IMHO we should get rid of mandating typedefs. They are causing too much
> > trouble - e.g. do you also remember the issues with duplicated typedefs
> > in certain compiler versions in the past? (these should be hopefully
> > gone now, but still...)
> >
> > And many QEMU developers are also working on the Linux kernel, which
> > rather forbids typedefs. Having to switch your mind back and forth
> > whether to use typedefs or not is really annoying.
>
> I would rather keep typedefs -- it's one of the style issues we're
> reasonably consistent with. QEMU isn't the kernel, and its style
> is not the same on many points. If we switch to "use 'struct Foo'"
> we'll have a codebase which becomes rapidly very inconsistent
> about whether we use 'struct' or not.
I tend to agree - while people may work on kernel code, plenty do not
work on kernel code & QEMU is not following kernel code pratices more
generally. I think it is more compelling to align with glib given that
it is a core part of QEMU codebase. I'd much rather QEMU more closely
align with glib and increasingly drop stuff that QEMU has reinvented
in favour of using GLib features. For example I could see GObject as
a base for QOM in future, and typedefs are a normal practice in this
case.
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
- [Qemu-devel] When to use qemu/typedefs.h (was: [PATCH 23/28] numa: Don't include hw/boards.h into sysemu/numa.h), (continued)
- [Qemu-devel] When to use qemu/typedefs.h (was: [PATCH 23/28] numa: Don't include hw/boards.h into sysemu/numa.h), Markus Armbruster, 2019/07/30
- Re: [Qemu-devel] When to use qemu/typedefs.h (was: [PATCH 23/28] numa: Don't include hw/boards.h into sysemu/numa.h), Eric Blake, 2019/07/30
- Re: [Qemu-devel] When to use qemu/typedefs.h (was: [PATCH 23/28] numa: Don't include hw/boards.h into sysemu/numa.h), Paolo Bonzini, 2019/07/30
- [Qemu-devel] [RFC] HACKING: Document 'struct' keyword usage, Eduardo Habkost, 2019/07/30
- Re: [Qemu-devel] [RFC] HACKING: Document 'struct' keyword usage, Eric Blake, 2019/07/30
- Re: [Qemu-devel] [RFC] HACKING: Document 'struct' keyword usage, Thomas Huth, 2019/07/31
- Re: [Qemu-devel] When to use qemu/typedefs.h, Markus Armbruster, 2019/07/31
- Re: [Qemu-devel] When to use qemu/typedefs.h, Paolo Bonzini, 2019/07/31
- Re: [Qemu-devel] When to use qemu/typedefs.h, Thomas Huth, 2019/07/31
- Re: [Qemu-devel] When to use qemu/typedefs.h, Peter Maydell, 2019/07/31
- Re: [Qemu-devel] When to use qemu/typedefs.h,
Daniel P . Berrangé <=
- Re: [Qemu-devel] When to use qemu/typedefs.h (was: [PATCH 23/28] numa: Don't include hw/boards.h into sysemu/numa.h), Eduardo Habkost, 2019/07/30
[Qemu-devel] [PATCH 07/28] trace: Do not include qom/cpu.h into generated trace.h, Markus Armbruster, 2019/07/26
[Qemu-devel] [PATCH 08/28] Include sysemu/reset.h a lot less, Markus Armbruster, 2019/07/26
[Qemu-devel] [PATCH 15/28] Include migration/vmstate.h less, Markus Armbruster, 2019/07/26
[Qemu-devel] [PATCH 19/28] Include qemu/queue.h slightly less, Markus Armbruster, 2019/07/26
[Qemu-devel] [PATCH 01/28] include: Make headers more self-contained, Markus Armbruster, 2019/07/26