Function librbd_sys::rbd_open_read_only [] [src]

pub unsafe extern "C" fn rbd_open_read_only(
    io: rados_ioctx_t,
    name: *const c_char,
    image: *mut rbd_image_t,
    snap_name: *const c_char
) -> c_int

Open an image in read-only mode.

This is intended for use by clients that cannot write to a block device due to cephx restrictions. There will be no watch established on the header object, since a watch is a write. This means the metadata reported about this image (parents, snapshots, size, etc.) may become stale. This should not be used for long-running operations, unless you can be sure that one of these properties changing is safe.

Attempting to write to a read-only image will return -EROFS.

Arguments

  • io ioctx to determine the pool the image is in
  • name image name
  • image where to store newly opened image handle
  • snap_name name of snapshot to open at, or NULL for no snapshot @returns 0 on success, negative error code on failure