From nobody Sun Feb 8 09:41:06 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1652196425; cv=none; d=zohomail.com; s=zohoarc; b=bgMm5c/sVYthbLmQTC0WYcy5MmbTMwSFkqlV5FQ81p8Sr/4Z/o+eM4YU1eVdtzxvWx9v0ACfdRPdIZwV6aCc9b2MTanbC+Juslbnnel4plA10QzvI48PS5bW0tx4Zjt/XB1n5e95FyGD9axghTVDHh6vpabjIscc1MKB+NSIqvg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652196425; h=Content-Type:Content-Transfer-Encoding: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=muC1kelk3dT0WimjIvVwSA/yDjNtNwi+24xjfpsi4MU=; b=C6HGRr1C3whosYyzn33+pib+q/TdUKWr6bInnuDAiEZIs2qSPfJrsROtShyBCU5K3t/bJjfUCyDdk0o1kvp50bKTzcRT8P4p3kma8W3NNZAopTzkXBFeJ6QakDBjpXhHUypjUptGnsFOm1fV2UYbq9R+9Dw7tBMnQj5Yi3F1YTY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1652196425666961.0045175011244; Tue, 10 May 2022 08:27:05 -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-275-TMIiqiZMMqC3S2NwsTamcA-1; Tue, 10 May 2022 11:22:56 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 64EFF38332AE; Tue, 10 May 2022 15:22:13 +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 51D1440CF8ED; Tue, 10 May 2022 15:22:13 +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 755ED1947BBB; Tue, 10 May 2022 15:22:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 6911519451F1 for ; Tue, 10 May 2022 15:21:48 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 35FBC463EDE; Tue, 10 May 2022 15:21:48 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.187]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 163C0463ED0 for ; Tue, 10 May 2022 15:21:48 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 99ADB244606; Tue, 10 May 2022 17:21:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652196424; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=muC1kelk3dT0WimjIvVwSA/yDjNtNwi+24xjfpsi4MU=; b=h21BMPA3tadDmeE1xyMTqUGOxLTAYIlZmkqXDbfVJQDECXCGuj0KgR8qq+K8ewcx9b0jfT GcLW0tYigNbAQ+MrVFpcLt98nMoa3OmrKXa6O147Pbau4i4W/Mj2hbufRgPPDnaG06Jcvx XI1dC8BE8R7tw5AtV8GGNuJn02U/PpU= X-MC-Unique: TMIiqiZMMqC3S2NwsTamcA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH 31/80] qemu: Preserve error in qemuMigrationDstFinish Date: Tue, 10 May 2022 17:20:52 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 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: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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: 1652196427381100002 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 --- 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 a6c8e53ac5..bbea2f6e0e 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -5997,11 +5997,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 @@ -6074,6 +6069,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