From nobody Mon Feb 9 01:19:53 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=1636993622; cv=none; d=zohomail.com; s=zohoarc; b=DBjSx+FWrcFarE0eVNRniW4XDVzrVXJxdDBHnMWeZuMnOl8QH1MJiuNFeqAVfSfjYoxX2hIQOm6l+UenB0U2eVe3+Qi8UsVRbMX7zkwEoLrc2oyYUSdS/SQ840gyrHLZPRd34tbUoDt5+SAJTUZmS39zQue3dH1dqUwx4dzWeX8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636993622; 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=iTGnZWfmGKYpK23eLQxd1wo2dEePlFbQw6Opu0G6yJw=; b=ikApZNZmKgBR5IDdBIIP0noreJG40qvppdgns5TdeEGc20AnUa9gD3U57zi5MVK2dXyThtDbHhN3hYB22PmBanjKc86Fdr1tIDsM64OXAbsVEDIKFWOswS2VlJjTkq0lfEpjvXsN1nl5MdvNLMRnz9Uirp3iuFizNvRIKRik54k= 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 1636993622620867.5696994266051; Mon, 15 Nov 2021 08:27:02 -0800 (PST) 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-278-OmA3O8OZMaSfpF-LwA13Aw-1; Mon, 15 Nov 2021 11:27:00 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 53EC919611CB; Mon, 15 Nov 2021 16:26:30 +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 34E5C5DEFB; Mon, 15 Nov 2021 16:26:30 +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 F25F84A703; Mon, 15 Nov 2021 16:26:29 +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 1AFGNDmN028263 for ; Mon, 15 Nov 2021 11:23:13 -0500 Received: by smtp.corp.redhat.com (Postfix) id BFF4319EF9; Mon, 15 Nov 2021 16:23:13 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.194.97]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3C71060657 for ; Mon, 15 Nov 2021 16:23:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636993621; 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=iTGnZWfmGKYpK23eLQxd1wo2dEePlFbQw6Opu0G6yJw=; b=d11uFz4lSvRoXZzc109ehQHl6f05O1ojVnRtfMAsIqfp1sOemVCBVPTmzFp4UNjk1aIs7h eMfRldsscFHjB5/7n1TXPOg4Jsr8Xjs5bbAqxCqKQW4Nt5wGsY84LNKScnMkkqOupcbPE7 UhIS8tp8E8f7bb3YxYHYagoU2oacpro= X-MC-Unique: OmA3O8OZMaSfpF-LwA13Aw-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 08/11] test: snapshot revert: drop unused code Date: Mon, 15 Nov 2021 17:22:51 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.14 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: 1636993623138100003 Content-Type: text/plain; charset="utf-8" Now that we always emulate VM process stop we can drop the unused code and simply the logic. Signed-off-by: Pavel Hrdina --- src/test/test_driver.c | 33 ++++++++------------------------- 1 file changed, 8 insertions(+), 25 deletions(-) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 0da8a2ea0f..4ae68571ef 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -9083,35 +9083,18 @@ testDomainRevertToSnapshot(virDomainSnapshotPtr sna= pshot, VIR_DOMAIN_EVENT_STO= PPED, VIR_DOMAIN_EVENT_STO= PPED_FROM_SNAPSHOT); virObjectEventStateQueue(privconn->eventState, event); - goto load; - - if (virDomainObjGetState(vm, NULL) =3D=3D VIR_DOMAIN_RUNNING) { - /* Transitions 5, 6 */ - was_running =3D true; - virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, - VIR_DOMAIN_PAUSED_FROM_SNAPSHOT); - /* Create an event now in case the restore fails, so - * that user will be alerted that they are now paused. - * If restore later succeeds, we might replace this. */ - event =3D virDomainEventLifecycleNewFromObj(vm, - VIR_DOMAIN_EVENT_SUSPENDED, - VIR_DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT); - } - virDomainObjAssignDef(vm, config, false, NULL); - } else { - /* Transitions 2, 3 */ - load: was_stopped =3D true; - virDomainObjAssignDef(vm, config, false, NULL); - if (testDomainStartState(privconn, vm, - VIR_DOMAIN_RUNNING_FROM_SNAPSHOT) < 0) - goto cleanup; - event =3D virDomainEventLifecycleNewFromObj(vm, - VIR_DOMAIN_EVENT_STARTED, - VIR_DOMAIN_EVENT_STARTED_FROM_SNAPSHOT); } =20 + virDomainObjAssignDef(vm, config, false, NULL); + if (testDomainStartState(privconn, vm, + VIR_DOMAIN_RUNNING_FROM_SNAPSHOT) < 0) + goto cleanup; + event =3D virDomainEventLifecycleNewFromObj(vm, + VIR_DOMAIN_EVENT_STARTED, + VIR_DOMAIN_EVENT_STARTED_FROM_SNAPSHOT); + /* Touch up domain state. */ if (!(flags & VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING) && (snapdef->state =3D=3D VIR_DOMAIN_SNAPSHOT_PAUSED || --=20 2.31.1