From nobody Mon Apr 29 00:34:23 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=1556542631; cv=none; d=zoho.com; s=zohoarc; b=dMtFwXTu/aW9Y5SxC8Y+5bxHER7s4wDo6FoGzVOMocPWKnimJ5Va+naUp+IRdCul4QRrjq+GWzAGty9//5opUAB2ilqat8YkUy32YsfrGxVnh3TOFKoFb5H4/ClstTNK55bziW4bkhiceWIoTKWv2CQBJ7810LfHBAquilB4avE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556542631; h=Content-Type:Content-Transfer-Encoding:Cc: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=OhpMr0Az2RTC0ccSgWCqMpAnMxVUmhLT58vmSEAvkM4=; b=kZb3mA9RmVF/qvirPTfA3Wr8qLbrmsyQA4bq+YcgfS8s2eywaKeQEvoJlE7wjsO3Pja65OgbQO2tk3A9he2s5MpIsuTSWTCKetxAbAhJXvrBd1SFNAYJvXObcw4b/qjwmWB1hcHFf7hXIaKBwG4fhOaeLFwFUxwq3ieZmnuAfEk= 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 1556542631443888.1818163832787; Mon, 29 Apr 2019 05:57:11 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6608630820EA; Mon, 29 Apr 2019 12:57:09 +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 E5DDB6CE61; Mon, 29 Apr 2019 12:57:07 +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 D97C418089CC; Mon, 29 Apr 2019 12:57:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x3TCv4Qs023220 for ; Mon, 29 Apr 2019 08:57:04 -0400 Received: by smtp.corp.redhat.com (Postfix) id E2BFB68B3E; Mon, 29 Apr 2019 12:57:04 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4475768B3A; Mon, 29 Apr 2019 12:57:01 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Mon, 29 Apr 2019 14:56:50 +0200 Message-Id: <16ea98ef656617627c2a763b8e1580f37f328246.1556542540.git.mprivozn@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Lennart.Weller@hansemerkur.de Subject: [libvirt] [PATCH for 5.3.0] storage_backend_rbd: Don't fail iterating over snapshots 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Mon, 29 Apr 2019 12:57:10 +0000 (UTC) Content-Type: text/plain; charset="utf-8" When cloning an RBD volume we try to find a snapshot which is not different to the image we're trying to clone. This boils down to calling rbd_diff_iterate() or rbd_diff_iterate2() on systems with newer ceph. These two are passed a callback - virStorageBackendRBDIterateCb() which mistakenly states that if a negative value is returned from the callback, the iteration is stopped but no error is reported. Well, that is not the case. I've looked into librbd sources and found that a negative value does mean stop of iteration but it also means an error. That's why any attempt to clone an RBD image results in the following error: virsh # vol-clone --pool rbd_image_root coreos_2023 coreos00.disk error: Failed to clone vol from coreos_2023 error: failed to iterate RBD snapshot coreos_2023@base: Operation not permitted Reported on libvirt-users list: https://www.redhat.com/archives/libvirt-users/2019-April/msg00060.html Signed-off-by: Michal Privoznik --- src/storage/storage_backend_rbd.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backen= d_rbd.c index f8c968e682..3fe188551c 100644 --- a/src/storage/storage_backend_rbd.c +++ b/src/storage/storage_backend_rbd.c @@ -1031,14 +1031,9 @@ virStorageBackendRBDIterateCb(uint64_t offset ATTRIB= UTE_UNUSED, { /* * Just set that there is a diff for this snapshot, we do not care whe= re - * - * When it returns a negative number the rbd_diff_iterate() function w= ill stop - * - * That's why we return -1, meaning that there is a difference and we = can stop - * searching any further. */ *(int*) arg =3D 1; - return -1; + return 0; } =20 static int --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list