qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: agraf@suse.de, quintela@redhat.com
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
	David Gibson <david@gibson.dropbear.id.au>
Subject: [Qemu-devel] [PATCH 12/15] pseries: savevm support for PAPR VIO logical lan
Date: Mon, 15 Oct 2012 10:24:39 +1000	[thread overview]
Message-ID: <1350260682-21428-13-git-send-email-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <1350260682-21428-1-git-send-email-david@gibson.dropbear.id.au>

This patch adds the necessary VMStateDescription information to support
savevm/loadvm for the spapr_llan (PAPR logical lan) device.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 hw/spapr_llan.c |   24 ++++++++++++++++++++++--
 hw/spapr_vty.c  |   16 ++++++++++++++++
 2 files changed, 38 insertions(+), 2 deletions(-)

diff --git a/hw/spapr_llan.c b/hw/spapr_llan.c
index bd3f131..cd30df8 100644
--- a/hw/spapr_llan.c
+++ b/hw/spapr_llan.c
@@ -77,9 +77,9 @@ typedef struct VIOsPAPRVLANDevice {
     VIOsPAPRDevice sdev;
     NICConf nicconf;
     NICState *nic;
-    int isopen;
+    bool isopen;
     target_ulong buf_list;
-    int add_buf_ptr, use_buf_ptr, rx_bufs;
+    uint32_t add_buf_ptr, use_buf_ptr, rx_bufs;
     target_ulong rxq_ptr;
 } VIOsPAPRVLANDevice;
 
@@ -486,6 +486,25 @@ static Property spapr_vlan_properties[] = {
     DEFINE_PROP_END_OF_LIST(),
 };
 
+static const VMStateDescription vmstate_spapr_llan = {
+    .name = "spapr_llan",
+    .version_id = 1,
+    .minimum_version_id = 1,
+    .minimum_version_id_old = 1,
+    .fields      = (VMStateField []) {
+        VMSTATE_SPAPR_VIO(sdev, VIOsPAPRVLANDevice),
+        /* LLAN state */
+        VMSTATE_BOOL(isopen, VIOsPAPRVLANDevice),
+        VMSTATE_UINTTL(buf_list, VIOsPAPRVLANDevice),
+        VMSTATE_UINT32(add_buf_ptr, VIOsPAPRVLANDevice),
+        VMSTATE_UINT32(use_buf_ptr, VIOsPAPRVLANDevice),
+        VMSTATE_UINT32(rx_bufs, VIOsPAPRVLANDevice),
+        VMSTATE_UINTTL(rxq_ptr, VIOsPAPRVLANDevice),
+
+        VMSTATE_END_OF_LIST()
+    },
+};
+
 static void spapr_vlan_class_init(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
@@ -500,6 +519,7 @@ static void spapr_vlan_class_init(ObjectClass *klass, void *data)
     k->signal_mask = 0x1;
     dc->props = spapr_vlan_properties;
     k->rtce_window_size = 0x10000000;
+    dc->vmsd = &vmstate_spapr_llan;
 }
 
 static TypeInfo spapr_vlan_info = {
diff --git a/hw/spapr_vty.c b/hw/spapr_vty.c
index 5da17a3..5b36301 100644
--- a/hw/spapr_vty.c
+++ b/hw/spapr_vty.c
@@ -138,6 +138,21 @@ static Property spapr_vty_properties[] = {
     DEFINE_PROP_END_OF_LIST(),
 };
 
+static const VMStateDescription vmstate_spapr_vty = {
+    .name = "spapr_vty",
+    .version_id = 1,
+    .minimum_version_id = 1,
+    .minimum_version_id_old = 1,
+    .fields      = (VMStateField []) {
+        VMSTATE_SPAPR_VIO(sdev, VIOsPAPRVTYDevice),
+
+        VMSTATE_UINT32(in, VIOsPAPRVTYDevice),
+        VMSTATE_UINT32(out, VIOsPAPRVTYDevice),
+        VMSTATE_BUFFER(buf, VIOsPAPRVTYDevice),
+        VMSTATE_END_OF_LIST()
+    },
+};
+
 static void spapr_vty_class_init(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
@@ -148,6 +163,7 @@ static void spapr_vty_class_init(ObjectClass *klass, void *data)
     k->dt_type = "serial";
     k->dt_compatible = "hvterm1";
     dc->props = spapr_vty_properties;
+    dc->vmsd = &vmstate_spapr_vty;
 }
 
 static TypeInfo spapr_vty_info = {
-- 
1.7.10.4

  parent reply	other threads:[~2012-10-15  0:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-15  0:24 [Qemu-devel] RFC: savevm/migration support for pseries David Gibson
2012-10-15  0:24 ` [Qemu-devel] [PATCH 01/15] pseries: Split xics irq configuration from state information David Gibson
2012-10-15  0:24 ` [Qemu-devel] [PATCH 02/15] target-pcc: Convert ppcemb_tlb_t to use fixed 64-bit RPN David Gibson
2012-10-15  0:24 ` [Qemu-devel] [PATCH 03/15] savevm: Add VMSTATE_UINT64_EQUAL helpers David Gibson
2012-10-15  0:24 ` [Qemu-devel] [PATCH 04/15] savevm: Add VMSTATE_UINTTL_EQUAL helper David Gibson
2012-10-15  0:24 ` [Qemu-devel] [PATCH 05/15] savevm: Add VMSTATE_FLOAT64 helpers David Gibson
2012-10-15  0:24 ` [Qemu-devel] [PATCH 06/15] savevm: Add VMSTATE_STRUCT_VARRAY_POINTER_UINT32 David Gibson
2012-10-15  0:24 ` [Qemu-devel] [PATCH 07/15] savevm: Fix bugs in the VMSTATE_VBUFFER_MULTIPLY definition David Gibson
2012-10-15  0:24 ` [Qemu-devel] [PATCH 08/15] savevm: Implement VMS_DIVIDE flag David Gibson
2012-10-15  0:24 ` [Qemu-devel] [PATCH 09/15] target-ppc: Convert ppc cpu savevm to VMStateDescription David Gibson
2012-10-15  0:24 ` [Qemu-devel] [PATCH 10/15] pseries: savevm support for XICS interrupt controller David Gibson
2012-10-15  0:24 ` [Qemu-devel] [PATCH 11/15] pseries: savevm support for VIO devices David Gibson
2012-10-15  0:24 ` David Gibson [this message]
2012-10-15  0:24 ` [Qemu-devel] [PATCH 13/15] pseries: savevm support for PAPR TCE tables David Gibson
2012-10-15  0:24 ` [Qemu-devel] [PATCH 14/15] pseries: savevm support for PAPR virtual SCSI David Gibson
2012-10-15  0:24 ` [Qemu-devel] [PATCH 15/15] pseries: savevm support for pseries machine David Gibson

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=1350260682-21428-13-git-send-email-david@gibson.dropbear.id.au \
    --to=david@gibson.dropbear.id.au \
    --cc=agraf@suse.de \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=quintela@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 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).