From nobody Fri Nov 21 10:12:04 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1763545548; cv=none; d=zohomail.com; s=zohoarc; b=lqpuwgn5A199w6cSlEh8zBNcHVgAcW++YhPZt0216Egi7fZZmsiCftp54kuijKbPGmIls0pq5+TNKhsygVjzOq6D2/OH2RDNBXgmJZYlHYGfIQ3oWvq4QzDeIpP7xMMhV8CIBMuCYpOup0R4BQqNYRpfaK6m3lPdSneiKg1qND0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1763545548; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=ApDkDClmcCSY6cCHk0pre9kFFqU2CrNpdNjq+9zj+Rg=; b=KNf39Tt3XQkO0Uc245p8OTX0aG4TSBXjqzELLRAijEqp9wFW4e4JdY59H4yRi6sobpD4mdSEtayuf5XK7Op911MA1vm99TZc/AxiL3xsDPGUImmYTrOJNoJsQNFetEVnFpfgDxi376FIY1m+usamKuZbDJGuDQ3iTXOKeBhCWzM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1763545548099385.49608579501864; Wed, 19 Nov 2025 01:45:48 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 6171243FF7; Wed, 19 Nov 2025 04:45:44 -0500 (EST) Received: from [172.19.199.50] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 8E46F441FD; Wed, 19 Nov 2025 04:38:36 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 3D8F144067; Wed, 19 Nov 2025 04:38:14 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id D086B43F45 for ; Wed, 19 Nov 2025 04:38:03 -0500 (EST) Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-390-t2AHAJNOP5KBf20_9rYM0g-1; Wed, 19 Nov 2025 04:38:01 -0500 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8EE871800561 for ; Wed, 19 Nov 2025 09:38:00 +0000 (UTC) Received: from speedmetal.openshiftapps.com (unknown [10.45.242.12]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B461C18004A3 for ; Wed, 19 Nov 2025 09:37:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1763545083; h=from:from: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; bh=ApDkDClmcCSY6cCHk0pre9kFFqU2CrNpdNjq+9zj+Rg=; b=VDAqrD5nBvS4SXLJh7OSEFq0XeMQebG36VOWDpbs0fXaiyKtwEEtNkkE7Eyxq6lh2d/+Ca f4ejsQPvPqnRP/M/0W7Tuo/v2SRKadHHiL79pPJbwCaI5JSTl3/nCXiWChxaAwStb8+76S b3Z0XX02grbgb73qUfFW/vfKGnjpQT4= X-MC-Unique: t2AHAJNOP5KBf20_9rYM0g-1 X-Mimecast-MFC-AGG-ID: t2AHAJNOP5KBf20_9rYM0g_1763545080 To: devel@lists.libvirt.org Subject: [PATCH 5/8] lib: Introduce VIR_DOMAIN_EVENT_SUSPENDED_GUEST_SHUTDOWN event reason Date: Wed, 19 Nov 2025 10:37:48 +0100 Message-ID: <084fa1de95aba92a6c4cdfc6fea98edc9da629df.1763544909.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: JRL6k9kRqXfRUIjagSfULGrgRWChucIfUN6rwnZvikM_1763545080 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: QUEZ2FW5TM7EWK4ZX3EES76Q247QJEUP X-Message-ID-Hash: QUEZ2FW5TM7EWK4ZX3EES76Q247QJEUP X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1763545549621153000 Content-Type: text/plain; charset="utf-8" From: Peter Krempa Upcoming patches will introduce the possibility for the domain to be kept paused after the guest OS shuts itself down. It'll allow jobs such as backup to finish as e.g. in the qemu driver it requires the qemu process. Add an the appropriate reason for the VIR_DOMAIN_EVENT_SUSPENDED lifecycle event. Signed-off-by: Peter Krempa --- examples/c/misc/event-test.c | 3 +++ include/libvirt/libvirt-domain.h | 1 + tools/virsh-domain-event.c | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/c/misc/event-test.c b/examples/c/misc/event-test.c index 347ec44682..2ce82ca9e0 100644 --- a/examples/c/misc/event-test.c +++ b/examples/c/misc/event-test.c @@ -180,6 +180,9 @@ eventDetailToString(int event, case VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY_FAILED: return "Post-copy Error"; + case VIR_DOMAIN_EVENT_SUSPENDED_GUEST_SHUTDOWN: + return "guest OS shutdown"; + case VIR_DOMAIN_EVENT_SUSPENDED_LAST: break; } diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-dom= ain.h index 56bd085ef5..a2cf762e1a 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -5401,6 +5401,7 @@ typedef enum { VIR_DOMAIN_EVENT_SUSPENDED_API_ERROR =3D 6, /* Some APIs (e.g., migrat= ion, snapshot) internally need to suspend a domain. This event detail is us= ed when resume operation at the end of such API fails. (Since: 1.0.1) */ VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY =3D 7, /* suspended for post-copy = migration (Since: 1.3.3) */ VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY_FAILED =3D 8, /* suspended after f= ailed post-copy (Since: 1.3.3) */ + VIR_DOMAIN_EVENT_SUSPENDED_GUEST_SHUTDOWN =3D 9, /* suspended after gu= est os shut-down (a long running job is preserving the VM until completion)= (Since: 11.10.0) */ # ifdef VIR_ENUM_SENTINELS VIR_DOMAIN_EVENT_SUSPENDED_LAST /* (Since: 0.9.10) */ diff --git a/tools/virsh-domain-event.c b/tools/virsh-domain-event.c index a47fdfc7fd..b9d1cdf019 100644 --- a/tools/virsh-domain-event.c +++ b/tools/virsh-domain-event.c @@ -85,7 +85,8 @@ VIR_ENUM_IMPL(virshDomainEventSuspended, N_("Snapshot"), N_("API error"), N_("Post-copy"), - N_("Post-copy Error")); + N_("Post-copy Error"), + N_("guest shutdown")); VIR_ENUM_DECL(virshDomainEventResumed); VIR_ENUM_IMPL(virshDomainEventResumed, --=20 2.51.1