From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55469) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UwGKb-0008DM-Om for qemu-devel@nongnu.org; Mon, 08 Jul 2013 14:38:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UwGKa-0002jg-PW for qemu-devel@nongnu.org; Mon, 08 Jul 2013 14:38:37 -0400 Received: from e35.co.us.ibm.com ([32.97.110.153]:53032) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UwGKa-0002jZ-IY for qemu-devel@nongnu.org; Mon, 08 Jul 2013 14:38:36 -0400 Received: from /spool/local by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 8 Jul 2013 12:38:32 -0600 From: Anthony Liguori In-Reply-To: <1372315560-5478-7-git-send-email-aik@ozlabs.ru> References: <1372315560-5478-1-git-send-email-aik@ozlabs.ru> <1372315560-5478-7-git-send-email-aik@ozlabs.ru> Date: Mon, 08 Jul 2013 13:35:01 -0500 Message-ID: <87y59gzyqy.fsf@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH 06/17] pseries: savevm support for VIO devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy , qemu-devel@nongnu.org Cc: Alexander Graf , qemu-ppc@nongnu.org, Paolo Bonzini , Paul Mackerras , David Gibson Alexey Kardashevskiy writes: > From: David Gibson > > This patch adds helpers to allow PAPR VIO devices to save state common > to all VIO devices during savevm. > > Signed-off-by: David Gibson > Signed-off-by: Alexey Kardashevskiy Reviewed-by: Anthony Liguori Regards, Anthony Liguori > --- > hw/ppc/spapr_vio.c | 20 ++++++++++++++++++++ > include/hw/ppc/spapr_vio.h | 5 +++++ > 2 files changed, 25 insertions(+) > > diff --git a/hw/ppc/spapr_vio.c b/hw/ppc/spapr_vio.c > index 9c18741..565d883 100644 > --- a/hw/ppc/spapr_vio.c > +++ b/hw/ppc/spapr_vio.c > @@ -542,6 +542,26 @@ static const TypeInfo spapr_vio_bridge_info = { > .class_init = spapr_vio_bridge_class_init, > }; > > +const VMStateDescription vmstate_spapr_vio = { > + .name = "spapr_vio", > + .version_id = 1, > + .minimum_version_id = 1, > + .minimum_version_id_old = 1, > + .fields = (VMStateField []) { > + /* Sanity check */ > + VMSTATE_UINT32_EQUAL(reg, VIOsPAPRDevice), > + VMSTATE_UINT32_EQUAL(irq, VIOsPAPRDevice), > + > + /* General VIO device state */ > + VMSTATE_UINTTL(signal_state, VIOsPAPRDevice), > + VMSTATE_UINT64(crq.qladdr, VIOsPAPRDevice), > + VMSTATE_UINT32(crq.qsize, VIOsPAPRDevice), > + VMSTATE_UINT32(crq.qnext, VIOsPAPRDevice), > + > + VMSTATE_END_OF_LIST() > + }, > +}; > + > static void vio_spapr_device_class_init(ObjectClass *klass, void *data) > { > DeviceClass *k = DEVICE_CLASS(klass); > diff --git a/include/hw/ppc/spapr_vio.h b/include/hw/ppc/spapr_vio.h > index 3609327..46edc2a 100644 > --- a/include/hw/ppc/spapr_vio.h > +++ b/include/hw/ppc/spapr_vio.h > @@ -134,4 +134,9 @@ VIOsPAPRDevice *spapr_vty_get_default(VIOsPAPRBus *bus); > > void spapr_vio_quiesce(void); > > +extern const VMStateDescription vmstate_spapr_vio; > + > +#define VMSTATE_SPAPR_VIO(_f, _s) \ > + VMSTATE_STRUCT(_f, _s, 0, vmstate_spapr_vio, VIOsPAPRDevice) > + > #endif /* _HW_SPAPR_VIO_H */ > -- > 1.7.10.4