Esempio n. 1
0
// RemoveImage removes an image named by the string. Returns an error on failure.
func (p *Pool) RemoveImage(name string) error {
	str := C.CString(name)
	defer C.free(unsafe.Pointer(str))

	if i := C.rbd_remove(p.ioctx, str); i < 0 {
		return strerror(i)
	}

	return nil
}
Esempio n. 2
0
// int rbd_remove(rados_ioctx_t io, const char *name);
// int rbd_remove_with_progress(rados_ioctx_t io, const char *name,
//                  librbd_progress_fn_t cb, void *cbdata);
func (image *Image) Remove() error {
	var c_name *C.char = C.CString(image.name)
	defer C.free(unsafe.Pointer(c_name))
	return GetError(C.rbd_remove(C.rados_ioctx_t(image.ioctx.Pointer()), c_name))
}