From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mykola Golub Subject: Re: blueprint: consistency groups Date: Tue, 3 May 2016 09:54:36 +0300 Message-ID: <20160503065435.GA2159@gmail.com> References: <20160325071933.GA14634@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mail-lf0-f52.google.com ([209.85.215.52]:32983 "EHLO mail-lf0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751016AbcECGyl (ORCPT ); Tue, 3 May 2016 02:54:41 -0400 Received: by mail-lf0-f52.google.com with SMTP id y84so11233899lfc.0 for ; Mon, 02 May 2016 23:54:40 -0700 (PDT) Content-Disposition: inline In-Reply-To: Sender: ceph-devel-owner@vger.kernel.org List-ID: To: Victor Denisov Cc: Jason Dillaman , Gregory Farnum , Mykola Golub , ceph-devel , Josh Durgin On Mon, May 02, 2016 at 05:26:04PM -0700, Victor Denisov wrote: > I have a question regarding the implementation of list images in a > consistency group. > For referencing images I use their ids and pool ids, since image's > name and pool's name are subject to change. > In order to list the images in a consistency group I have a function: > cg_list_images. > This function only returns ids and pool ids. > I presume normally users would like to see names instead of ids. > Everything in rbd class is written the way that it accepts ioctx. > Which is a handle for accessing pool. > It means(in my opinion) that everything in rbd class should accept > ioctx. As such, I can't open another ioctx when I'm already inside rbd > class. > It leaves me no choice, but to implement image's name resolution in > tools/rbd/action/ConsGrp.cc. > In this case only command line users can have images' names, but not > other services that use librbd library. > Is it fine? You need to add RBD API functions. These functions operate only with image names (image ID is unknown entity for RBD API). And use these functions in tools/rbd/action/ConsGrp.cc. See for example the recently added rbd_mirror_image_status_list(). Internally it uses cls_client::mirror_image_status_list(), which returns image IDs; the list is converted to image names, when returning to the user. -- Mykola Golub