From nobody Mon Feb 9 04:45:02 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=1671115083; cv=none; d=zohomail.com; s=zohoarc; b=e4n8NinfNHIi/DkGm0SzeLe25aJPCEo+jbNNEuM1XA54GxcSMdWlcFMj7x1hWrIw4f1Q601+IqRl8eh43Gq/7lL+9IVRXjj/uuFrl7I6yV4G1jwSi6DOUFpW+rIfugjDNm71+9xsv2svfX44FW4kdZZz+S9k1hwUrcA4EFQL1LI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671115083; 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=zeLnWqoUHLSbWbF1PhA960PFsQBwcGKW8WHd6jXIMeY=; b=evR5TgAL6eZ1SAoi8+wrbbHFVgy2HHKNzt4TdTysA8XBBA0JCXhJWqLNmw7UtyUxpYlqMytQ6IQ174s/wUc41gPMSmd2WiWLOqhSKpg76m7OBIJ+b2MguGSdSeVASsCLqXCzBs+42D7wZjlhSPEmUqvRLOd26zkE1utozi3ZJew= 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 1671115083860880.0580282266195; Thu, 15 Dec 2022 06:38:03 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-311-OIwCYENpOEiO6s7gGr67Bg-1; Thu, 15 Dec 2022 09:37:57 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 14EC3857A84; Thu, 15 Dec 2022 14:37:54 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 01BC01121314; Thu, 15 Dec 2022 14:37:54 +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 EC01C19466DF; Thu, 15 Dec 2022 14:37:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 8E72319465B2 for ; Thu, 15 Dec 2022 14:37:52 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 81CC6492C3C; Thu, 15 Dec 2022 14:37:52 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.227]) by smtp.corp.redhat.com (Postfix) with ESMTP id 43677492C18 for ; Thu, 15 Dec 2022 14:37:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671115082; 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=zeLnWqoUHLSbWbF1PhA960PFsQBwcGKW8WHd6jXIMeY=; b=aLVJFVm5bYgEbo76OvvNGwC/AIj7tD7vjosfoprf1LdcP4RqArRr+XLxO2lUmsSrMohFsq D3a/1MtCyd4dTMB3sC3InmlW9VltUtUDzsBP4XUdrP5ojA1NNIO/IDeRe1gvP/Rshl2h5G qeDLnbB4n1M65zwr5D1lARWKl6sVtPs= X-MC-Unique: OIwCYENpOEiO6s7gGr67Bg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH 4/4] virDomainObjGetState: Promote VIR_DOMAIN_PAUSED_POSTCOPY_FAILED Date: Thu, 15 Dec 2022 15:37:44 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 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 3.1 on 10.11.54.3 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: 1671115085486100007 Content-Type: text/plain; charset="utf-8" In case a domain is in failed post-copy migration but paused for a different reason, report VIR_DOMAIN_PAUSED_POSTCOPY_FAILED instead to make it more visible. --- Notes: This commit is intentionally missing =20 Signed-off-by: Jiri Denemark =20 because I can find reasons for both pushing and not pushing this change. It is pretty ugly and masks the real reason behind the paused state. On the other hand, reporting the real reason means users would not really know post-copy migration failed unless they saw the corresponding event. src/conf/domain_conf.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index f83586c549..6097ea3ffc 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -27865,8 +27865,15 @@ virDomainObjCopyPersistentDef(virDomainObj *dom, virDomainState virDomainObjGetState(virDomainObj *dom, int *reason) { - if (reason) - *reason =3D dom->state.reason; + if (reason) { + if (dom->state.state =3D=3D VIR_DOMAIN_PAUSED && + dom->job && dom->job->asyncPaused && + (dom->job->asyncJob =3D=3D VIR_ASYNC_JOB_MIGRATION_IN || + dom->job->asyncJob =3D=3D VIR_ASYNC_JOB_MIGRATION_OUT)) + *reason =3D VIR_DOMAIN_PAUSED_POSTCOPY_FAILED; + else + *reason =3D dom->state.reason; + } =20 return dom->state.state; } --=20 2.39.0