From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42992) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLxCN-0005PK-RN for qemu-devel@nongnu.org; Thu, 12 Feb 2015 12:05:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YLxCF-00067x-PX for qemu-devel@nongnu.org; Thu, 12 Feb 2015 12:05:07 -0500 Received: from e06smtp13.uk.ibm.com ([195.75.94.109]:60792) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLxCF-00067l-HG for qemu-devel@nongnu.org; Thu, 12 Feb 2015 12:04:59 -0500 Received: from /spool/local by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 12 Feb 2015 17:04:58 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 82D9C1B080A3 for ; Thu, 12 Feb 2015 17:05:04 +0000 (GMT) Received: from d06av07.portsmouth.uk.ibm.com (d06av07.portsmouth.uk.ibm.com [9.149.37.248]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t1CH2MuU50462794 for ; Thu, 12 Feb 2015 17:02:22 GMT Received: from d06av07.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t1CH2Mru010440 for ; Thu, 12 Feb 2015 12:02:22 -0500 From: Jens Freimann Date: Thu, 12 Feb 2015 18:02:16 +0100 Message-Id: <1423760536-58356-5-git-send-email-jfrei@linux.vnet.ibm.com> In-Reply-To: <1423760536-58356-1-git-send-email-jfrei@linux.vnet.ibm.com> References: <1423760536-58356-1-git-send-email-jfrei@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 4/4] s390x/ipl: make s390x ipl device aware of migration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christian Borntraeger , Alexander Graf , Cornelia Huck Cc: Jens Freimann , qemu-devel@nongnu.org, Fan Zhang From: Fan Zhang We have to migrate the reipl parameters, so a reboot on the migrated machine will behave just like on the origin. Otherwise, the reipl parameters configured by the guest would be lost. Reviewed-by: Cornelia Huck Reviewed-by: David Hildenbrand Acked-by: Christian Borntraeger Signed-off-by: Jens Freimann Signed-off-by: Fan Zhang --- hw/s390x/ipl.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c index a1aa051..b57adbd 100644 --- a/hw/s390x/ipl.c +++ b/hw/s390x/ipl.c @@ -67,6 +67,33 @@ typedef struct S390IPLState { uint16_t devno; } S390IPLState; +static const VMStateDescription vmstate_iplb = { + .name = "ipl/iplb", + .version_id = 0, + .minimum_version_id = 0, + .fields = (VMStateField[]) { + VMSTATE_UINT8_ARRAY(reserved1, IplParameterBlock, 110), + VMSTATE_UINT16(devno, IplParameterBlock), + VMSTATE_UINT8_ARRAY(reserved2, IplParameterBlock, 88), + VMSTATE_END_OF_LIST() + } +}; + +static const VMStateDescription vmstate_ipl = { + .name = "ipl", + .version_id = 0, + .minimum_version_id = 0, + .fields = (VMStateField[]) { + VMSTATE_UINT64(start_addr, S390IPLState), + VMSTATE_UINT64(bios_start_addr, S390IPLState), + VMSTATE_STRUCT(iplb, S390IPLState, 0, vmstate_iplb, IplParameterBlock), + VMSTATE_BOOL(iplb_valid, S390IPLState), + VMSTATE_UINT8(cssid, S390IPLState), + VMSTATE_UINT8(ssid, S390IPLState), + VMSTATE_UINT16(devno, S390IPLState), + VMSTATE_END_OF_LIST() + } +}; static int s390_ipl_init(SysBusDevice *dev) { @@ -273,6 +300,7 @@ static void s390_ipl_class_init(ObjectClass *klass, void *data) k->init = s390_ipl_init; dc->props = s390_ipl_properties; dc->reset = s390_ipl_reset; + dc->vmsd = &vmstate_ipl; } static const TypeInfo s390_ipl_info = { -- 2.1.4