From nobody Fri Mar 29 15:39:23 2024 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=1631704675; cv=none; d=zohomail.com; s=zohoarc; b=iHMrdDYTPUf1LJsXCX2zg7Q0M6KSNzkjs1E98ahKkewkagLLLNo61Vd1WPwzh0a5WgFOYXmklc0S1lsUpwQY994o6WbzEriqk3ILXcYNBJhLLDFyXfDe198nOfcM2VtoSjSGoZFGk/73LSPt1MuF8hkDJhYg3JEebEhuRHFSw5A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631704675; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=MifOs7SMunzKx0vm32Hem0XOgU9R3rOSyfuYvkZleZI=; b=lY6Tq62w2d36uAbDHZMhsHnizdW8thelaRgGDJkX4w/4bPltNELRY5cg5f/KcROPMY7y/5VSxvM9JIu96NMAIuH+UpAiT7wHPsB2RiB2OG2e8qnErdAIa1YF1xWfkBryJkoBholZhxEhlzpewt+qT1TOaLqG17JjhUI7o+t3m1Q= 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 16317046756231017.293910038882; Wed, 15 Sep 2021 04:17:55 -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-300-_JNWLsxcMWyeshe1ObauuQ-1; Wed, 15 Sep 2021 07:17:53 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 981D35074B; Wed, 15 Sep 2021 11:17:47 +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 79D7760C7F; Wed, 15 Sep 2021 11:17:47 +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 23E274EA3D; Wed, 15 Sep 2021 11:17:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 18FBEI4D030195 for ; Wed, 15 Sep 2021 07:14:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3E6BE18AD4; Wed, 15 Sep 2021 11:14:18 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 32FE16D981; Wed, 15 Sep 2021 11:14:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631704674; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=MifOs7SMunzKx0vm32Hem0XOgU9R3rOSyfuYvkZleZI=; b=Lq+SQz0QVXFGirE/Vz2AivFD8bX6gVCvQFijyltXKbiFx37MyMzxZn3vEgrtBgbV0J69KH m2BHR8/NUyLPcZ7S3IEnQTPZWVeSjJc2a8z02+6PuAcGwi/oN3c4s+YvVzUinapcE+AUue jwO7hmLCg8Ho3ZOMi+6aWIDspE+Dtxg= X-MC-Unique: _JNWLsxcMWyeshe1ObauuQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH] qemu: validate: Allow 'preserve' action for on_crash lifecycle action Date: Wed, 15 Sep 2021 13:14:09 +0200 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Christian Borntraeger , Peter Krempa 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.12 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: 1631704676830100001 Content-Type: text/plain; charset="utf-8" In fact keeping the VM around for debugging is a desirable configuration and actually the implementation has no code as we keep the VM around. Remove the validation and add a note that it's actually used. Fixes: b1b85a475fb251b9068b75f629479f5c452f1b43 Reported-by: Christian Borntraeger Signed-off-by: Peter Krempa Acked-by: Christian Borntraeger Reviewed-by: Boris Fiuczynski --- src/qemu/qemu_driver.c | 1 + src/qemu/qemu_validate.c | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index dfc27572c4..6ae678b165 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -3647,6 +3647,7 @@ processGuestPanicEvent(virQEMUDriver *driver, break; case VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE: + /* the VM is kept around for debugging */ break; default: diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 9d93f373ab..6b685881a8 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -1083,10 +1083,9 @@ qemuValidateLifecycleAction(virDomainLifecycleAction= onPoweroff, /* 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) { + onReboot =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'")); + _("qemu driver doesn't support the 'preserve' actio= n for 'on_reboot'/'on_poweroff'")); return -1; } --=20 2.31.1