From nobody Mon Feb 9 03:52:39 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1654087927; cv=none; d=zohomail.com; s=zohoarc; b=aj9xto7CJuSVsMO2eLdfWgtz0w3j0X7joFzsuP2iGVGmWoTpPOtQgzTVCarISL+OgypS7UuAxZYoJj2h1y8CPUw1wl+8lntoCZM0EKZDqzG5emaG/S6RywXxqObAvb3Io28NFAsqE/txZLr5lGg9UxsBxliKAjf+z+NFkrjQOK0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654087927; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=a4alOgYcbc0eJhQwVl9HSQy1a0P7ZjFF9l/7lGfHoY8=; b=Xid1OytzLSRp6/8oTGz+xeNk1htH7hqRg4l48AGpOc7RnZs+TGsStHcpL6Om15+aMuFwJAv8P+hEK8G5fHKhceay9S9dZQ9aWg7gbhUfDRPCYNZfBp8KA3IrDM3U0OFOdnn8OGBTdfjy0vBNuc/c41pRQyxQnRD7/sOVz5BFBoE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1654087927897140.41785082521915; Wed, 1 Jun 2022 05:52:07 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-34-A3nP7GPwPUGcj_oFQYPTAA-1; Wed, 01 Jun 2022 08:51:34 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D5A5739796B3; Wed, 1 Jun 2022 12:50:40 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id BD4598288C; Wed, 1 Jun 2022 12:50:40 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B6F061955EC8; Wed, 1 Jun 2022 12:50:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 4D08319452D2 for ; Wed, 1 Jun 2022 12:50:29 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 131A5C27E97; Wed, 1 Jun 2022 12:50:29 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.227]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E6A3EC27E98; Wed, 1 Jun 2022 12:50:28 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 86233245B69; Wed, 1 Jun 2022 14:50:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654087926; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=a4alOgYcbc0eJhQwVl9HSQy1a0P7ZjFF9l/7lGfHoY8=; b=ePan9nAwTXbCReOg2M685AcOk2x7t/CJ/kgllyoBSSJoA/KMJXbz1WzJupj3/jiFgHYzl/ teFBrifhnwSAiay8e/wFbiockOuzrvGPJVZK1C9ipWBcVDNHvPlZqxqqXahrfo1QZpgOjN 0mvzEWsQi42BQ7bnvjfJOOo8NhW4oZE= X-MC-Unique: A3nP7GPwPUGcj_oFQYPTAA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH v2 29/81] qemu: Preserve error in qemuMigrationDstFinish Date: Wed, 1 Jun 2022 14:49:29 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Krempa , Pavel Hrdina Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1654087928117100001 Content-Type: text/plain; charset="utf-8" We want to prevent our error path that can potentially kill the domain on the destination host from overwriting an error reported earlier, but we were only doing so in one specific path when starting vCPUs fails. Let's do it in all paths. Signed-off-by: Jiri Denemark Reviewed-by: Peter Krempa Reviewed-by: Pavel Hrdina --- Notes: Version 2: - no change src/qemu/qemu_migration.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index fdc93d7fe1..10c4f7a470 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -5966,11 +5966,6 @@ qemuMigrationDstFinish(virQEMUDriver *driver, if (virGetLastErrorCode() =3D=3D VIR_ERR_OK) virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("resume operation failed")); - /* Need to save the current error, in case shutting - * down the process overwrites it - */ - virErrorPreserveLast(&orig_err); - /* * In v3 protocol, the source VM is still available to * restart during confirm() step, so we kill it off @@ -6043,6 +6038,10 @@ qemuMigrationDstFinish(virQEMUDriver *driver, return dom; =20 error: + /* Need to save the current error, in case shutting down the process + * overwrites it. */ + virErrorPreserveLast(&orig_err); + if (virDomainObjIsActive(vm)) { if (doKill) { qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_FAILED, --=20 2.35.1