From nobody Mon Apr 29 14:00:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1569572784; cv=none; d=zoho.com; s=zohoarc; b=LywJVOuDwPzYXPxwoy5UYDF3ZFksKZEb8bdrLSr7H/3xHER8CiWMitoCQJ7xnnsUY1XADk/Rgv0CPdxLl5sm+snBwYfXqM0teWBh4w69wZtj83QWEcSuSIyDPv47W1d7U9IZcG9+NjEFbhH5G/AcvoxRo7xtyw0vysUTBYxe5EY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569572784; 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:ARC-Authentication-Results; bh=Bzv1++5qnL7LMKY4fJ0FXap62M4h524/ZGGBQMfrTRw=; b=P6SMQ/IEQYaUV98aFw79EcgurhPWfoZSdAnnr1EEsnCVYjhuPAEZomc9vGFfts/dgDGMQaZZQ6Vt4vpu067WkodlwY/n4MZy7Tvk3to7VQP1G/gSBNqJl0NLzUaIdHN0dxMQAnckBdEHQdTAlqTYDAMsi0tnIkt5lAE7F/8DRuQ= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1569572784316705.1010056841791; Fri, 27 Sep 2019 01:26:24 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 28285307D84D; Fri, 27 Sep 2019 08:26:22 +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 B966C600C6; Fri, 27 Sep 2019 08:26:20 +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 DCD85180085A; Fri, 27 Sep 2019 08:26:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8R8QHeq019867 for ; Fri, 27 Sep 2019 04:26:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id 40B59608A5; Fri, 27 Sep 2019 08:26:17 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id BD5D660923 for ; Fri, 27 Sep 2019 08:26:14 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Fri, 27 Sep 2019 10:26:13 +0200 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] qemu: checkpoint: Do ACL check prior to snapshot interlocking 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Fri, 27 Sep 2019 08:26:22 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The interlocking with snapshots is executed prior to the ACL check so if a VM has snapshots invoking the checkpoint API may leak it's existance. Introduced with the qemuDomainCheckpointCreateXML API implementation in commit 5f4e0796503. Signed-off-by: Peter Krempa Reviewed-by: Pavel Hrdina --- Split out from the checkpoint refactor series as I didn't notice this one originally. src/qemu/qemu_driver.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index d5f5fd6990..3b2eb30606 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -17283,18 +17283,18 @@ qemuDomainCheckpointCreateXML(virDomainPtr domain, if (!(vm =3D qemuDomObjFromDomain(domain))) goto cleanup; - if (virDomainSnapshotObjListNum(vm->snapshots, NULL, 0) > 0) { - virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", - _("cannot create checkpoint while snapshot exists")= ); - goto cleanup; - } - priv =3D vm->privateData; cfg =3D virQEMUDriverGetConfig(driver); if (virDomainCheckpointCreateXMLEnsureACL(domain->conn, vm->def, flags= ) < 0) goto cleanup; + if (virDomainSnapshotObjListNum(vm->snapshots, NULL, 0) > 0) { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", + _("cannot create checkpoint while snapshot exists")= ); + goto cleanup; + } + if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BITMAP_MERGE)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("qemu binary lacks persistent bitmaps support")); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list