From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47507) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBhhy-0000Gj-1p for qemu-devel@nongnu.org; Mon, 28 Jul 2014 05:59:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XBhho-0001me-J2 for qemu-devel@nongnu.org; Mon, 28 Jul 2014 05:59:05 -0400 Received: from mail-wi0-x231.google.com ([2a00:1450:400c:c05::231]:53465) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBhho-0001mY-BM for qemu-devel@nongnu.org; Mon, 28 Jul 2014 05:58:56 -0400 Received: by mail-wi0-f177.google.com with SMTP id ho1so4062431wib.10 for ; Mon, 28 Jul 2014 02:58:54 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <53D61ED6.80508@redhat.com> Date: Mon, 28 Jul 2014 11:58:46 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <20140717110153.8352.80175.stgit@PASHA-ISP> <20140717110233.8352.53806.stgit@PASHA-ISP> In-Reply-To: <20140717110233.8352.53806.stgit@PASHA-ISP> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH v2 06/49] serial: fixing vmstate for save/restore 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: > - .version_id = 3, > + .version_id = 4, > .minimum_version_id = 2, > .pre_save = serial_pre_save, > .post_load = serial_post_load, > .fields = (VMStateField[]) { > VMSTATE_UINT16_V(divider, SerialState, 2), > VMSTATE_UINT8(rbr, SerialState), > + VMSTATE_UINT8_V(thr, SerialState, 4), > + VMSTATE_UINT8_V(tsr, SerialState, 4), > VMSTATE_UINT8(ier, SerialState), > VMSTATE_UINT8(iir, SerialState), > VMSTATE_UINT8(lcr, SerialState), > @@ -613,6 +627,15 @@ const VMStateDescription vmstate_serial = { > VMSTATE_UINT8(msr, SerialState), > VMSTATE_UINT8(scr, SerialState), > VMSTATE_UINT8_V(fcr_vmstate, SerialState, 3), > + VMSTATE_INT32_V(thr_ipending, SerialState, 4), Subsection, only migrated if it doesn't match "(s->iir & UART_IIR_ID) == UART_IIR_THRI". > + VMSTATE_INT32_V(last_break_enable, SerialState, 4), Can be reconstructed in the post_load callback from s->lcr. > + VMSTATE_INT32_V(tsr_retry, SerialState, 4), Subsection, only migrated if nonzero. thr/tsr can be in this subsection as well. > + VMSTATE_STRUCT(recv_fifo, SerialState, 4, vmstate_fifo8, Fifo8), > + VMSTATE_STRUCT(xmit_fifo, SerialState, 4, vmstate_fifo8, Fifo8), Two subsections, only transmitted if nonempty. > + VMSTATE_TIMER_V(fifo_timeout_timer, SerialState, 4), Subsection, only transmitted if pending. > + VMSTATE_INT32_V(timeout_ipending, SerialState, 4), Subsection, transmitted only if nonzero. > + VMSTATE_INT32_V(poll_msl, SerialState, 4), > + VMSTATE_TIMER_V(modem_status_poll, SerialState, 4), Both in a subsection, only migrated if poll_msl is not -1. Paolo > VMSTATE_END_OF_LIST()