From nobody Fri Dec 19 20:16:05 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=1629816424; cv=none; d=zohomail.com; s=zohoarc; b=jnsrhncVs1gHRAUcePuzaAhWCAQeKNE1m+fHCUAV7Ir9pbHJKDAbI39m+kpx6uJ5h7RVCSxt4OBijBi9tTj1WSMZ74S88f0LMdr76GEuovv3Wxlm1e0duxR8UQx7RsklLBFh2UNXWYSm9YQ0NmUrB1l3HtZxOQSjgEyliQluHgQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629816424; 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=yhWrxZd46IdvVuTmGDt+VTi7UQURNXB+trMA59/VO14=; b=d9+GlsVwX4EEOk6Yh3y/3VgduKOkOeM5RvB81rAThxYlF5ArsFC4X5M7ZfnxxtuvIfWIPqtR6lXLyEbeR4c5OOzTqfwTGbbiW7hBkqs8Hvvg6LDMv2PpbFXVYN3AJCDgsYt1iq1KsLaEIXOoejjcolnzZ5C9vlwFo/HXo/cYkFk= 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 1629816424132726.8316842053216; Tue, 24 Aug 2021 07:47:04 -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-136-iCgbdn7gPCSSmCk1LoUC2g-1; Tue, 24 Aug 2021 10:45:50 -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 A52ED804037; Tue, 24 Aug 2021 14:45:44 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8876E60C0F; Tue, 24 Aug 2021 14:45:44 +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 56C04181A3F6; Tue, 24 Aug 2021 14:45:44 +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 17OEjgQ3005913 for ; Tue, 24 Aug 2021 10:45:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 397CE17D4E; Tue, 24 Aug 2021 14:45:42 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id 878381BCF0 for ; Tue, 24 Aug 2021 14:45:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629816423; 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=yhWrxZd46IdvVuTmGDt+VTi7UQURNXB+trMA59/VO14=; b=gkiaYBe/wrNX3GpBpxlo9/ssN1lBradc9BEVtjOb3gMoLZsPlim1GcGcndBT59R5hz4o1/ kEPRn+m1M/I1pmUv8p4unHOCh+V2rBUK9zsCCfgSCtwurm9dlMzP0M7Qg+Yl6THG4uMNHO fOcMsezPzEENPOgWZP1ZP9Yl0qLWW5U= X-MC-Unique: iCgbdn7gPCSSmCk1LoUC2g-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 17/22] qemuProcessHandleReset: Don't emulate lifecycle actions for RESET event Date: Tue, 24 Aug 2021 16:44:38 +0200 Message-Id: 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.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: 1629816424936100001 Content-Type: text/plain; charset="utf-8" The RESET event is delivered by qemu only when the guest OS is actually allowed to reboot ('-no-reboot' or equivalent is not used) and due to the nature of async handling of the events VM is actually already executing guest code after the reboot, until our code gets to killing it. In general it should have been impossible to reach a state where the reboot action is 'destroy' but we didn't use '-no-reboot' but due to various bugs it was. Due to the fact that this was not a desired operation and additionally guest code already is executing I think the best option is not to kill the VM any more (possible data loss?) and rely for the proper fix where we use the new 'set-action' QMP command to enable an equivalent behaviour to '-no-reboot' during runtime. Signed-off-by: Peter Krempa --- src/qemu/qemu_process.c | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index c9cdff4e82..a839d587c2 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -443,27 +443,6 @@ qemuProcessHandleReset(qemuMonitor *mon G_GNUC_UNUSED, if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0) VIR_WARN("Failed to save status on vm %s", vm->def->name); - if (vm->def->onReboot =3D=3D VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY || - vm->def->onReboot =3D=3D VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE) { - - if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) - goto cleanup; - - if (!virDomainObjIsActive(vm)) { - VIR_DEBUG("Ignoring RESET event from inactive domain %s", - vm->def->name); - goto endjob; - } - - qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_DESTROYED, - QEMU_ASYNC_JOB_NONE, 0); - virDomainAuditStop(vm, "destroyed"); - qemuDomainRemoveInactive(driver, vm); - endjob: - qemuDomainObjEndJob(driver, vm); - } - - cleanup: virObjectUnlock(vm); virObjectEventStateQueue(driver->domainEventState, event); } --=20 2.31.1