From patchwork Thu Sep 10 01:04:24 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 33240 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by bilbo.ozlabs.org (Postfix) with ESMTPS id 47339B7043 for ; Thu, 10 Sep 2009 11:11:38 +1000 (EST) Received: from localhost ([127.0.0.1]:36063 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MlYCF-0006l3-IZ for incoming@patchwork.ozlabs.org; Wed, 09 Sep 2009 21:11:35 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MlY5w-0004OR-KK for qemu-devel@nongnu.org; Wed, 09 Sep 2009 21:05:04 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MlY5o-0004F2-JJ for qemu-devel@nongnu.org; Wed, 09 Sep 2009 21:05:02 -0400 Received: from [199.232.76.173] (port=48250 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MlY5o-0004Ea-DY for qemu-devel@nongnu.org; Wed, 09 Sep 2009 21:04:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34499) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MlY5n-0002kd-Pr for qemu-devel@nongnu.org; Wed, 09 Sep 2009 21:04:56 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8A14tHF021155 for ; Wed, 9 Sep 2009 21:04:55 -0400 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n8A14ooW020882; Wed, 9 Sep 2009 21:04:54 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Thu, 10 Sep 2009 03:04:24 +0200 Message-Id: <9e1839178f7a85d264eee20a07d4aed6e6ddb7b1.1252543871.git.quintela@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH 03/26] Remove SaveVM v2 support X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org In previosu series I remove v2 support for RAM (that was the version that was supported when SaveVM v3 appeared). Now we can't load RAM for any image saved in SaveVM v2, we can as well remove SaveVM v2 entirely. Note: That SaveVM RAM was at v2 when General SaveVM support went from v2 to v3 makes talking about versions confusing at least Signed-off-by: Juan Quintela --- savevm.c | 47 ++++------------------------------------------- 1 files changed, 4 insertions(+), 43 deletions(-) diff --git a/savevm.c b/savevm.c index 34145f9..0dcab79 100644 --- a/savevm.c +++ b/savevm.c @@ -1266,47 +1266,6 @@ typedef struct LoadStateEntry { int version_id; } LoadStateEntry; -static int qemu_loadvm_state_v2(QEMUFile *f) -{ - SaveStateEntry *se; - int len, ret, instance_id, record_len, version_id; - int64_t total_len, end_pos, cur_pos; - char idstr[256]; - - total_len = qemu_get_be64(f); - end_pos = total_len + qemu_ftell(f); - for(;;) { - if (qemu_ftell(f) >= end_pos) - break; - len = qemu_get_byte(f); - qemu_get_buffer(f, (uint8_t *)idstr, len); - idstr[len] = '\0'; - instance_id = qemu_get_be32(f); - version_id = qemu_get_be32(f); - record_len = qemu_get_be32(f); - cur_pos = qemu_ftell(f); - se = find_se(idstr, instance_id); - if (!se) { - fprintf(stderr, "qemu: warning: instance 0x%x of device '%s' not present in current VM\n", - instance_id, idstr); - } else { - ret = vmstate_load(f, se, version_id); - if (ret < 0) { - fprintf(stderr, "qemu: warning: error while loading state for instance 0x%x of device '%s'\n", - instance_id, idstr); - return ret; - } - } - /* always seek to exact end of record */ - qemu_fseek(f, cur_pos + record_len, SEEK_SET); - } - - if (qemu_file_has_error(f)) - return -EIO; - - return 0; -} - int qemu_loadvm_state(QEMUFile *f) { LIST_HEAD(, LoadStateEntry) loadvm_handlers = @@ -1321,8 +1280,10 @@ int qemu_loadvm_state(QEMUFile *f) return -EINVAL; v = qemu_get_be32(f); - if (v == QEMU_VM_FILE_VERSION_COMPAT) - return qemu_loadvm_state_v2(f); + if (v == QEMU_VM_FILE_VERSION_COMPAT) { + fprintf(stderr, "SaveVM v2 format is obsolete and don't work anymore\n"); + return -ENOTSUP; + } if (v != QEMU_VM_FILE_VERSION) return -ENOTSUP;