From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=54572 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oe5C7-0008U2-Km for qemu-devel@nongnu.org; Wed, 28 Jul 2010 07:53:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oe5C6-0007P4-31 for qemu-devel@nongnu.org; Wed, 28 Jul 2010 07:53:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25204) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oe5C5-0007Oo-S0 for qemu-devel@nongnu.org; Wed, 28 Jul 2010 07:53:06 -0400 From: Juan Quintela In-Reply-To: (TeLeMan's message of "Wed, 28 Jul 2010 19:23:50 +0800") References: Date: Wed, 28 Jul 2010 13:51:30 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] Re: [PATCH] vmstate: fix vmstate_subsection_load Reply-To: quintela@redhat.com List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: TeLeMan Cc: qemu-devel TeLeMan wrote: > On Wed, Jul 28, 2010 at 18:43, Juan Quintela wrote: >> TeLeMan wrote: >>> =C2=A0If the new version adds the new subsection for some vmstate, the = old >>> version will load the new version's vmstate unsuccessfully. So we have >>> to ignore the unrecognized subsections. >> >> No. =C2=A0That was the whole point of subsections. =C2=A0If one subsecti= on is >> sent, target machine has to understand it. =C2=A0If it don't understand = it, >> it fails. >> >> If subsection is not needed, it is the responsability of the source to >> not send it. >> >> This was one of the design requirements. =C2=A0Subsections are optional = but >> it is the source which decides which ones to send/not to send. =C2=A0The >> target has to understand everything that it gets or fail the migration. >> > > If the target must understand everything, the vmstate's version will > be useless because the old version target maybe cannot load the new > version target's vmstate. That is the whole point. See the ide example that I also sent. We have an old version of qemu, that don't understand pio ide fields. We get a new qemu version that has pio ide fields in the state. notice that migration in the middle of a pio operation is a very rare event. for instance, if you are using linux as a guest, pio is only used during boot, and not so many times (around 30000 calls during boot). Without subsections, you will be unable to migrate from new qemu to old qemu, because old qemu don't understand the pio fields. With subsections, if we are in the middle of a pio operation, we sent pio subsection and migration to old qemu will fail. But if we aren't in the middle of a pio operation, pio information will not be sent and migration will succeed. This is special important for the stable branch, where we are supposed to be backwards compatible, but sometimes we find a bug, and we really have to change the savevm format. This allows us that after creating the subsection, we can still migrate to the old version the majority of the time. Notice that this bugfixes are normally rare cases, because if it were the normal case, we would have already detected it before the release. If we sent the subsection, it means that target needs to understand it, or state will be broken (one way or another). I hope this hepls to understand how subsections are supposed to work. Thanks for the comments, Juan.