From nobody Wed Nov 5 20:18:39 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1536944860117572.1500437876311; Fri, 14 Sep 2018 10:07:40 -0700 (PDT) Received: from localhost ([::1]:52636 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g0rZD-0002u7-11 for importer@patchew.org; Fri, 14 Sep 2018 13:07:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35959) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g0rWI-0001Co-2d for qemu-devel@nongnu.org; Fri, 14 Sep 2018 13:04:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g0rWH-0007HB-2Z for qemu-devel@nongnu.org; Fri, 14 Sep 2018 13:04:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36132) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g0rWG-0007Gv-Sn for qemu-devel@nongnu.org; Fri, 14 Sep 2018 13:04:36 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3371288E53 for ; Fri, 14 Sep 2018 17:04:36 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-182.ams2.redhat.com [10.36.117.182]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4B10B61B99; Fri, 14 Sep 2018 17:04:35 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, peterx@redhat.com Date: Fri, 14 Sep 2018 18:04:30 +0100 Message-Id: <20180914170430.54271-3-dgilbert@redhat.com> In-Reply-To: <20180914170430.54271-1-dgilbert@redhat.com> References: <20180914170430.54271-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 14 Sep 2018 17:04:36 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 2/2] migration: cleanup in error paths in loadvm X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: quintela@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" There's a couple of error paths in qemu_loadvm_state which happen early on but after we've initialised the load state; that needs to be cleaned up otherwise we can hit asserts if the state gets reinitialised later. Signed-off-by: Dr. David Alan Gilbert --- migration/savevm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/migration/savevm.c b/migration/savevm.c index 6384cf676d..534f7daf31 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -2331,11 +2331,13 @@ int qemu_loadvm_state(QEMUFile *f) if (migrate_get_current()->send_configuration) { if (qemu_get_byte(f) !=3D QEMU_VM_CONFIGURATION) { error_report("Configuration section missing"); + qemu_loadvm_state_cleanup(); return -EINVAL; } ret =3D vmstate_load_state(f, &vmstate_configuration, &savevm_stat= e, 0); =20 if (ret) { + qemu_loadvm_state_cleanup(); return ret; } } --=20 2.17.1