qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: qemu-devel@nongnu.org
Cc: "Alexey Kardashevskiy" <aik@ozlabs.ru>,
	qemu-ppc@nongnu.org, "Alexander Graf" <agraf@suse.de>,
	"Andreas Färber" <afaerber@suse.de>
Subject: [Qemu-devel] [PATCH 4/8] xics: add pre_load() hook to ICSStateClass
Date: Fri, 14 Mar 2014 15:18:05 +1100	[thread overview]
Message-ID: <1394770689-29039-5-git-send-email-aik@ozlabs.ru> (raw)
In-Reply-To: <1394770689-29039-1-git-send-email-aik@ozlabs.ru>

This adds a hook which will be used to reset ICS state before incoming
migration.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
 hw/intc/xics.c        | 13 +++++++++++++
 include/hw/ppc/xics.h |  1 +
 2 files changed, 14 insertions(+)

diff --git a/hw/intc/xics.c b/hw/intc/xics.c
index 88ef9ef..39c33bc 100644
--- a/hw/intc/xics.c
+++ b/hw/intc/xics.c
@@ -550,6 +550,18 @@ static void ics_dispatch_pre_save(void *opaque)
     }
 }
 
+static int ics_dispatch_pre_load(void *opaque)
+{
+    ICSState *ics = opaque;
+    ICSStateClass *info = ICS_GET_CLASS(ics);
+
+    if (info->pre_load) {
+        return info->pre_load(ics);
+    }
+
+    return 0;
+}
+
 static int ics_dispatch_post_load(void *opaque, int version_id)
 {
     ICSState *ics = opaque;
@@ -582,6 +594,7 @@ static const VMStateDescription vmstate_ics = {
     .minimum_version_id = 1,
     .minimum_version_id_old = 1,
     .pre_save = ics_dispatch_pre_save,
+    .pre_load = ics_dispatch_pre_load,
     .post_load = ics_dispatch_post_load,
     .fields      = (VMStateField []) {
         /* Sanity check */
diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h
index 02bbe31..4b30e9a 100644
--- a/include/hw/ppc/xics.h
+++ b/include/hw/ppc/xics.h
@@ -126,6 +126,7 @@ struct ICSStateClass {
     DeviceClass parent_class;
 
     void (*pre_save)(ICSState *s);
+    int (*pre_load)(ICSState *s);
     int (*post_load)(ICSState *s, int version_id);
 };
 
-- 
1.8.4.rc4

  parent reply	other threads:[~2014-03-14  4:18 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-14  4:18 [Qemu-devel] [PATCH 0/8] spapr: fix IOMMU and XICS/IRQs migration Alexey Kardashevskiy
2014-03-14  4:18 ` [Qemu-devel] [PATCH 1/8] spapr-iommu: add a bus for spapr-iommu devices Alexey Kardashevskiy
2014-04-10 12:40   ` Alexander Graf
2014-04-10 14:40     ` Alexey Kardashevskiy
2014-04-10 14:52       ` Andreas Färber
2014-04-10 15:18         ` Alexey Kardashevskiy
2014-03-14  4:18 ` [Qemu-devel] [PATCH 2/8] xics: add flags for interrupts Alexey Kardashevskiy
2014-04-10 12:43   ` Alexander Graf
2014-03-14  4:18 ` [Qemu-devel] [PATCH 3/8] xics: add find_server Alexey Kardashevskiy
2014-03-14  4:18 ` Alexey Kardashevskiy [this message]
2014-03-14  4:18 ` [Qemu-devel] [PATCH 5/8] xics: disable flags reset on xics reset Alexey Kardashevskiy
2014-03-14  4:18 ` [Qemu-devel] [PATCH 6/8] spapr: move interrupt allocator to xics Alexey Kardashevskiy
2014-04-10 12:51   ` Alexander Graf
2014-04-10 13:24     ` Alexey Kardashevskiy
2014-04-10 13:26       ` Alexander Graf
2014-04-10 14:43         ` Alexey Kardashevskiy
2014-04-11  9:24           ` Alexander Graf
2014-04-11 12:38             ` Alexey Kardashevskiy
2014-04-11 13:58               ` Alexander Graf
2014-04-11 14:50                 ` Alexey Kardashevskiy
2014-04-11 14:58                   ` Alexander Graf
2014-04-11 15:27                     ` Alexey Kardashevskiy
2014-04-11 15:38                       ` Alexander Graf
2014-04-11 16:01                         ` Alexey Kardashevskiy
2014-04-11 16:15                           ` Alexander Graf
2014-04-11 16:30                             ` Alexey Kardashevskiy
2014-03-14  4:18 ` [Qemu-devel] [PATCH 7/8] spapr: remove @next_irq Alexey Kardashevskiy
2014-03-14  7:19   ` Thomas Huth
2014-03-14  4:18 ` [Qemu-devel] [PATCH 8/8] xics: enable interrupt configuration reset on migration Alexey Kardashevskiy
2014-04-10 12:55   ` Alexander Graf
2014-03-20  1:25 ` [Qemu-devel] [PATCH 0/8] spapr: fix IOMMU and XICS/IRQs migration Andreas Färber
2014-04-04  5:53 ` Alexey Kardashevskiy
2014-05-04 13:56 ` Alexey Kardashevskiy
2014-05-04 21:52   ` Paolo Bonzini
2014-05-04 23:48     ` Alexey Kardashevskiy

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=1394770689-29039-5-git-send-email-aik@ozlabs.ru \
    --to=aik@ozlabs.ru \
    --cc=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@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).