From patchwork Sun Oct 23 06:31:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zhao xiao qiang X-Patchwork-Id: 9391021 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A94C1607FF for ; Sun, 23 Oct 2016 06:33:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 998DE28DBB for ; Sun, 23 Oct 2016 06:33:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8D7F028DC0; Sun, 23 Oct 2016 06:33:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E3BB928DBB for ; Sun, 23 Oct 2016 06:33:06 +0000 (UTC) Received: from localhost ([::1]:39868 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1byCLC-0005WJ-6V for patchwork-qemu-devel@patchwork.kernel.org; Sun, 23 Oct 2016 02:33:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50390) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1byCKT-0005QB-5i for qemu-devel@nongnu.org; Sun, 23 Oct 2016 02:32:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1byCKS-0003fY-8g for qemu-devel@nongnu.org; Sun, 23 Oct 2016 02:32:21 -0400 Received: from m12-16.163.com ([220.181.12.16]:53934) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1byCKR-0003er-My for qemu-devel@nongnu.org; Sun, 23 Oct 2016 02:32:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=+ldkS+IXxPuWcOJu27 WRJYsWRAqlXT89hiaDgNYU2IU=; b=IzLIeBmDdkn7sz9lyteHEO5BOlJc3kZj9X se9fCdidnPyPXALsZGaIgRZpnwTvLpqRsGLl2rci1chQwH4G/V/DkAay3d017YAB vXuq58Ro1DsFVMeJp8QxQutqrvBk7iiyo406v+3mG+90FXLmegqZtbhgNbxAzCO8 GPXuQXAHY= Received: from debian.lan (unknown [114.111.167.207]) by smtp12 (Coremail) with SMTP id EMCowABHqthVWQxYKknhBA--.56840S3; Sun, 23 Oct 2016 14:31:50 +0800 (CST) From: xiaoqiang zhao To: qemu-devel@nongnu.org Date: Sun, 23 Oct 2016 14:31:32 +0800 Message-Id: <20161023063135.21058-7-zxq_yx_007@163.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20161023063135.21058-1-zxq_yx_007@163.com> References: <20161023063135.21058-1-zxq_yx_007@163.com> X-CM-TRANSID: EMCowABHqthVWQxYKknhBA--.56840S3 X-Coremail-Antispam: 1Uf129KBjvJXoW7tw4rtr1DGr4kGw1rCFykKrg_yoW8uFWrpF Z8ZF1kWrWDWFsFqw4fGryDXa98W34kJr12ya9rGws7C3WUtrn5tr1qyry7tr4kGr9FvrW3 Za1xAr98Ww43Cr7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07bol1kUUUUU= X-Originating-IP: [114.111.167.207] X-CM-SenderInfo: 520ts5t0bqili6rwjhhfrp/1tbiqBYMxlc66O+gCAAAs2 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 220.181.12.16 Subject: [Qemu-devel] [PATCH 6/9] hw/timer: QOM'ify m48txx_sysbus (pass 2) 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: pbonzini@redhat.com, mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com, peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP assign DeviceClass::vmsd instead of using vmstate_register function Signed-off-by: xiaoqiang zhao --- hw/timer/m48t59.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/hw/timer/m48t59.c b/hw/timer/m48t59.c index 39e425e..6afcce4 100644 --- a/hw/timer/m48t59.c +++ b/hw/timer/m48t59.c @@ -639,6 +639,28 @@ static const VMStateDescription vmstate_m48t59 = { } }; +static const VMStateDescription vmstate_m48t59_isa = { + .name = "m48t59", + .version_id = 1, + .minimum_version_id = 1, + .fields = (VMStateField[]) { + VMSTATE_STRUCT(state, M48txxISAState, 0, + vmstate_m48t59, M48t59State), + VMSTATE_END_OF_LIST() + } +}; + +static const VMStateDescription vmstate_m48t59_sys_bus = { + .name = "m48t59", + .version_id = 1, + .minimum_version_id = 1, + .fields = (VMStateField[]) { + VMSTATE_STRUCT(state, M48txxSysBusState, 0, + vmstate_m48t59, M48t59State), + VMSTATE_END_OF_LIST() + } +}; + static void m48t59_reset_common(M48t59State *NVRAM) { NVRAM->addr = 0; @@ -744,8 +766,6 @@ static void m48t59_realize_common(M48t59State *s, Error **errp) s->wd_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, &watchdog_cb, s); } qemu_get_timedate(&s->alarm, 0); - - vmstate_register(NULL, -1, &vmstate_m48t59, s); } static void m48t59_isa_realize(DeviceState *dev, Error **errp) @@ -824,6 +844,7 @@ static void m48txx_isa_class_init(ObjectClass *klass, void *data) dc->realize = m48t59_isa_realize; dc->reset = m48t59_reset_isa; dc->props = m48t59_isa_properties; + dc->vmsd = &vmstate_m48t59_isa; nc->read = m48txx_isa_read; nc->write = m48txx_isa_write; nc->toggle_lock = m48txx_isa_toggle_lock; @@ -868,6 +889,7 @@ static void m48txx_sysbus_class_init(ObjectClass *klass, void *data) dc->realize = m48t59_realize; dc->reset = m48t59_reset_sysbus; dc->props = m48t59_sysbus_properties; + dc->vmsd = &vmstate_m48t59_sys_bus; nc->read = m48txx_sysbus_read; nc->write = m48txx_sysbus_write; nc->toggle_lock = m48txx_sysbus_toggle_lock;