From nobody Mon Feb 9 01:20:19 2026 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1506339248872792.3929749052584; Mon, 25 Sep 2017 04:34:08 -0700 (PDT) Received: from localhost ([::1]:41810 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwRe4-0003AF-Rs for importer@patchew.org; Mon, 25 Sep 2017 07:33:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59854) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwRZy-000802-3C for qemu-devel@nongnu.org; Mon, 25 Sep 2017 07:29:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dwRZv-00023t-Iq for qemu-devel@nongnu.org; Mon, 25 Sep 2017 07:29:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52782) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dwRZv-00023R-DA for qemu-devel@nongnu.org; Mon, 25 Sep 2017 07:29:35 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 81F5F7E446; Mon, 25 Sep 2017 11:29:34 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-116-100.ams2.redhat.com [10.36.116.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 09E9060494; Mon, 25 Sep 2017 11:29:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 81F5F7E446 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=dgilbert@redhat.com From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, quintela@redhat.com, peterx@redhat.com, famz@redhat.com Date: Mon, 25 Sep 2017 12:29:16 +0100 Message-Id: <20170925112917.21340-6-dgilbert@redhat.com> In-Reply-To: <20170925112917.21340-1-dgilbert@redhat.com> References: <20170925112917.21340-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 25 Sep 2017 11:29:34 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 5/6] migration: Route errors up through vmstate_save 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: peter.maydell@linaro.org, cohuck@redhat.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: 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" Route the errors from vsmtate_save_state back up through vmstate_save and out to the normal device state path. That's the normal error path done. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Cornelia Huck Reviewed-by: Juan Quintela Reviewed-by: Peter Xu --- migration/savevm.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index e9feade46a..4a88228614 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -768,14 +768,14 @@ static void vmstate_save_old_style(QEMUFile *f, SaveS= tateEntry *se, QJSON *vmdes } } =20 -static void vmstate_save(QEMUFile *f, SaveStateEntry *se, QJSON *vmdesc) +static int vmstate_save(QEMUFile *f, SaveStateEntry *se, QJSON *vmdesc) { trace_vmstate_save(se->idstr, se->vmsd ? se->vmsd->name : "(old)"); if (!se->vmsd) { vmstate_save_old_style(f, se, vmdesc); - return; + return 0; } - vmstate_save_state(f, se->vmsd, se->opaque, vmdesc); + return vmstate_save_state(f, se->vmsd, se->opaque, vmdesc); } =20 /* @@ -1171,7 +1171,11 @@ int qemu_savevm_state_complete_precopy(QEMUFile *f, = bool iterable_only, json_prop_int(vmdesc, "instance_id", se->instance_id); =20 save_section_header(f, se, QEMU_VM_SECTION_FULL); - vmstate_save(f, se, vmdesc); + ret =3D vmstate_save(f, se, vmdesc); + if (ret) { + qemu_file_set_error(f, ret); + return ret; + } trace_savevm_section_end(se->idstr, se->section_id, 0); save_section_footer(f, se); =20 @@ -1313,6 +1317,8 @@ static int qemu_save_device_state(QEMUFile *f) cpu_synchronize_all_states(); =20 QTAILQ_FOREACH(se, &savevm_state.handlers, entry) { + int ret; + if (se->is_ram) { continue; } @@ -1325,7 +1331,10 @@ static int qemu_save_device_state(QEMUFile *f) =20 save_section_header(f, se, QEMU_VM_SECTION_FULL); =20 - vmstate_save(f, se, NULL); + ret =3D vmstate_save(f, se, NULL); + if (ret) { + return ret; + } =20 save_section_footer(f, se); } --=20 2.13.5