From nobody Tue May 21 00:39:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1607505376; cv=none; d=zohomail.com; s=zohoarc; b=RIUfIEdKf+4p+sfwwffu1rLYTtTcI5c7uQzlpFkLu8upn4KHgxPSA7VnV8eAIScV65iKPw9bJqtoLyo/S8IpUAsiPRGxk7AsH42uP+tWDIivpzSMoGWmA1XPA7xziJMji4FB2Y+xWKlEGDD1RhJIqw+pWz5rocFLD2pxrGwO10k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607505376; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=QLVRLSe0O/pW4zC60SkL6JfBkYy3Qgrnt41lJyODz+s=; b=E82QULyXMCN5GnXbbloeqSmHW99RFjfkawxuFVK1SmFabwUNGhQ0r2U8YFM3wuTvQjDgXTMgbUlhInqvy42jlsRqTTtoNf58xNZfr5pRUpJToZCSkarLAR0Mqd/cxT862GiLhoDw4IVRB1+t3gne24S4qAK7y2rtEkYx3ZBtxC0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1607505376040688.1388979211382; Wed, 9 Dec 2020 01:16:16 -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-382-eTIwUrTYP1WGCaWRCZYhRQ-1; Wed, 09 Dec 2020 04:16:12 -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 2619B8143EA; Wed, 9 Dec 2020 09:16:07 +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 BB1CE5D6AB; Wed, 9 Dec 2020 09:16:05 +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 B865B180954D; Wed, 9 Dec 2020 09:16:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0B99FxKb025968 for ; Wed, 9 Dec 2020 04:15:59 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6AB8F5C234; Wed, 9 Dec 2020 09:15:59 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id C17D45C230 for ; Wed, 9 Dec 2020 09:15:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607505374; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=QLVRLSe0O/pW4zC60SkL6JfBkYy3Qgrnt41lJyODz+s=; b=As17haTmcf7D+XeIGDl4syw7ZeG0xv/XIc+S08wHByRmUziihnikOcISzO0lo12vc/MQSv jlv93bIBT8KZrSEE2UpskYGOfBdE2DNkRhyGFYHnMEaan1SfM655/ntWCH8+Ue6o3ubpQs weGDMMsesQuH4rMQc17IGL+hgCtGzQw= X-MC-Unique: eTIwUrTYP1WGCaWRCZYhRQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH] qemu: Fix logic bug in inactive snapshot deletion Date: Wed, 9 Dec 2020 10:15:54 +0100 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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) Content-Type: text/plain; charset="utf-8" Commit 926563dc3a6 which refactored the function call deleting the snapshot's on disk state introduced a logic bug, which skips over the deletion of libvirt metadata after the disk state deletion is done. To fix it we must not return early. Resolves: https://gitlab.com/libvirt/libvirt/-/issues/109 Signed-off-by: Peter Krempa Reviewed-by: Erik Skultety --- src/qemu/qemu_domain.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index d6fded9dd1..1af1e4dac8 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -6667,7 +6667,8 @@ qemuDomainSnapshotDiscard(virQEMUDriverPtr driver, if (!def) def =3D vm->def; - return qemuDomainSnapshotForEachQcow2(driver, def, snap, "-d",= true); + if (qemuDomainSnapshotForEachQcow2(driver, def, snap, "-d", tr= ue) < 0) + return -1; } else { priv =3D vm->privateData; qemuDomainObjEnterMonitor(driver, vm); --=20 2.29.2