From patchwork Fri Jul 12 07:30:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kardashevskiy X-Patchwork-Id: 258705 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 9C87D2C0330 for ; Fri, 12 Jul 2013 17:31:17 +1000 (EST) Received: from localhost ([::1]:58885 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxXox-0004fv-8V for incoming@patchwork.ozlabs.org; Fri, 12 Jul 2013 03:31:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49529) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxXoQ-0004Re-1H for qemu-devel@nongnu.org; Fri, 12 Jul 2013 03:30:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UxXoJ-0007Un-IO for qemu-devel@nongnu.org; Fri, 12 Jul 2013 03:30:41 -0400 Received: from mail-gg0-f180.google.com ([209.85.161.180]:58814) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxXoJ-0007TT-6r for qemu-devel@nongnu.org; Fri, 12 Jul 2013 03:30:35 -0400 Received: by mail-gg0-f180.google.com with SMTP id i6so3024292ggm.39 for ; Fri, 12 Jul 2013 00:30:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=v6W0iKR+iT8P9csC9bx1k+0LGQyokrIMVmRIG4FiE3g=; b=g6XXZrVJpXMtBRJm/6s1B08s8c+1gIascizpZJMQKq9DX/EYaMQI03gnA177e42iSM aFuzyH5HkHaqL87DSN0PwAefN1b6D9d55YVqtgWI7ihWlEqgzWPx4X8bghUAP8Nl/y7h BjVZD7jAUxA8JjBnClHyEsSaQtxDHOsWbQjgVVw2zASmHnhcre9uvpEGV33mEbY2oBev oL5XDX2+VXuZtJJZR40vNkn53h0ZgTDDXdH8mY8TLr/hbEKAPZtPk4n6aZgDqvbvmTF4 jRxVGDNp2Eo/HDon4AwzsLnFv2Emuxm89brA7/+LwaqrfGBLtTnkvOge/DaYBvWJjcEd RsaA== X-Received: by 10.236.143.6 with SMTP id k6mr23100126yhj.256.1373614234720; Fri, 12 Jul 2013 00:30:34 -0700 (PDT) Received: from ka1.ozlabs.ibm.com (ibmaus65.lnk.telstra.net. [165.228.126.9]) by mx.google.com with ESMTPSA id e69sm66371951yhl.3.2013.07.12.00.30.30 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 12 Jul 2013 00:30:33 -0700 (PDT) From: Alexey Kardashevskiy To: qemu-devel@nongnu.org Date: Fri, 12 Jul 2013 17:30:15 +1000 Message-Id: <1373614220-14981-2-git-send-email-aik@ozlabs.ru> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1373614220-14981-1-git-send-email-aik@ozlabs.ru> References: <1373614220-14981-1-git-send-email-aik@ozlabs.ru> X-Gm-Message-State: ALoCoQlB5yiNhfIHvXDSjf80OVArM5huQ5AV5CrSYx4Z7fKPtdJtkrBunxAHDcJw9cM9fXJZxCc6 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.161.180 Cc: Anthony Liguori , aik@ozlabs.ru, Alexander Graf , qemu-ppc@nongnu.org, Paul Mackerras , David Gibson Subject: [Qemu-devel] [PATCH 1/6] pseries: savevm support for VIO devices X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 Reviewed-by: Anthony Liguori Signed-off-by: Alexey Kardashevskiy --- 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 7c6f6e4..75ce19f 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 */