qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Blue Swirl <blauwirbel@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] provide opaque CPUState to files that are compiled once
Date: Fri, 2 Apr 2010 19:18:04 +0300	[thread overview]
Message-ID: <v2gf43fc5581004020918zd9712e1ekd3991fd2f1f0af88@mail.gmail.com> (raw)
In-Reply-To: <4BB61610.40106@redhat.com>

On 4/2/10, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
>
> >
> > >  qemu-kvm.h references CPUState and includes cpu.h, so with the latest
> > > changes all files that include qemu-kvm.h break, even if they don't
> require
> > > qemu-kvm.h.  With this patch they instead get the opaque definition via
> > > hw/hw.h (which includes cpu-common.h), and qemu-kvm.h can avoid
> including
> > > cpu.h.
> > >
> >
> > This is why I added #ifndef NEED_CPU_H to kvm.h.
> >
>
>  Yes, but adding NEED_CPU_H everywhere is just as bad, or worse.

I fully agree that devices should not use NEED_CPU_H.

> >
> > >  Another example is the new apic.h file created by Blue Swirl.  It
> > > references CPUState.  It includes apic_get_irq_delivered, so I placed
> > > apic_set_irq_delivered there too.  But apic_set_irq_delivered is used by
> > > i8259.c which is compiled once.
> > >
> >
> > But i8259.c is compiled per target, grep Makefile.target?
> >
>
>  Hmm, that was something else, but apic.h was it. :-)

As a concrete example, qemu-kvm's apic.c and ours differ w.r.t.
CPUState use only in kvm_save/load_lapic. But these functions could
just as easily take APICState* as their parameter and the need to pass
CPUState is gone.

  reply	other threads:[~2010-04-02 16:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-02 14:45 [Qemu-devel] [PATCH] provide opaque CPUState to files that are compiled once Paolo Bonzini
2010-04-02 15:22 ` Anthony Liguori
2010-04-02 15:43   ` Paolo Bonzini
2010-04-02 16:05     ` Blue Swirl
2010-04-02 16:06       ` Paolo Bonzini
2010-04-02 16:18         ` Blue Swirl [this message]
2010-04-02 16:24     ` Anthony Liguori
2010-04-02 16:43       ` Paolo Bonzini
2010-04-02 17:36         ` Anthony Liguori
2010-04-02 17:46           ` Paolo Bonzini
2010-04-02 17:49             ` Anthony Liguori

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=v2gf43fc5581004020918zd9712e1ekd3991fd2f1f0af88@mail.gmail.com \
    --to=blauwirbel@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).