From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49172) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVlHY-0005zj-3o for qemu-devel@nongnu.org; Mon, 14 Oct 2013 12:46:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VVlHN-0008Jx-GQ for qemu-devel@nongnu.org; Mon, 14 Oct 2013 12:46:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48789) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVlHN-0008Jn-81 for qemu-devel@nongnu.org; Mon, 14 Oct 2013 12:46:01 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r9EGk0d3016690 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 14 Oct 2013 12:46:00 -0400 From: Eduardo Habkost Date: Mon, 14 Oct 2013 13:45:47 -0300 Message-Id: <1381769148-22400-5-git-send-email-ehabkost@redhat.com> In-Reply-To: <1381769148-22400-1-git-send-email-ehabkost@redhat.com> References: <1381769148-22400-1-git-send-email-ehabkost@redhat.com> Subject: [Qemu-devel] [PATCH 4/5] vmstate: Use version_id when saving List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, Juan Quintela Cc: Paolo Bonzini , Markus Armbruster This will allow fields to have version_id > vmsd->version_id, to allow us to support loading data with higher version_id. This patch alone is not useful by itself, but it will be useful when introducing the max_version_id field to VMStateDescription. Signed-off-by: Eduardo Habkost --- savevm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/savevm.c b/savevm.c index 16276e7..87773ad 100644 --- a/savevm.c +++ b/savevm.c @@ -1766,6 +1766,9 @@ void vmstate_save_state(QEMUFile *f, const VMStateDescription *vmsd, !field->field_exists(opaque, vmsd->version_id)) { continue; } + if (field->version_id > vmsd->version_id) { + continue; + } void *base_addr = opaque + field->offset; int i, n_elems = 1; -- 1.8.3.1