From nobody Fri Mar 27 04:59:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=yandex-team.ru ARC-Seal: i=1; a=rsa-sha256; t=1772659556; cv=none; d=zohomail.com; s=zohoarc; b=WELqhXpg/4xZn1Ncm/PvmwqCUnmN1mHjC0DjjNK0RV1H3EWulNVrMJViHSrCvoIKQr9F/leu+MNrrjbuSbqz4IdmuvXApqGNyNs+ktMvyePXIJZZCGL1ybC0hM9bXRoMFg4wwzOo8tvMSnrXutQKHVhXg25Xphn2mfO+j8pTj14= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1772659556; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=b903USOXw+LRA08/3dDz6NTxu0OalX40Au3wN2Ylaks=; b=IdvPq15pfzCM7ziF977H8WFHmQ7q0n/oBB980XNfwChs9dK15JIF0etdppB3Nz9sPSptCeqrXc5X+hvM/p/xCG8qh9J9Wnx0je2yTqWHdREs524P5O9DsLJsAalegSu3o9qzwoR7PVLxVANxbQwxpSg8QL2TaHm6yg0w/IBaUaU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1772659556924931.1877112148965; Wed, 4 Mar 2026 13:25:56 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vxth6-0004os-BE; Wed, 04 Mar 2026 16:23:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vxtgb-0004k0-H5 for qemu-devel@nongnu.org; Wed, 04 Mar 2026 16:23:20 -0500 Received: from forwardcorp1d.mail.yandex.net ([178.154.239.200]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vxtgW-0003RG-5q for qemu-devel@nongnu.org; Wed, 04 Mar 2026 16:23:16 -0500 Received: from mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:bf1f:0:640:c739:0]) by forwardcorp1d.mail.yandex.net (Yandex) with ESMTPS id 826D8807B5; Thu, 05 Mar 2026 00:23:07 +0300 (MSK) Received: from vsementsov-lin (unknown [2a02:6bf:8080:921::1:1b]) by mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id 5NwBA90AmW20-KJyIneIV; Thu, 05 Mar 2026 00:23:07 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1772659387; bh=b903USOXw+LRA08/3dDz6NTxu0OalX40Au3wN2Ylaks=; h=Message-ID:Date:In-Reply-To:Cc:Subject:References:To:From; b=tcReHW9qSngPlYuH62BdhkQm/B6m82pe0TUGNTiEhqad/CJs1062RbdQ6iTfXVc+t 3fNoahvzjntYOwkhRodrW3DfcUwqF2b45zFuAa/87Y7yQ9xJRFCH/O0dC65RLPg0Z1 2vZZvFDzdGCNU0+N2cEXMp80+ywDYyHrQm0wBQZs= Authentication-Results: mail-nwsmtp-smtp-corp-main-66.iva.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: Vladimir Sementsov-Ogievskiy To: peterx@redhat.com Cc: farosas@suse.de, vsementsov@yandex-team.ru, qemu-devel@nongnu.org Subject: [PATCH v3 01/18] migration: vmstate_save_state_v: fix double error_setg Date: Thu, 5 Mar 2026 00:22:45 +0300 Message-ID: <20260304212303.667141-2-vsementsov@yandex-team.ru> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260304212303.667141-1-vsementsov@yandex-team.ru> References: <20260304212303.667141-1-vsementsov@yandex-team.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=178.154.239.200; envelope-from=vsementsov@yandex-team.ru; helo=forwardcorp1d.mail.yandex.net X-Spam_score_int: 0 X-Spam_score: -0.0 X-Spam_bar: / X-Spam_report: (-0.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.703, RCVD_IN_VALIDITY_SAFE_BLOCKED=1.386, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.ru) X-ZM-MESSAGEID: 1772659558052139100 Content-Type: text/plain; charset="utf-8" We may call error_setg twice on same errp if inner vmstate_save_state_v() or vmstate_save_state() call fails. Next we will crash on assertion in error_setv(). Fixes: 848a0503422d043 "migration: Update error description outside migrati= on.c" Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Fabiano Rosas Reviewed-by: Peter Xu --- migration/vmstate.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/migration/vmstate.c b/migration/vmstate.c index 4d28364f7ba..fccd030dfd1 100644 --- a/migration/vmstate.c +++ b/migration/vmstate.c @@ -539,6 +539,9 @@ int vmstate_save_state_v(QEMUFile *f, const VMStateDesc= ription *vmsd, } else { ret =3D inner_field->info->put(f, curr_elem, size, inner_field, vmdesc_loop); + if (ret < 0) { + error_setg(errp, "put failed"); + } } =20 written_bytes =3D qemu_file_transferred(f) - old_offset; @@ -551,8 +554,8 @@ int vmstate_save_state_v(QEMUFile *f, const VMStateDesc= ription *vmsd, } =20 if (ret) { - error_setg(errp, "Save of field %s/%s failed", - vmsd->name, field->name); + error_prepend(errp, "Save of field %s/%s failed: ", + vmsd->name, field->name); if (vmsd->post_save) { vmsd->post_save(opaque); } --=20 2.52.0