From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Greg Kurz <groug@kaod.org>
Cc: Peter Maydell <peter.maydell@linaro.org>,
Thomas Huth <thuth@redhat.com>,
QEMU Trivial <qemu-trivial@nongnu.org>,
QEMU Developers <qemu-devel@nongnu.org>,
Juan Quintela <quintela@redhat.com>
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH] Separate function types from opaque types in include/qemu/typedefs.h
Date: Mon, 26 Jun 2017 10:27:37 +0100 [thread overview]
Message-ID: <20170626092735.GA2136@work-vm> (raw)
In-Reply-To: <20170622212332.38f4b434@bahia.lab.toulouse-stg.fr.ibm.com>
* Greg Kurz (groug@kaod.org) wrote:
> On Thu, 22 Jun 2017 19:34:58 +0100
> "Dr. David Alan Gilbert" <dgilbert@redhat.com> wrote:
>
> > * Peter Maydell (peter.maydell@linaro.org) wrote:
> > > On 22 June 2017 at 19:08, Thomas Huth <thuth@redhat.com> wrote:
> > > > On 22.06.2017 19:50, Dr. David Alan Gilbert wrote:
> > > >> Could do; I'm just not finding tiny header files with one or
> > > >> two entries each that useful.
> > >
> > > Well, it means that the bulk of code that doesn't care about the
> > > types doesn't get its compilation fractionally slowed by having
> > > to parse the typedef anyway. In general I think we're drifting
> > > towards "have each .c file get fewer things automatically" rather
> > > than otherwise (eg more finely focused files rather than stuffing
> > > everything into qemu-common.h).
> >
> > At the cost of things getting fractionally slower by including lots
> > more tiny headers.
> >
> > I generally agree in the case where there's a useful chunk,
> > but when it's down to one or two definitions I don't see the point.
> >
> > > > Do we really need these function typedefs at all? IMHO it's quite ugly
> > > > to hide such things in a typedef unless it is really necessary (and in
> > > > this case, it does not seem to be really necessary since it is only used
> > > > in a few places). So what about simply removing the typedefs in this case?
> > >
> > > I find function typedefs much more readable than having the
> > > function-types inline in function arguments and the like.
> > >
> > > This is all fairly rapidly heading into bikeshed territory
> > > though -- in the final analysis I don't think it matters
> > > much what we do.
> >
> > Agreed.
> >
>
> Last question for my own comprehension.
>
> I can't think of a case where we would do something like:
>
> some_vmsd->load_state_old = some_se->ops->load_state;
>
> Does it make sense for VMStateDescription::load_state_old and SaveVMHandlers::load_state
> to be of the same type ?
(I think this is what we discussed on irc)
There's only a few _old's and they're the same interface as the
non-_old's, the only difference is the range of version_id's they're
prepared to take.
Dave
> > Dave
> >
> > > thanks
> > > -- PMM
> > --
> > Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
WARNING: multiple messages have this Message-ID (diff)
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Greg Kurz <groug@kaod.org>
Cc: Peter Maydell <peter.maydell@linaro.org>,
Thomas Huth <thuth@redhat.com>,
QEMU Trivial <qemu-trivial@nongnu.org>,
QEMU Developers <qemu-devel@nongnu.org>,
Juan Quintela <quintela@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] Separate function types from opaque types in include/qemu/typedefs.h
Date: Mon, 26 Jun 2017 10:27:37 +0100 [thread overview]
Message-ID: <20170626092735.GA2136@work-vm> (raw)
In-Reply-To: <20170622212332.38f4b434@bahia.lab.toulouse-stg.fr.ibm.com>
* Greg Kurz (groug@kaod.org) wrote:
> On Thu, 22 Jun 2017 19:34:58 +0100
> "Dr. David Alan Gilbert" <dgilbert@redhat.com> wrote:
>
> > * Peter Maydell (peter.maydell@linaro.org) wrote:
> > > On 22 June 2017 at 19:08, Thomas Huth <thuth@redhat.com> wrote:
> > > > On 22.06.2017 19:50, Dr. David Alan Gilbert wrote:
> > > >> Could do; I'm just not finding tiny header files with one or
> > > >> two entries each that useful.
> > >
> > > Well, it means that the bulk of code that doesn't care about the
> > > types doesn't get its compilation fractionally slowed by having
> > > to parse the typedef anyway. In general I think we're drifting
> > > towards "have each .c file get fewer things automatically" rather
> > > than otherwise (eg more finely focused files rather than stuffing
> > > everything into qemu-common.h).
> >
> > At the cost of things getting fractionally slower by including lots
> > more tiny headers.
> >
> > I generally agree in the case where there's a useful chunk,
> > but when it's down to one or two definitions I don't see the point.
> >
> > > > Do we really need these function typedefs at all? IMHO it's quite ugly
> > > > to hide such things in a typedef unless it is really necessary (and in
> > > > this case, it does not seem to be really necessary since it is only used
> > > > in a few places). So what about simply removing the typedefs in this case?
> > >
> > > I find function typedefs much more readable than having the
> > > function-types inline in function arguments and the like.
> > >
> > > This is all fairly rapidly heading into bikeshed territory
> > > though -- in the final analysis I don't think it matters
> > > much what we do.
> >
> > Agreed.
> >
>
> Last question for my own comprehension.
>
> I can't think of a case where we would do something like:
>
> some_vmsd->load_state_old = some_se->ops->load_state;
>
> Does it make sense for VMStateDescription::load_state_old and SaveVMHandlers::load_state
> to be of the same type ?
(I think this is what we discussed on irc)
There's only a few _old's and they're the same interface as the
non-_old's, the only difference is the range of version_id's they're
prepared to take.
Dave
> > Dave
> >
> > > thanks
> > > -- PMM
> > --
> > Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
next prev parent reply other threads:[~2017-06-26 9:27 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-22 16:06 [Qemu-trivial] [PATCH] Separate function types from opaque types in include/qemu/typedefs.h Greg Kurz
2017-06-22 16:06 ` [Qemu-devel] " Greg Kurz
2017-06-22 16:14 ` [Qemu-trivial] " Peter Maydell
2017-06-22 16:14 ` Peter Maydell
2017-06-22 16:42 ` [Qemu-trivial] " Greg Kurz
2017-06-22 16:42 ` Greg Kurz
2017-06-22 17:03 ` [Qemu-trivial] " Juan Quintela
2017-06-22 17:03 ` [Qemu-devel] " Juan Quintela
2017-06-22 17:22 ` [Qemu-trivial] " Peter Maydell
2017-06-22 17:22 ` [Qemu-devel] " Peter Maydell
2017-06-22 17:25 ` [Qemu-trivial] " Dr. David Alan Gilbert
2017-06-22 17:25 ` [Qemu-devel] " Dr. David Alan Gilbert
2017-06-22 17:46 ` [Qemu-trivial] " Greg Kurz
2017-06-22 17:46 ` Greg Kurz
2017-06-22 17:50 ` [Qemu-trivial] " Dr. David Alan Gilbert
2017-06-22 17:50 ` Dr. David Alan Gilbert
2017-06-22 18:08 ` [Qemu-trivial] " Thomas Huth
2017-06-22 18:08 ` Thomas Huth
2017-06-22 18:11 ` [Qemu-trivial] " Peter Maydell
2017-06-22 18:11 ` Peter Maydell
2017-06-22 18:34 ` [Qemu-trivial] " Dr. David Alan Gilbert
2017-06-22 18:34 ` Dr. David Alan Gilbert
2017-06-22 19:23 ` [Qemu-trivial] " Greg Kurz
2017-06-22 19:23 ` Greg Kurz
2017-06-26 9:27 ` Dr. David Alan Gilbert [this message]
2017-06-26 9:27 ` Dr. David Alan Gilbert
2017-06-23 7:11 ` [Qemu-trivial] " Markus Armbruster
2017-06-23 7:11 ` Markus Armbruster
2017-06-28 9:32 ` [Qemu-trivial] " Juan Quintela
2017-06-28 9:32 ` [Qemu-devel] " Juan Quintela
2017-06-23 7:04 ` [Qemu-trivial] " Markus Armbruster
2017-06-23 7:04 ` Markus Armbruster
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=20170626092735.GA2136@work-vm \
--to=dgilbert@redhat.com \
--cc=groug@kaod.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=quintela@redhat.com \
--cc=thuth@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.