Function librbd_sys::rbd_list_children [] [src]

pub unsafe extern "C" fn rbd_list_children(
    image: rbd_image_t,
    pools: *mut c_char,
    pools_len: *mut size_t,
    images: *mut c_char,
    images_len: *mut size_t
) -> ssize_t

List all images that are cloned from the image at the snapshot that is set via rbd_snap_set().

This iterates over all pools, so it should be run by a user with read access to all of them. pools_len and images_len are filled in with the number of bytes put into the pools and images buffers. If the provided buffers are too short, the required lengths are still filled in, but the data is not and -ERANGE is returned. Otherwise, the buffers are filled with the pool and image names of the children, with a '\0' after each.

Arguments

  • image which image (and implicitly snapshot) to list clones of
  • pools buffer in which to store pool names
  • pools_len number of bytes in pools buffer
  • images buffer in which to store image names
  • images_len number of bytes in images buffer @returns number of children on success, negative error code on failure @returns -ERANGE if either buffer is too short