From nobody Mon Feb 9 07:05:17 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=fOpa8v0gO6POxZ9fYa8P2naeLTrFscHB/xpVoJ+GxCLsdFfhypWzhemGxHYJOFLcLB2hllH9l3EnsmGrDa0nb6Y6oCskVR1UHo4+nJ6lBvfpCh5BWZD97tS+/UKRhga7nWa+XN2vzBIT+6Sx9hMQ8uN3B1Hq4fKQoySJPQ+x0MI= 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=MyK23C0zGIidN+JyXiOevZirX8h1fl7stPS8vzBrY5o=; b=GLw+sW/OvYJe14JyBer8h61pzFT5CelTflX9UPGkDDoAkoLWihmDtKVEQhOPiajBKyvVeE1Z6qg3FpG7daM63XlZ70EiI9Rz9rKLkap/VfTSwqhE/zFSNU3tUmJDqZeCvA+AC+SpkTDfVrhTJpT9M5PdZIk4H4O5QGL+W6s4oIg= 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 1636993622592648.5805638146214; 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-60-5M70pYKgPL6XfiWIyYmaBw-1; Mon, 15 Nov 2021 11:26:58 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CF92BC745C; Mon, 15 Nov 2021 16:26:26 +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 B4CFD22719; Mon, 15 Nov 2021 16:26:26 +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 803D51832DD2; Mon, 15 Nov 2021 16:26:26 +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 1AFGNCJv028249 for ; Mon, 15 Nov 2021 11:23:12 -0500 Received: by smtp.corp.redhat.com (Postfix) id 00549197FC; Mon, 15 Nov 2021 16:23:12 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.194.97]) by smtp.corp.redhat.com (Postfix) with ESMTP id 708DB60657 for ; Mon, 15 Nov 2021 16:23:11 +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=MyK23C0zGIidN+JyXiOevZirX8h1fl7stPS8vzBrY5o=; b=GnDOGHiIImYsEhejx3H1fr/aOn68JcPiJiBBUwZKyO/H4Pvo2mlSGLavi78DHxf83cDFsH EMIieepy4LxsuzNELL5kYUjXYNKEOBWOra5qEst5OYvjiE5+/rUv1BbSHIQLMPM8ryExP2 XslZRA0KAgr+l43UkeYRnhYINSBbJPo= X-MC-Unique: 5M70pYKgPL6XfiWIyYmaBw-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 06/11] test: snapshot revert: always error out if VM XML is missing Date: Mon, 15 Nov 2021 17:22:49 +0100 Message-Id: <575b2aac6cb83044de37bb02e64194e24dd1e0bf.1636993188.git.phrdina@redhat.com> 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.13 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: 1636993623041100001 Content-Type: text/plain; charset="utf-8" We should have this check even if FORCE flag is used because later we unconditionally copy the `snap->def->dom` and error out if there is no copy created. The test driver will always save the VM XML when creating new snapshot. Signed-off-by: Pavel Hrdina Reviewed-by: Peter Krempa --- src/test/test_driver.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index ea474d55ac..2fa78a15d6 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -9043,13 +9043,14 @@ testDomainRevertToSnapshot(virDomainSnapshotPtr sna= pshot, goto cleanup; } =20 + if (!snap->def->dom) { + virReportError(VIR_ERR_SNAPSHOT_REVERT_RISKY, + _("snapshot '%s' lacks domain '%s' rollback info"), + snap->def->name, vm->def->name); + goto cleanup; + } + if (!(flags & VIR_DOMAIN_SNAPSHOT_REVERT_FORCE)) { - if (!snap->def->dom) { - virReportError(VIR_ERR_SNAPSHOT_REVERT_RISKY, - _("snapshot '%s' lacks domain '%s' rollback inf= o"), - snap->def->name, vm->def->name); - goto cleanup; - } if (virDomainObjIsActive(vm) && !(snapdef->state =3D=3D VIR_DOMAIN_SNAPSHOT_RUNNING || snapdef->state =3D=3D VIR_DOMAIN_SNAPSHOT_PAUSED) && --=20 2.31.1