qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: jan.kiszka@siemens.com, mtosatti@redhat.com, avi@redhat.com,
	kvm@vger.kernel.org
Subject: [Qemu-devel] [PATCH 5/3] ioapic: unify reset callbacks
Date: Tue, 30 Oct 2012 13:16:34 +0100	[thread overview]
Message-ID: <1351599394-24876-6-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1351599394-24876-1-git-send-email-pbonzini@redhat.com>

The reset callback of the in-kernel ioapic has to update the kernel
state.  This can be done for all "models" using ioapic_put.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/ioapic.c          |    2 --
 hw/ioapic_common.c   |    2 ++
 hw/ioapic_internal.h |    2 --
 hw/kvm/ioapic.c      |    9 ---------
 4 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/hw/ioapic.c b/hw/ioapic.c
index 7273095..c9f5993 100644
--- a/hw/ioapic.c
+++ b/hw/ioapic.c
@@ -238,10 +238,8 @@ static void ioapic_init(IOAPICCommonState *s, int instance_no)
 static void ioapic_class_init(ObjectClass *klass, void *data)
 {
     IOAPICCommonClass *k = IOAPIC_COMMON_CLASS(klass);
-    DeviceClass *dc = DEVICE_CLASS(klass);
 
     k->init = ioapic_init;
-    dc->reset = ioapic_reset_common;
 }
 
 static TypeInfo ioapic_info = {
diff --git a/hw/ioapic_common.c b/hw/ioapic_common.c
index 1f3ea37..37715ab 100644
--- a/hw/ioapic_common.c
+++ b/hw/ioapic_common.c
@@ -52,6 +52,7 @@ static void ioapic_reset_common(DeviceState *dev)
     for (i = 0; i < IOAPIC_NUM_PINS; i++) {
         s->ioredtbl[i] = 1 << IOAPIC_LVT_MASKED_SHIFT;
     }
+    ioapic_put(s);
 }
 
 static void ioapic_pre_save(void *opaque)
@@ -109,6 +110,7 @@ static void ioapic_common_class_init(ObjectClass *klass, void *data)
     DeviceClass *dc = DEVICE_CLASS(klass);
 
     sc->init = ioapic_init_common;
+    dc->reset = ioapic_reset_common;
     dc->vmsd = &vmstate_ioapic_common;
     dc->no_user = 1;
 }
diff --git a/hw/ioapic_internal.h b/hw/ioapic_internal.h
index 7311ad0..f8861a2 100644
--- a/hw/ioapic_internal.h
+++ b/hw/ioapic_internal.h
@@ -97,6 +97,4 @@ struct IOAPICCommonState {
     uint64_t ioredtbl[IOAPIC_NUM_PINS];
 };
 
-void ioapic_reset_common(DeviceState *dev);
-
 #endif /* !QEMU_IOAPIC_INTERNAL_H */
diff --git a/hw/kvm/ioapic.c b/hw/kvm/ioapic.c
index 03cb36c..41cfa08 100644
--- a/hw/kvm/ioapic.c
+++ b/hw/kvm/ioapic.c
@@ -69,14 +69,6 @@ static void kvm_ioapic_put(IOAPICCommonState *s)
     }
 }
 
-static void kvm_ioapic_reset(DeviceState *dev)
-{
-    IOAPICCommonState *s = DO_UPCAST(IOAPICCommonState, busdev.qdev, dev);
-
-    ioapic_reset_common(dev);
-    kvm_ioapic_put(s);
-}
-
 static void kvm_ioapic_set_irq(void *opaque, int irq, int level)
 {
     KVMIOAPICState *s = opaque;
@@ -106,7 +98,6 @@ static void kvm_ioapic_class_init(ObjectClass *klass, void *data)
     k->init      = kvm_ioapic_init;
     k->get       = kvm_ioapic_get;
     k->put       = kvm_ioapic_put;
-    dc->reset    = kvm_ioapic_reset;
     dc->props    = kvm_ioapic_properties;
 }
 
-- 
1.7.1

  parent reply	other threads:[~2012-10-30 12:17 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-30 12:16 [Qemu-devel] [PATCH uq/master 0/3] Fix MSI injection at load time Paolo Bonzini
2012-10-30 12:16 ` [Qemu-devel] [PATCH 1/3] kvm: move KVM_GET_LAPIC/KVM_SET_LAPIC to hw/kvm/apic.c Paolo Bonzini
2012-10-30 18:13   ` Jan Kiszka
2012-10-30 12:16 ` [Qemu-devel] [PATCH 2/3] apic: add get/put methods Paolo Bonzini
2012-10-30 18:17   ` Jan Kiszka
2012-10-30 12:16 ` [Qemu-devel] [PATCH 3/3] apic: always update the in-kernel status after loading Paolo Bonzini
2012-10-30 12:38   ` Avi Kivity
2012-10-30 14:16     ` Paolo Bonzini
2012-10-30 18:21       ` Jan Kiszka
2012-11-02 14:53         ` Paolo Bonzini
2012-11-02 14:59           ` Jan Kiszka
2012-11-02 15:07             ` Gerd Hoffmann
2012-11-02 15:13               ` Paolo Bonzini
2012-11-02 15:17                 ` Gerd Hoffmann
2012-11-02 15:21                   ` Paolo Bonzini
2012-10-30 18:17   ` Jan Kiszka
2012-10-30 12:16 ` [Qemu-devel] [PATCH 4/3] ioapic: change pre_save/post_load methods to get/put Paolo Bonzini
2012-10-30 18:18   ` Jan Kiszka
2012-10-30 12:16 ` Paolo Bonzini [this message]
2012-10-30 16:47 ` [Qemu-devel] [PATCH uq/master 0/3] Fix MSI injection at load time Paolo Bonzini
2012-10-30 18:22   ` Jan Kiszka

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=1351599394-24876-6-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=avi@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@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).