From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49561) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMEr4-0002mQ-DM for qemu-devel@nongnu.org; Wed, 18 Sep 2013 06:19:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VMEqq-0008Vm-Us for qemu-devel@nongnu.org; Wed, 18 Sep 2013 06:19:30 -0400 Received: from e06smtp15.uk.ibm.com ([195.75.94.111]:57222) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMEqq-0008U6-Mu for qemu-devel@nongnu.org; Wed, 18 Sep 2013 06:19:16 -0400 Received: from /spool/local by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 18 Sep 2013 11:19:15 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 33D4417D8058 for ; Wed, 18 Sep 2013 11:19:22 +0100 (BST) Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by b06cxnps4075.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r8IAIx5f40698064 for ; Wed, 18 Sep 2013 10:18:59 GMT Received: from d06av05.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r8IAJAwE032041 for ; Wed, 18 Sep 2013 04:19:11 -0600 From: Christian Borntraeger Date: Wed, 18 Sep 2013 12:19:23 +0200 Message-Id: <1379499572-49737-3-git-send-email-borntraeger@de.ibm.com> In-Reply-To: <1379499572-49737-1-git-send-email-borntraeger@de.ibm.com> References: <1379499572-49737-1-git-send-email-borntraeger@de.ibm.com> Subject: [Qemu-devel] [PATCH 02/11] s390/sclpconsole: Add code to support live migration for sclpconsole List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Christian Borntraeger , Jens Freimann , Heinz Graalfs , qemu-devel From: Heinz Graalfs This patch adds the necessary life migration pieces to the sclp code by using vmstate_register. Signed-off-by: Heinz Graalfs Signed-off-by: Christian Borntraeger --- hw/char/sclpconsole.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/hw/char/sclpconsole.c b/hw/char/sclpconsole.c index fd270be..856230f 100644 --- a/hw/char/sclpconsole.c +++ b/hw/char/sclpconsole.c @@ -197,9 +197,26 @@ static void trigger_ascii_console_data(void *opaque, int n, int level) sclp_service_interrupt(0); } +static const VMStateDescription vmstate_sclpconsole = { + .name = "sclpconsole", + .version_id = 0, + .minimum_version_id = 0, + .minimum_version_id_old = 0, + .fields = (VMStateField[]) { + VMSTATE_BOOL(event.event_pending, SCLPConsole), + VMSTATE_UINT8_ARRAY(iov, SCLPConsole, SIZE_BUFFER_VT220), + VMSTATE_UINT32(iov_sclp, SCLPConsole), + VMSTATE_UINT32(iov_bs, SCLPConsole), + VMSTATE_UINT32(iov_data_len, SCLPConsole), + VMSTATE_UINT32(iov_sclp_rest, SCLPConsole), + VMSTATE_END_OF_LIST() + } +}; + /* qemu object creation and initialization functions */ /* tell character layer our call-back functions */ + static int console_init(SCLPEvent *event) { static bool console_available; @@ -223,7 +240,7 @@ static int console_init(SCLPEvent *event) scon->irq_read_vt220 = *qemu_allocate_irqs(trigger_ascii_console_data, NULL, 1); - return 0; + return vmstate_register(NULL, 0, &vmstate_sclpconsole, scon); } static int console_exit(SCLPEvent *event) -- 1.8.3.1