From nobody Sun Feb 8 14:31:06 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=1661272396; cv=none; d=zohomail.com; s=zohoarc; b=Jbtb8iB6lH+zOeNuSDh06asD2IRjbn8PbaaAHLF87yyvLzuDY8qX9xLw9O8/E7LWWXjjP15wU3K+b/d29q4zeRdW9UC8j7OHr5Kqfi+NF2JmjzmGmiKYUc0O9PGhWDIB+OrxFo2CLFhKBybL5Faf4vVuVgyqT4QKNiChpKcQp7E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661272396; 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=cet7zJt/47YnqyOlo7ZXRlStuuy0kUBpiq75u5Acu/c=; b=VMCVxAwLZrt9Xr7N8J2ggnxaVkY6/nRjmNBL1+nT7JYL7nVM2zIqWX+j/FRwTY8PC8ULtMGiw2RapoM449F1kupqVfKT1NecS4+ltBpPfr36EYTeoU9hNqOSdUukOguI1mwuns8WPiJ359aAiXI+homFyKS5jp6UTQN96tmbZ80= 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 1661272396002680.5451497289744; Tue, 23 Aug 2022 09:33:16 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-308-cMtj3WsKNYCoAJ5_Ut657w-1; Tue, 23 Aug 2022 12:33:10 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B46203C1068C; Tue, 23 Aug 2022 16:32:43 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 81B2A2166B2D; Tue, 23 Aug 2022 16:32:43 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 6566B1946A61; Tue, 23 Aug 2022 16:32:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B453D1946A40 for ; Tue, 23 Aug 2022 16:32:42 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id AB115403349; Tue, 23 Aug 2022 16:32:42 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4B732492C3B for ; Tue, 23 Aug 2022 16:32:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661272395; 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=cet7zJt/47YnqyOlo7ZXRlStuuy0kUBpiq75u5Acu/c=; b=i6jOwsPcp/B/rgrMSantIj9Z14d0zqWJIeQi7UihndCOnvcobzBUUPf4kWcQS4e0za5H5b A67o4nElfqCgRWOc7InpzYbd4QR5nXuAECFSru2USucFQCIu7DA3oNPJDdJ0oHFkeG9VMH Z2Ut7qSGBRfWUTC1qQrBHIVLW6cnU/k= X-MC-Unique: cMtj3WsKNYCoAJ5_Ut657w-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt RFC 14/24] qemu_snapshot: introduce qemuSnapshotDiscardMetadata Date: Tue, 23 Aug 2022 18:32:17 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 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: 1661272397480100011 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Pavel Hrdina --- src/qemu/qemu_snapshot.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index 493d83d017..b94506c177 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -2376,10 +2376,9 @@ qemuSnapshotDiscardAllMetadata(virQEMUDriver *driver, =20 =20 static int -qemuSnapshotDeleteSingle(virDomainObj *vm, - virDomainMomentObj *snap, - virQEMUDriver *driver, - bool metadata_only) +qemuSnapshotDiscardMetadata(virDomainObj *vm, + virDomainMomentObj *snap, + virQEMUDriver *driver) { g_autoptr(virQEMUDriverConfig) cfg =3D virQEMUDriverGetConfig(driver); =20 @@ -2400,6 +2399,19 @@ qemuSnapshotDeleteSingle(virDomainObj *vm, virDomainMomentMoveChildren(snap, snap->parent); } =20 + return 0; +} + + +static int +qemuSnapshotDeleteSingle(virDomainObj *vm, + virDomainMomentObj *snap, + virQEMUDriver *driver, + bool metadata_only) +{ + if (qemuSnapshotDiscardMetadata(vm, snap, driver) < 0) + return -1; + return qemuSnapshotDiscard(driver, vm, snap, true, metadata_only); } =20 --=20 2.37.2