From patchwork Mon Mar 25 11:01:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Hedde X-Patchwork-Id: 1064150 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=greensocs.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=greensocs.com header.i=@greensocs.com header.b="kNue+fmI"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=greensocs.com header.i=@greensocs.com header.b="BQPwbnrL"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=greensocs.com header.i=@greensocs.com header.b="BQPwbnrL"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44SWjh0sJcz9sSH for ; Mon, 25 Mar 2019 22:09:12 +1100 (AEDT) Received: from localhost ([127.0.0.1]:40565 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h8NTa-0001Ok-2v for incoming@patchwork.ozlabs.org; Mon, 25 Mar 2019 07:09:10 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58663) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h8NNH-0005Ct-Ax for qemu-devel@nongnu.org; Mon, 25 Mar 2019 07:02:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h8NNG-0007vK-7B for qemu-devel@nongnu.org; Mon, 25 Mar 2019 07:02:39 -0400 Received: from greensocs.com ([193.104.36.180]:38353) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h8NN8-0007oL-Ma; Mon, 25 Mar 2019 07:02:31 -0400 Received: from localhost (localhost [127.0.0.1]) by greensocs.com (Postfix) with ESMTP id F13C07D78B6; Mon, 25 Mar 2019 12:02:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=greensocs.com; s=mail; t=1553511746; bh=pK9FJbNdoyI0VAz9RM6Oo8TYJ2N+7i+dGeRy4KKzNO0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=kNue+fmI5Ry1bjwLTDrqk//nBklIkD5etwJir5fLuomczeeNVxEVnrzsw7o+o8gNS NuwR19j8wGHsUUAiWtirrldQR/bVCqlZxRMER+UfnCAt4Dw/wXcYyyYawpv0tcavx4 WK0rkVNNayQBZTQ2CIv9RiLs12DGf6Q51b9N65kM= X-Virus-Scanned: amavisd-new at greensocs.com Authentication-Results: gs-01.greensocs.com (amavisd-new); dkim=pass (1024-bit key) header.d=greensocs.com header.b=BQPwbnrL; dkim=pass (1024-bit key) header.d=greensocs.com header.b=BQPwbnrL Received: from greensocs.com ([127.0.0.1]) by localhost (gs-01.greensocs.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9ZKsc6NyXlwx; Mon, 25 Mar 2019 12:02:25 +0100 (CET) Received: by greensocs.com (Postfix, from userid 998) id E9F677D78A0; Mon, 25 Mar 2019 12:02:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=greensocs.com; s=mail; t=1553511742; bh=pK9FJbNdoyI0VAz9RM6Oo8TYJ2N+7i+dGeRy4KKzNO0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=BQPwbnrL7viIukwx4WlVPAEeaKRRSJiu5LibDCyuDl1E1KbQ+ululT+1uTAXxL39u YqO9nWa7G7aBTsS4J7nf9OZBH60w47g3BrNb+Hn+oopdj+7UpJBbxTa7c9zxvhjaaC gLlmIusExZvYblu5DbfGQBWIkClNGLJzA7AS1w7w= Received: from kouign-amann.bar.greensocs.com (antfield.tima.u-ga.fr [147.171.129.253]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: damien.hedde@greensocs.com) by greensocs.com (Postfix) with ESMTPSA id 621137D78A2; Mon, 25 Mar 2019 12:02:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=greensocs.com; s=mail; t=1553511742; bh=pK9FJbNdoyI0VAz9RM6Oo8TYJ2N+7i+dGeRy4KKzNO0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=BQPwbnrL7viIukwx4WlVPAEeaKRRSJiu5LibDCyuDl1E1KbQ+ululT+1uTAXxL39u YqO9nWa7G7aBTsS4J7nf9OZBH60w47g3BrNb+Hn+oopdj+7UpJBbxTa7c9zxvhjaaC gLlmIusExZvYblu5DbfGQBWIkClNGLJzA7AS1w7w= From: Damien Hedde To: qemu-devel@nongnu.org Date: Mon, 25 Mar 2019 12:01:48 +0100 Message-Id: <11cf0b4f9c333696f462753c47dc71641717fb08.1553510737.git.damien.hedde@greensocs.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 193.104.36.180 Subject: [Qemu-devel] [RFC PATCH 05/17] add vmstate description for device reset state X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: edgar.iglesias@xilinx.com, peter.maydell@linaro.org, mark.burton@greensocs.com, Damien Hedde , qemu-arm@nongnu.org, alistair.francis@wdc.com, marcandre.lureau@redhat.com, pbonzini@redhat.com, philmd@redhat.com, luc.michel@greensocs.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The `device_vmstate_reset` can be added by device specialization, as vmsd subsection, to migrate the reset related device state part. Signed-off-by: Damien Hedde --- hw/core/Makefile.objs | 1 + hw/core/qdev-vmstate.c | 25 +++++++++++++++++++++++++ include/hw/qdev-core.h | 6 ++++++ 3 files changed, 32 insertions(+) create mode 100644 hw/core/qdev-vmstate.c diff --git a/hw/core/Makefile.objs b/hw/core/Makefile.objs index 320f71707c..562cf1034e 100644 --- a/hw/core/Makefile.objs +++ b/hw/core/Makefile.objs @@ -5,6 +5,7 @@ common-obj-y += resettable.o common-obj-y += reset-domain.o common-obj-$(CONFIG_SOFTMMU) += qdev-fw.o common-obj-$(CONFIG_SOFTMMU) += fw-path-provider.o +common-obj-$(CONFIG_SOFTMMU) += qdev-vmstate.o # irq.o needed for qdev GPIO handling: common-obj-y += irq.o common-obj-y += hotplug.o diff --git a/hw/core/qdev-vmstate.c b/hw/core/qdev-vmstate.c new file mode 100644 index 0000000000..a9834f1a1c --- /dev/null +++ b/hw/core/qdev-vmstate.c @@ -0,0 +1,25 @@ +/* + * Device vmstate + * + * Copyright (c) 2019 GreenSocs + * + * Authors: + * Damien Hedde + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#include "qemu/osdep.h" +#include "hw/qdev.h" +#include "migration/vmstate.h" + +const struct VMStateDescription device_vmstate_reset = { + .name = "device_reset", + .version_id = 0, + .minimum_version_id = 0, + .fields = (VMStateField[]) { + VMSTATE_UINT32(resetting, DeviceState), + VMSTATE_END_OF_LIST() + } +}; diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 0ef4d6c920..baad2e7066 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -500,4 +500,10 @@ static inline bool qbus_is_hotpluggable(BusState *bus) void device_listener_register(DeviceListener *listener); void device_listener_unregister(DeviceListener *listener); +/** + * device_vmstate_reset: + * vmstate entry for reset related state + */ +extern const struct VMStateDescription device_vmstate_reset; + #endif