From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:45917) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZJeH-00035m-FY for qemu-devel@nongnu.org; Wed, 22 Jun 2011 05:23:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QZJeE-0005u7-Rr for qemu-devel@nongnu.org; Wed, 22 Jun 2011 05:23:01 -0400 Received: from goliath.siemens.de ([192.35.17.28]:19526) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZJeE-0005tW-40 for qemu-devel@nongnu.org; Wed, 22 Jun 2011 05:22:58 -0400 Message-ID: <4E01B464.6080802@siemens.com> Date: Wed, 22 Jun 2011 11:22:44 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <001501cc300e$0b66bea0$22343be0$@Dovgaluk@ispras.ru> <49270.9042774097$1308723700@news.gmane.org> <4E01A3FB.5050706@siemens.com> <003c01cc30ba$9a3b7560$ceb26020$@Dovgaluk@ispras.ru> <4E01B16A.50602@siemens.com> <000001cc30bc$f89067e0$e9b137a0$@Dovgaluk@ispras.ru> In-Reply-To: <000001cc30bc$f89067e0$e9b137a0$@Dovgaluk@ispras.ru> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] Fix serial interface vmstate List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Dovgaluk Cc: 'qemu-devel' , "quintela@redhat.com" On 2011-06-22 11:15, Pavel Dovgaluk wrote: >>>>> What is the purpose of subsections? >>>> >>>> To skip the new fields whenever possible. That would allow to continue >>>> saving a vmstate on a new version of qemu and then restoring it on an >>>> older one. >>> >>> Do you have an idea how to implement "needed" function for my case? >>> Because I think, these fields should always be saved and loaded, because >>> they are related to the main state of the interface, not the kind of >>> optional substate. >> >> E.g., if the fifo is empty, you do not need to save its content. That >> would be one part of the condition. Go through all fields and check if >> they have states that could be ignored or if they could be ignored if >> other already saved fields have specific values. If you find any new >> field that must always be restored, let us discuss it. It may turn out >> that a substate is unrealistic, then we need to go with a new version. > > You mean, if FIFO is empty an will not be saved, we will have to clear > it before loading every time? We (soon, patches posted) do a reset before every loadvm. We already do this when starting a new machine. That sets all states that aren't restored to defaults. In case of the fifo, they are all emptied. > So there should be multiple subsections for every possible field? > E.g. timers are saved only if they are pending, thr_ipending is saved > only when it is nonzero, and so on. Do you mean that? Nope, only a single subsection. Either we are able to avoid any new field under certain circumstances or we have to break the legacy format anyway. Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux