From nobody Sun Feb 8 12:13:45 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=1638452344; cv=none; d=zohomail.com; s=zohoarc; b=nOAmiswbDKGW4kRg3iQoIw2glKIcxuumupAAJeIb6GpoOLElGoqqNKQCSM/3FbDdHZidMHAZgXh/EYMJ05c5Gz3xor5ZUWfuiOw9hhU0EHiyJCLscyYiHpdI+elvHHvPgQscWwr3vx5zkzKKUYqp9RA2ZSr4mCrBXz4mFKUP9YE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1638452344; 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=h9bb/sbXcMnptxBIVFGhqa1Q02XWU88ZuGGSELIqqg8=; b=jgU6owrsMxSXAb5k0vGVAiE7qObEt89Zfnq1v8WU/zpKJaMmWbCg/juG3WawDkBWwIp+KYzn3mKgh4tkmS+0a4andYZhuo5583n8UvQj2VARWAXg2shkeMomabI1xWVVpop0xjOaLcyQCZW+6T4HMf9a3SudOC28uaAuOYc3cRM= 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 1638452344282694.7311180428255; Thu, 2 Dec 2021 05:39:04 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-414-EN4JGXC3N8aGcfH8FKm4pA-1; Thu, 02 Dec 2021 08:37:53 -0500 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 0D0E2101F7B8; Thu, 2 Dec 2021 13:37:44 +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 DC1F15F4ED; Thu, 2 Dec 2021 13:37:43 +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 A51314A7C9; Thu, 2 Dec 2021 13:37:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1B2DXUUs021046 for ; Thu, 2 Dec 2021 08:33:30 -0500 Received: by smtp.corp.redhat.com (Postfix) id 23D975D9D5; Thu, 2 Dec 2021 13:33:30 +0000 (UTC) Received: from antique-work.lan (unknown [10.40.192.54]) by smtp.corp.redhat.com (Postfix) with ESMTP id 969445D9CA for ; Thu, 2 Dec 2021 13:33:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1638452343; 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=h9bb/sbXcMnptxBIVFGhqa1Q02XWU88ZuGGSELIqqg8=; b=LW33lRy5Kdm/6ktglqYeZA2PGYt517VGh+dQ/m+qThNp/nDvFpdIfXBwtf3BBBCFtTODHb 4pNfZb7F2Vyvvvq0n+eiVCVFSxDqXWWJ0+Rzlbzc2lggz1p2MbchoBavnuYah99OQyYm6v +ucuZkPZGJJirfZacCI73EELO190UPk= X-MC-Unique: EN4JGXC3N8aGcfH8FKm4pA-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 08/14] qemu_snapshot: revert: emit event right after they are created Date: Thu, 2 Dec 2021 14:33:15 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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: 1638452345398100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Pavel Hrdina --- src/qemu/qemu_snapshot.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index 589daaa73e..950b1a65ff 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -2131,6 +2131,7 @@ qemuSnapshotRevert(virDomainObj *vm, event =3D virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_STARTED, detail); + virObjectEventStateQueue(driver->domainEventState, event); if (rc < 0) goto endjob; =20 @@ -2145,6 +2146,7 @@ qemuSnapshotRevert(virDomainObj *vm, event2 =3D virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_SUSPENDED, detail); + virObjectEventStateQueue(driver->domainEventState, event2); } else { /* Transitions 2, 5, 8 */ if (!virDomainObjIsActive(vm)) { @@ -2178,6 +2180,7 @@ qemuSnapshotRevert(virDomainObj *vm, event =3D virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_STOPPED, detail); + virObjectEventStateQueue(driver->domainEventState, event); } =20 if (qemuSnapshotRevertInactive(driver, vm, snap) < 0) { @@ -2197,7 +2200,6 @@ qemuSnapshotRevert(virDomainObj *vm, =20 start_flags |=3D paused ? VIR_QEMU_PROCESS_START_PAUSED : 0; =20 - virObjectEventStateQueue(driver->domainEventState, event); rc =3D qemuProcessStart(snapshot->domain->conn, driver, vm, NU= LL, QEMU_ASYNC_JOB_START, NULL, -1, NULL, NU= LL, VIR_NETDEV_VPORT_PROFILE_OP_CREATE, @@ -2211,11 +2213,13 @@ qemuSnapshotRevert(virDomainObj *vm, event =3D virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_STARTED, detail); + virObjectEventStateQueue(driver->domainEventState, event); if (paused) { detail =3D VIR_DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT; event2 =3D virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_SUSPEND= ED, detail); + virObjectEventStateQueue(driver->domainEventState, event2); } } break; @@ -2261,8 +2265,6 @@ qemuSnapshotRevert(virDomainObj *vm, VIR_DOMAIN_EVENT_DEFINED, detail)); } - virObjectEventStateQueue(driver->domainEventState, event); - virObjectEventStateQueue(driver->domainEventState, event2); =20 return ret; } --=20 2.31.1