From nobody Wed Apr 15 16:41:51 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=1692005833; cv=none; d=zohomail.com; s=zohoarc; b=NpTYZ1eFiAGdNQxM8WgFqZdthw+s3ToRAV+iOpO1fQM1ITVvd8t5WGFDV4vROOS2xqdQdaE12ipEg4+B6xRCQJFif8UHLKiPJ4PuKxmsYQyVp8gV7baWLbr3v94x3Ulxb66jhsCWlIyuZ/kCGQ67MKWRlOimmhvNo6a+XGiV4DM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692005833; 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=g9GK7uhZQj58KdiTXtsHVE8pbLm7TSXGFXtb2gIIfM4=; b=f6J6vRWGoRFMGpwm84k+3e2p1xe4nTcDYtYqACS9TU0T7aru1mn2iSzHzzU+swhzMB4zXHHxuhwBWYw/LnRNCWpbY1dSMxQ80sxjMoNtIzV3E8QR+fPv4ZbbUEpDcvT7ULpUa+gSwGzZoWA5rxwwWAVtIV8STM/yBWPXJSxh6DU= 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 169200583324690.02809063474797; Mon, 14 Aug 2023 02:37:13 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-176-pAOKMudTPp6NWjl38qE9Mw-1; Mon, 14 Aug 2023 05:37:08 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D495B8057AA; Mon, 14 Aug 2023 09:37:04 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id B1042C16023; Mon, 14 Aug 2023 09:37:04 +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 D902219452D0; Mon, 14 Aug 2023 09:36:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B8C94194658F for ; Mon, 14 Aug 2023 09:36:37 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id B668840B4CD1; Mon, 14 Aug 2023 09:36:32 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.45.226.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5A0C440B4CD0 for ; Mon, 14 Aug 2023 09:36:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692005832; 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=g9GK7uhZQj58KdiTXtsHVE8pbLm7TSXGFXtb2gIIfM4=; b=SuugIkEFX5dDD09oDy257lJdgE3JP9wTRawhxxDNne0dhVRqhf6UKShz9ucquSprdlHjYG AIY2k8TnhiTGuJVWWRg9uTnVFm/mubSdLNxZJ0QLQ+zHVi9gRprOmyZusNY49tAnTXcfzM zQzahBvoz56wRYxTfAdeoJSqeS95sP4= X-MC-Unique: pAOKMudTPp6NWjl38qE9Mw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH v3 23/25] qemu_snapshot: check only once if snapshot is external Date: Mon, 14 Aug 2023 11:36:15 +0200 Message-ID: <8e908a497b9e35e9778da3a4557276c6c48ab48f.1692005543.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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 3.1 on 10.11.54.8 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: 1692005834605100003 Content-Type: text/plain; charset="utf-8"; x-default="true" There will be more external snapshot checks introduced by following patch so group them together. Signed-off-by: Pavel Hrdina Reviewed-by: Peter Krempa --- src/qemu/qemu_snapshot.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index 8d0581d33b..dca95b415b 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -3728,18 +3728,18 @@ qemuSnapshotDeleteValidate(virDomainObj *vm, } } =20 - if (virDomainSnapshotIsExternal(snap) && - qemuDomainHasBlockjob(vm, false)) { - virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", - _("cannot delete external snapshots when there is a= nother active block job")); - return -1; - } + if (virDomainSnapshotIsExternal(snap)) { + if (qemuDomainHasBlockjob(vm, false)) { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", + _("cannot delete external snapshots when there = is another active block job")); + return -1; + } =20 - if (virDomainSnapshotIsExternal(snap) && - (flags & VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("deletion of external disk snapshots with childre= n not supported")); - return -1; + if (flags & VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("deletion of external disk snapshots with chi= ldren not supported")); + return -1; + } } =20 return 0; --=20 2.41.0