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 -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html