From nobody Fri Dec 19 20:15:47 2025 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=1629816336; cv=none; d=zohomail.com; s=zohoarc; b=Q20QfsagZzbk1nAisvMTfd4RIzeAlNCfeWlNHIfF/JcgewZUvqu8RfuJkpzrU0Vojn5GGKdXAa7ejEILmdoV2Xh+IDBg4RdYFTXOppITpLllVmmm+Tcn5nQyO9KQLc4WyVgd+rpyR1SR+yP8sr3Hhqfw79VoOwqXIDHqoQH5Zk4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629816336; 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=oTtnI7rktKXaFGSIMZLGDOq+5Gg1DsBXMGtPOWQfHdg=; b=JIwSyW/qUVwKisE5sJ+R0AyHAz+/1mYJpRZY5tJdKDxcMXfD+rxBdcyJArP9qYZ0sl44nFfuQku5g01w5MT7jOZdosNtbL28KQlcmc+YCTYVRxuCiFozVMLhrFaYpU561BQO4D761a/UAFDGfC2yjuT/Dzs9h0OHTamnaeBScdo= 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 1629816336405267.3568474253533; Tue, 24 Aug 2021 07:45:36 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-562-pGhTCzguOVSuePkCIMpqDA-1; Tue, 24 Aug 2021 10:45:33 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8052B8015C7; Tue, 24 Aug 2021 14:45:27 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 578991BCF0; Tue, 24 Aug 2021 14:45:27 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 25E004A708; Tue, 24 Aug 2021 14:45:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 17OEjQXw005648 for ; Tue, 24 Aug 2021 10:45:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id A91121ABDF; Tue, 24 Aug 2021 14:45:26 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0CB2A6A900 for ; Tue, 24 Aug 2021 14:45:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629816335; 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=oTtnI7rktKXaFGSIMZLGDOq+5Gg1DsBXMGtPOWQfHdg=; b=bFcnk1kSNyJOP2eWA5DbzejYIGYXYGX50NfvnHpet8HAKa5bxOKlShxOt7xFNpfDoSKNlH RD91AnihYv5mQLN4o3amMvqwpxDbcYiemNsHiftldkhxQuUflaXbMkJB0hpU/+jUaoI6gN 3A3T9nm4JHS+nKnXBS+phxI01ObKua8= X-MC-Unique: pGhTCzguOVSuePkCIMpqDA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 07/22] qemu: Reject 'preserve' action for 'on_reboot'/'on_poweroff'/'on_crash' Date: Tue, 24 Aug 2021 16:44:28 +0200 Message-Id: <3acede348de5a54d2f2e9c567887265682d23a44.1629816141.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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: 1629816337171100001 Content-Type: text/plain; charset="utf-8" The qemu driver didn't ever implement any meaningful handling for the 'preserve' action. Forbid the flag in the qemu def validator and update the documentation to be factual. Signed-off-by: Peter Krempa --- docs/formatdomain.rst | 3 +-- src/qemu/qemu_validate.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index fba4765e35..a894a51c00 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -1747,8 +1747,7 @@ Each of these states allow for the same four possible= actions. supported by the libxl hypervisor driver.) QEMU/KVM supports the ``on_poweroff`` and ``on_reboot`` events handling the -``destroy`` and ``restart`` actions. The ``preserve`` action for an -``on_reboot`` event is treated as a ``destroy``. +``destroy`` and ``restart`` actions. The ``on_crash`` event supports these additional actions :since:`since 0.8= .4` . diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 7bd8d8d9e7..d27c3b6c6c 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -1079,6 +1079,16 @@ qemuValidateLifecycleAction(virDomainLifecycleAction= onPoweroff, return -1; } + /* The qemu driver doesn't yet implement any meaningful handling for + * VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE */ + if (onPoweroff =3D=3D VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE || + onReboot =3D=3D VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE || + onCrash =3D=3D VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("qemu driver doesn't support the 'preserve' actio= n for 'on_reboot'/'on_poweroff'/'on_crash'")); + return -1; + } + return 0; } --=20 2.31.1