From patchwork Mon Oct 14 16:45:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 283351 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 0BBA62C0339 for ; Tue, 15 Oct 2013 03:48:18 +1100 (EST) Received: from localhost ([::1]:37980 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVlJX-0000Vi-V6 for incoming@patchwork.ozlabs.org; Mon, 14 Oct 2013 12:48:15 -0400 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 Received: from localhost (vpn1-5-101.gru2.redhat.com [10.97.5.101]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r9EGjxjC028538; Mon, 14 Oct 2013 12:46:00 -0400 From: Eduardo Habkost To: qemu-devel@nongnu.org, Juan Quintela 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> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Paolo Bonzini , Markus Armbruster Subject: [Qemu-devel] [PATCH 4/5] vmstate: Use version_id when saving X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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;