From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43473) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBhRY-0002KJ-Vn for qemu-devel@nongnu.org; Mon, 28 Jul 2014 05:42:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XBhRT-0004KR-9p for qemu-devel@nongnu.org; Mon, 28 Jul 2014 05:42:08 -0400 Received: from mail-wg0-x22d.google.com ([2a00:1450:400c:c00::22d]:48746) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBhRT-0004KD-3U for qemu-devel@nongnu.org; Mon, 28 Jul 2014 05:42:03 -0400 Received: by mail-wg0-f45.google.com with SMTP id x12so6983091wgg.28 for ; Mon, 28 Jul 2014 02:42:02 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <53D61AE3.6000700@redhat.com> Date: Mon, 28 Jul 2014 11:41:55 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <20140717110153.8352.80175.stgit@PASHA-ISP> <20140717110255.8352.73575.stgit@PASHA-ISP> In-Reply-To: <20140717110255.8352.73575.stgit@PASHA-ISP> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH v2 10/49] rtl8139: adding new fields to vmstate List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Dovgalyuk , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, peter.crosthwaite@xilinx.com, mark.burton@greensocs.com, real@ispras.ru, batuzovk@ispras.ru, fred.konrad@greensocs.com Il 17/07/2014 13:02, Pavel Dovgalyuk ha scritto: > This patch adds virtual clock-dependent timers to VMState to allow correct > saving and restoring the state of RTL8139 network controller. > > Signed-off-by: Pavel Dovgalyuk > --- > hw/net/rtl8139.c | 5 ++++- > 1 files changed, 4 insertions(+), 1 deletions(-) > > diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c > index 90bc5ec..992caf0 100644 > --- a/hw/net/rtl8139.c > +++ b/hw/net/rtl8139.c > @@ -3289,7 +3289,7 @@ static void rtl8139_pre_save(void *opaque) > > static const VMStateDescription vmstate_rtl8139 = { > .name = "rtl8139", > - .version_id = 4, > + .version_id = 5, > .minimum_version_id = 3, > .post_load = rtl8139_post_load, > .pre_save = rtl8139_pre_save, > @@ -3363,6 +3363,9 @@ static const VMStateDescription vmstate_rtl8139 = { > VMSTATE_STRUCT(tally_counters, RTL8139State, 0, > vmstate_tally_counters, RTL8139TallyCounters), > > + VMSTATE_TIMER_V(timer, RTL8139State, 5), timer need not be migrated, because it is reinstated by rtl8139_post_load. > + VMSTATE_INT64_V(TimerExpire, RTL8139State, 5), This can be in a subsection, migrated only if non-zero. Paolo > VMSTATE_UINT32_V(cplus_enabled, RTL8139State, 4), > VMSTATE_END_OF_LIST() > }, > > >