From nobody Sun Feb 8 23:37:15 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=1677855643; cv=none; d=zohomail.com; s=zohoarc; b=bee/yvTCPxUYagBMqwqb78IK221dkP2ZxXrOMCElIfaSeMdoV+M3Ir99SS6KjGd5KWheVgcXg0Kq2Qv/f1aoPcxm0RAhN2crTaWaVHfVkPXspJxkQ4MJ8xnRLNdPLkzcXjKCPoro+2tYnRyCnC0eo6PSlvlkaAt8DY+yixnnPwU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677855643; 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=mPQ6cfYmUp4T9W4xLV7u2yUMMVx328ILXoE7pFhR2tk=; b=PyrNOwK8Tzl1gzh0LLwWUen0+FteREtHJ4yGixXVaqCkdXWayD9g9WVyRpBZ2RgZ1RlIbXYyf50SkorR56tb55afizLIfhu2QHoNtldytMuLq3DuOmKLW0RCfb6y1Dy6F7zeccD3xnVewjy6CWtHa7uy3qD9wEKoqwQ6yEV99AM= 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 1677855643969711.7308632087518; Fri, 3 Mar 2023 07:00:43 -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-634-jyJPoQExMeqKScqnWcz-Sg-1; Fri, 03 Mar 2023 10:00:24 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 11F3B803D53; Fri, 3 Mar 2023 14:57:51 +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 E2A8C14171BB; Fri, 3 Mar 2023 14:57:50 +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 C4B79194866E; Fri, 3 Mar 2023 14:57:50 +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 4176019465A0 for ; Fri, 3 Mar 2023 14:57:50 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 37D4CC16027; Fri, 3 Mar 2023 14:57:50 +0000 (UTC) Received: from rein.int.mamuti.net (unknown [10.45.226.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id EE7C7C1602B for ; Fri, 3 Mar 2023 14:57:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677855643; 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=mPQ6cfYmUp4T9W4xLV7u2yUMMVx328ILXoE7pFhR2tk=; b=A2hZzxh+aOm6baw+O4+MbQed4GCViSg+z8LDlsyMiJ/VgNwfW4bIurO8NmzOvL+eRr2V0K OOHlwhdjrhb9UDoCv/PhMAnT0MgSyhsAi0HnbWuPiVac8gIJILjxyAJDYSh2zWYkrWE/RG wEXreaVsVmV2w7UQPAKY2tux7y3AsTk= X-MC-Unique: jyJPoQExMeqKScqnWcz-Sg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH 3/3] qemu_migration: Use VIR_DOMAIN_PAUSED_API_ERROR Date: Fri, 3 Mar 2023 15:57:44 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 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: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 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: 1677855656545100001 Content-Type: text/plain; charset="utf-8" Other APIs that internally use QEMU migration and need to temporarily suspend a domain already report failure to resume vCPUs by setting VIR_DOMAIN_PAUSED_API_ERROR state reason and emitting VIR_DOMAIN_EVENT_SUSPENDED event with VIR_DOMAIN_EVENT_SUSPENDED_API_ERROR. Let's do the same in qemuMigrationSrcRestoreDomainState for consistent behavior. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 2720f0b083..efec1b3be6 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -251,6 +251,16 @@ qemuMigrationSrcRestoreDomainState(virQEMUDriver *driv= er, virDomainObj *vm) * overwrite the previous error, though, so we just throw some= thing * to the logs and hope for the best */ VIR_ERROR(_("Failed to resume guest %s after failure"), vm->de= f->name); + if (virDomainObjGetState(vm, NULL) =3D=3D VIR_DOMAIN_PAUSED) { + virObjectEvent *event; + + virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, + VIR_DOMAIN_PAUSED_API_ERROR); + event =3D virDomainEventLifecycleNewFromObj(vm, + VIR_DOMAIN_EVENT= _SUSPENDED, + VIR_DOMAIN_EVENT= _SUSPENDED_API_ERROR); + virObjectEventStateQueue(driver->domainEventState, event); + } goto cleanup; } ret =3D true; --=20 2.39.2